Understanding Nested if Statements
In this exercise, you use what you have learned about writing nested if statements. This program was written for the Woof Wash dog-grooming business to calculate a total charge for services rendered. Woof Wash charges $12 for a bath, $10 for a trim cut, and $7 to clip nails. Take a few minutes to study the code that follows, and then answer Questions.
// WoofWash.cpp - This program determines if a doggy// service is provided and prints the charge.#include#include using namespace std;int main(){string service;const string SERVICE_1 = "bath";const string SERVICE_2 = "cut";const string SERVICE_3 = "trim nails";double charge;const double BATH_CHARGE = 12.00;const double CUT_CHARGE = 10.00;const double NAIL_CHARGE = 7.00;cout ≪ "Enter service: ";cin ≫ service;if(service == SERVICE_1)charge = BATH_CHARGE;else if(service == SERVICE_2)charge = CUT_CHARGE;else if(service == SERVICE_3)charge = NAIL_CHARGE;elsecharge = 0.00;if(charge > 0.00)cout ≪ "The charge for a doggy " ≪ service ≪ " is $"≪ charge ≪ endl;elsecout ≪ "We do not perform the " ≪ service≪ " service." ≪ endl;return 0;}
What is the exact output when this program executes if the user enters "shave"?
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.