Question
Design a solution and write its C++ code by using switch-case statements . It takes an integer argument and checks if it is a positive
Design a solution and write its C++ code by using switch-case statements. It takes an integer argument and checks if it is a positive integer. In case of a zero or negative input it displays an error message. In case of a positive input it displays following output:
A if the input is between 1 and 30 (1 and 5 included)
B if the input is between 31 and 70 (3 and 7 included)
C if the input is between 71 and 100 (71 included)
D if the input is between 100 and 150 (100 and 150 included)
F if the input is greater than 150.
Keep your code commented and indented for ease of reading. Paste your commented codes in the solution and also add a clear screen shot of outcome in your solution.
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