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 件のコメント

Jan
Jan 2012 年 10 月 22 日
What kind of help do you want? Do you hope that somebody posts a running program?

サインインしてコメントする。

回答 (2 件)

Matt J
Matt J 2012 年 10 月 21 日

0 投票

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

1 件のコメント

Ong
Ong 2012 年 10 月 21 日
after the menu command, how do i do the looping part for this question?

サインインしてコメントする。

Walter Roberson
Walter Roberson 2012 年 10 月 22 日

0 投票

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.

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

質問済み:

Ong
2012 年 10 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by