473,320 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Input time in seconds-output in hours, minutes, seconds

I would like to ask for some help with this assignment as i don't know how to start it.

Write a C++ program that prompts the user to input the elapsed time for an event in seconds. The program then outputs the elapsed time in hours, minutes, and seconds. (for example, if the elapsed time is 9630 seconds, then the output is 2:40:30.)

Can anyone pls help me!!
Im using visual studio
Thanks to those who help me and have the patience to read.
Feb 6 '07 #1
1 8871
Ganon11
3,652 Expert 2GB
Think about the math involved. How will you convert seconds into minutes? Minutes into hours? How will you know how to get the leftovers?

Once you answer these questions you will be able to easily convert these steps into C++.

Note: You will likely use the division operator / and the modulus division operator % frequently.
Feb 6 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Pif Paf | last post by:
I have a process, and my process wants to wait for input but only for a certain amount of time. The input might be coming from a Python file object (created with popen) or a TCP socket. What I...
0
by: gotcha | last post by:
I have a little code to add multiple items to a shopping cart based page. This code works perfect, but it adds all of the info to the same input fields every time it loops. I need it to change...
2
by: Jerry | last post by:
With the following code I am trying to simply set and display the current date time in an input box. The input box will not accept a variable that contains any spaces (i.e., a space between date and...
9
by: Shaiboy_UK | last post by:
Hi all, Hopefully something simple here. I have written a form that takes data from a text box and updates it into an Access database. However, I want to also pass the local user date and...
12
by: Susan Cranford | last post by:
Please forgive, I have looked at so much info I can't figure out how to put it together even though I know it must be fairly simple. I have an array of input text boxes (txtDOBn) where n is...
4
by: David W. Fenton | last post by:
I'm working on a subform where users put in 24-hour time. On their paper forms, they've been accustomed to referring to midnight as 24:00 (instead of as 0:00, which kind of makes sense from a human...
3
by: Fao, Sean | last post by:
Hello all, As stated in another message, it's been a long time since I've done any C coding and I'm not feeling comfortable that I'm doing this correctly. Basically, I'd like to verify that my...
7
by: ero | last post by:
Is it possible to input values into a web form from an external source like a client-side javascript? There is a web site that I'm viewing where I have to enter 5 values in the form. 4 of the...
8
omerbutt
by: omerbutt | last post by:
hi there i have a form with multiple input (type/text ) fields and three inputs(type/file) fields i have to submit the form via ajax because i have multiple forms on this page ,you can say it is a...
5
leannsmarie
by: leannsmarie | last post by:
Hi Everyone, I have a problem with a program I have been assigned thats driving me crazy and I hope someone with a fresh eye could point me in the right direction. Im using Visual Basic Express...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.