CMPSC 101 - Variables Worksheet #9 Name -

1. Write a program that allows the user to input integer values until the resulting total of the inputted values is greater than 100. Prompt the user to input integer values between or including 1 and 10. Just after the user inputs a value that causes the total to be greater than 100, the program should display the previous subtotal (that was less than or equal to 100.)

 

 

 

 

 

 

 

2. Write a complete program that uses a while loop to successively multiply the variable number by 4 and display each product on a new line. Use an integer variable numTimes as the loop's control variable and use it to make sure that the loop iterates exactly 10 times. The integer variable number should be initialized to 1. Continue your answer on the back of the worksheet if necessary.