converting a time in seconds to other units using loop

Help me with this question! i dont know how to even start!
Write a menu-driven program convertTime.m to convert a time in
seconds to other units (minutes, hours, days). The main function will
loop to continue until the user chooses to exit. Each time in the loop,
the function will generate a random time in seconds, call a function to
present a menu of options, and print the converted time. The conver-
sions must be made by individual functions (e.g. one to convert from
seconds to minutes, one to convert from seconds to hours, and one to
convert from seconds to days). All user-entries must be error-checked.

1 Kommentar

Jan
Jan am 22 Okt. 2012
What kind of help do you want? Do you hope that somebody posts a running program?

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Matt J
Matt J am 21 Okt. 2012

0 Stimmen

See the MENU command for getting the user input.
The rest will use the same kind of techniques as your previous post.

1 Kommentar

Ong
Ong am 21 Okt. 2012
after the menu command, how do i do the looping part for this question?

Melden Sie sich an, um zu kommentieren.

Walter Roberson
Walter Roberson am 22 Okt. 2012

0 Stimmen

Your concern, expressed in your other Question, about the range of values to generate the random numbers over, would normally be a good one, but in the context of the assignment question that you have presented here turns out to be misplaced. As there is no indication in the question about the range of values you are required to generate over, you are left free to choose the range of values. So just arbitrarily pick any range of values, and declare that the number returned represents "seconds". An input of (say) 3.71344623E-43 seconds is still an input of seconds: nothing in the question requires that any value be more than 1 second, just that the value be random.

Kategorien

Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange

Gefragt:

Ong
am 21 Okt. 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by