Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In this exercise, you will create a program that displays the amount of a cable

ID: 3861212 • Letter: I

Question

In this exercise, you will create a program that displays the amount of a cable bill. the amount is based on the the type of customer, as shown in Figure 10-30. For a residential customer, the user will need to enter the number of prememium channels only.For a business customer, the user will need to enter the number of each number of connections fo and the number oof premium tomer, the user will need to enter th number of connections and the number of premium channels.Use a sepreate void functionfor each customer type. If necessary, create a new project named Advanced23Project, and save it in the Cpp8Chap10 folder. Enter your C++ instructions into a source file named Advanced23.cpp. Also enter appropriate commments and any additional instructions required by the compiler. test the program appropriately.

Explanation / Answer


#include <iostream>
using namespace std;
int main()
{
int chan, con, ch;
double bill;
cout<<" User choice";
cout<<" 1. Residential Customer";
cout<<" 2. Business Customer";
cout<<" 3. Exit";
cout<<" Enter User Choice: ";
cin>>ch;
switch(ch)
{
case 1: // for Residential customer
cout<<" Residential Customer";
cout<<" Enter the Number of Premium channels: ";
cin>>chan;
bill = (chan * 5) + 30 + 4.50;
cout<<" The Bill Amount is:" <<bill;
break;
case 2: // for Business customer
cout<<" Business Customer";
cout<<" Enter the Number of Premium channels: ";
cin>>chan;
cout<<" Enter number of Connections: ";
cin>>con;
if(con <= 5) // if connection is less than 5
{
bill = (chan * 5) + 80 + 16.50;
cout<<" The Bill Amount is:" <<bill;
}
if(con > 5) // if connection is greater than 5
{
bill = (chan * 5) + (con + 84) + 16.50;
cout<<" The Bill Amount is:" <<bill;
}
break;
case 3:
cout<<" Program Ends";
exit(0);
}
return 0;
}

OUTPUT
User choice
1. Residential Customer
2. Business Customer
3. Exit
Enter User Choice: 1
Residential Customer
Enter the Number of Premium channels: 5
The Bill Amount is:59.5


User choice
1. Residential Customer
2. Business Customer
3. Exit
Enter User Choice: 2
Business Customer
Enter the Number of Premium channels: 10
Enter number of Connections: 5
The Bill Amount is:146.5


User choice
1. Residential Customer
2. Business Customer
3. Exit
Enter User Choice: 2
Business Customer
Enter the Number of Premium channels: 10
Enter number of Connections: 10
The Bill Amount is:160.5


User choice
1. Residential Customer
2. Business Customer
3. Exit
Enter User Choice: 3
Program Ends

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote