Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

The Type int [13/14]

This program uses operators // and %% to recompute length of a movie given in minutes into hours and remaining minutes.

After running this program, change it so that it transforms a given number of days into weeks and remaining days. Use a variable named days.

Try the new program for values of 10 days, 14 days, 20 days, and 21 days.

Then, enclose the entire program in a for loop (i.e. the entire program should become a block of statements between the curly braces). Make the loop control variable i start from 1 and end with 23. Don't forget to use the correct indentation for the block of the loop, to keep the program tidy. Make the initial value of variable days equal to value of variable i. Also, add a statement sleepMs(200) as the last statement of the loop.

After running and examining the output, try to remove the variable i from the program by using the variable days as a loop control variable.

Loading...