Question: Don't use Lists or Functions in these three problems. Exercise # 2: Write a while loop that prints all positive numbers that are divisible by
Don't use Lists or Functions in these three problems.
Exercise # 2: Write a while loop that prints all positive numbers that are divisible by 10 and less than the user input value n. For example, if the user enters 100, the program shall print 10 20 30 40 50 60 70 80 90. The following are sample runs of the program.
- Exercise # 3: Write a program that first asks the user to type today's price for one dollar in Japanese yen, then reads US dollar values and converts each to yen. Use 0 as a sentinel.
- The following are sample runs of the program.
- Exercise # 4: Write a program that prompts for and reads the number n of spheres to be processed. If 0n0 your program must display an error message and terminate; otherwise it does the following for n times:
- Prompts for and reads the volume of a sphere, it then displays the surface area of the sphere with that volume. Assume that each volume is in cubic centimeters.
- The program finally displays the average of the surface areas of the n spheres.
- Please note that
- =3.14159=3.14159.
- volume =433=43r3.
- surface area =42=4r2.
- The following are sample runs of the program.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
