Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Demystifying Databases A Hands On Guide For Database Management

Authors: Shiva Sukula

1st Edition

8170005345, 978-8170005346

More Books

Students also viewed these Databases questions

Question

Prepare a constructive performance appraisal.

Answered: 1 week ago

Question

List the advantages of correct report formatting.

Answered: 1 week ago