converting a time in seconds to other units using loop
Mostrar comentarios más antiguos
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 comentario
Jan
el 22 de Oct. de 2012
What kind of help do you want? Do you hope that somebody posts a running program?
Respuestas (2)
Walter Roberson
el 22 de Oct. de 2012
0 votos
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.
Categorías
Más información sobre MATLAB en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!