Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2. Write a program, range.cpp, that reads a double, a character and two more double values from the user n ch rl r2 The character
2. Write a program, range.cpp, that reads a double, a character and two more double values from the user n ch rl r2 The character ch is one of i (upper or lowercase), o (upper or lowercase) or e (upper or lowercase) rl and r2 represent a range of values. For each possible value of ch, the program does the following Ch Action i, IProgram prints whether n is strictly inside the range o, O Program prints whether n is strictly outside the e, EProgram prints whether n is egual to r1 or r2 from r1 to r2 range from r1 to r2 Other Proaram prints an error message The program should print both positive and negative statements when appropriate and include the values in the answer Here are a few sample runs (user input in bold) Enter your command string: 5 3 10 Yes, 5 is inside the range 3 10 Enter your command string: 19.5 o 10 23.2 No, 19.5 is not outside the range 10
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