Question: In C++ P5.13 Write a function double read_double(string prompt) that displays the prompt string, followed by a space, reads a floating-point number in, and returns
In C++


P5.13 Write a function double read_double(string prompt) that displays the prompt string, followed by a space, reads a floating-point number in, and returns it. Here is a typical usage: salary = read_double("Please enter your salary:"); perc_raise = read_double("What percentage raise would you like?"); Please work on P5.13 on page 239. If the input value is invalid, prompt the user to re-enter. Please use the following test cases to test your program. Test Cases: Case 1: Salary: -$50,000 Percentage raise: 20% (-20) Message: "Do you want to continue (y)?" Case 2: Salary: $50,000 Percentage raise: - 20% (-20) Message: "Do you want to continue (y)?" Case 3: Salary: $50,000 Percentage raise: 20% (.20) Message: "Do you want to continue (y)?" Case 4: Salary: Q Message: "Exit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
