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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started