# TimeApp

• December 16th, 2011, 02:29 PM
NewAtJava
TimeApp
can someone give me some help on how to write the following program. I have to calculate how long it would take for 50Mb file to download using a 56k analog modem. A 56k analog modem downloads 5.2 kilo bytes per second. 1 mb=1,024 kb. When finished the program should display how many hours minutes and seconds it would take to download the file. and then try the program on a different amount of MB. Any help would be appreciated. I know how to do the math but i dont know how to get the hours minutes and seconds seperately to display and calculate.
• December 16th, 2011, 04:41 PM
Norm
Re: TimeApp
Can you explain your problem? If you understand the math, you should be able to compute the hours, minutes and seconds.
• December 16th, 2011, 05:13 PM
NewAtJava
Re: TimeApp
Quote:

Originally Posted by Norm
Can you explain your problem? If you understand the math, you should be able to compute the hours, minutes and seconds.

I dont know how to get the computer to compute the hours and minutes and seconds.
• December 16th, 2011, 05:52 PM
Norm
Re: TimeApp
Quote:

how to get the computer to compute the hours and minutes and seconds.
You need to use some arithmetic expressions and assignment statements.
You stated: I know how to do the math
Write the algebraic expressions to compute the total time and then how to compute the hours, minutes and seconds.
If it takes 155 seconds to do it, what are the hours, minutes and seconds for that? Write down the equations and then convert them to java.
• December 16th, 2011, 07:19 PM
NewAtJava
Re: TimeApp
Quote:

Originally Posted by Norm
You need to use some arithmetic expressions and assignment statements.
You stated: I know how to do the math
Write the algebraic expressions to compute the total time and then how to compute the hours, minutes and seconds.
If it takes 155 seconds to do it, what are the hours, minutes and seconds for that? Write down the equations and then convert them to java.

The math when it is done is 164minutes now my problem is how do i make convert this too: 2 hours 44 minutes and 6 seconds. That is my problem . I have just started Murachs java se 6 book. Kind a new at everything so forgive me if im not writing the problems correctly. Thanks for replies hopes this helps.
• December 16th, 2011, 07:47 PM
Norm
Re: TimeApp
This problem so far is not about writing any programs or code. Before you write any program you must have decided exactly what the program is to do. For this problem you need to come up with the arithmetic equations to convert a large number of seconds into hours, minutes and seconds.
If you take paper and pencil how would you do it? Then try to come up with an equation that will do it.
Then the last thing, think about how to code that equation in java.