Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a c++ program that will allow a user to enter a number between 10 and 30. If the number is outside the range, output

Write a c++ program that will allow a user to enter a number between 10 and 30.  If the number is outside the range, output “An invalid number has been entered.”, then end the program. If a valid number has been entered, allow a user to enter a code of A, B, or C. If an invalid code is enter, output “An invalid code has been entered.”, then end the program.  Using the value 28.82, if the number entered is between 10 and 20, and code equals ‘A’, add 5 to the decimal value( ex: 2.2 + 5 = 7.2). If the number entered is between 19 and 30, and the code equals ‘B’, add 10 to the decimal value.  If the number entered is between 19 and 30, and the code equals ‘C’, add 100 to the decimal value( ex: 2.2 + 5 = 7.2). All other criteria is invalid and you should output “Invalid criteria.”

Once decimal value is computed, output all on a new line, the number entered, the code entered and the computed value and end the program.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Sure here is the C program that meets the specified requirement... 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

Java An Introduction To Problem Solving And Programming

Authors: Walter Savitch

8th Edition

0134462033, 978-0134462035

More Books

Students also viewed these Computer Network questions

Question

Describe three types of learning discussed in the work of Koffka.

Answered: 1 week ago

Question

How does selection differ from recruitment ?

Answered: 1 week ago