Question: Write a program, with comments, to do the following: Ask the user to enter a positive integer (between 0 to 9) n Check the value

Write a program, with comments, to do the following: Ask the user to enter a positive integer (between 0 to 9) n Check the value entered to see if it corresponds to a positive integer. If the user entered a positive integer do the following: If 0 < n < 30 calculate 2n then print n and the calculated result with a suitable message. message. message. (1) (2) (3) (4) If 30 < n < 50 calculate then print n and the calculated result with a suitable If 50 < n < 80 calculate then print n and the calculated result with a suitable If n > 80 calculate then print n and the calculated result with a suitable 1.2(0.2n) Otherwise, print the message You did not enter a valid input!.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!