Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

>> REGISTER NOW TO START POSTING

1. ## 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.  Reply With Quote

2. ## Re: TimeApp

Can you explain your problem? If you understand the math, you should be able to compute the hours, minutes and seconds.  Reply With Quote

3. ## Re: TimeApp 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.  Reply With Quote

4. ## Re: TimeApp

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.  Reply With Quote

5. ## Re: TimeApp 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.  Reply With Quote

6. ## 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.  Reply With Quote