Understanding if else Statements
In this exercise, you use what you have learned about writing if else statements in C++ to study a complete C++ program that uses if else statements. This program was written to calculate customer charges for a telephone company. The telephone company charges 25 cents per minute for calls outside of the customer’s area code that last over 10 minutes. All other calls are 10 cents per minute. Take a few minutes to study the code that follows, and then answer Questions.
// Telephone.cpp - This program determines telephone call// charges.#includeusing namespace std;int main(){int custAC, custNumber;int calledAC, calledNumber;int callMinutes;double callCharge;const int MAX_MINS = 10;const double CHARGE_1 = .25;const double CHARGE_2 = .10;custAC = 847;custNumber = 5551234;calledAC = 630;calledNumber = 5557890;callMinutes = 50;if(calledAC != custAC && callMinutes > MAX_MINS)callCharge = callMinutes * CHARGE_1;elsecallCharge = callMinutes * CHARGE_2;cout ≪ "Customer Number: " ≪ custAC ≪ "-" ≪ custNumber≪ endl;cout ≪ "Called Number: " ≪ calledAC ≪ "-"≪ calledNumber ≪ endl;cout ≪ "The charge for this call is $" ≪ callCharge≪ endl;return 0;}
What is the exact output if the expression in the if statement is changed to callMinutes >= MAX_MINS?
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.