Problem

Understanding if else StatementsIn this exercise, you use what you have learned about writ...

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.#include using 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 when this program executes?

Step-by-Step Solution

Request Professional Solution

Request Solution!

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.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 4.2
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT