Question
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...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