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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!