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
2012년 10월 22일
What kind of help do you want? Do you hope that somebody posts a running program?
답변 (2개)
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.
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 Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!