Answer to Question #294703 in C++ for alk

Question #294703

Create a Program

You will create a program that displays amount of a cable bill. The Amount is based on the type of customer, as shown in the figure. For a residential customer, the user will need to enter the number of premium channels only. For a business customer, the user will need to enter the number of connections and the number of premium channels. Also enter appropraite comments and any additional instructions in your c++ program. Test the program appropriately before submission. 


1
Expert's answer
2022-02-07T12:50:45-0500
#include <iostream>
using namespace std;


int main() {
	int customerType;//customer type:
	//select customer type
	cout<<"1. Residential customer\n";
	cout<<"2. Business customer\n";
	cout<<"Select customer type: ";
	cin>>customerType;


	int numberPremiumChannels;//the number of premium channels
	int numberConnections=0;//the number of connections
	float amountCableBill=0;
	if(customerType==1){
		cout<<"Enter the number of premium channels: ";
		cin>>numberPremiumChannels;
		amountCableBill=numberPremiumChannels*5;
	}else if(customerType==2){
		cout<<"Enter the number of connections: ";
		cin>>numberConnections;
		cout<<"Enter the number of premium channels: ";
		cin>>numberPremiumChannels;
		amountCableBill=numberPremiumChannels*5+numberPremiumChannels*5;
	}else{
		cout<<"\nWrong customer type\n\n";
	}
	//display Amount of a cable bill
	cout<<"Amount of a cable bill = "<<amountCableBill<<"\n\n";


	cin>>customerType;
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog