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 Comment

What kind of help do you want? Do you hope that somebody posts a running program?

Sign in to comment.

Answers (2)

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

1 Comment

after the menu command, how do i do the looping part for this question?

Sign in to comment.

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.

Categories

Find more on MATLAB in Help Center and File Exchange

Asked:

Ong
on 21 Oct 2012

Community Treasure Hunt

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

Start Hunting!