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

Internet Service Provider An Internet service provider has three different subsc

ID: 3929691 • Letter: I

Question

Internet Service Provider

An Internet service provider has three different subscription packages for its customers:

Package A: $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour.

Package B: $14.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour.

Package C: $19.95 per month unlimited access is provided.

Write a program (c++) that calculates a customer’s monthly bill. It should ask which package the customer has purchased and how many hours were used. It should then display the total amount due. Input Validation: Be sure the user only selects package A, B, or C. Also, the number of hours used in a month cannot exceed 744. Exit the program if user enters incorrect information.

Internet Service Provider, Part 2

Modify the program (Don’t forget to save the first version for submission!) for Internet Service Provider Part 1 so that it also displays how much money Package A customers would save if they purchased packages B or C, and how much money Package B customers would save if they purchased Package C. If there would be no savings, no message should be printed.

Explanation / Answer

#include <iostream>
using namespace std;
int main()
{
char package;
int hours;
cout << "Select a package: " << endl;
cout << "Package Cost Hours Provided Extra Hours" << endl;
cout << "A $9.95 10 $2.00 per hour" << endl;
cout << "B $14.95 20 $1.00 per hour" << endl;
cout << "C $19.95 Unlimited Unlimited" << endl;
cout << " Enter the package purchased: ";
cin >> package;
while(package!= 'A' && package!='a' && package!='B' && package!='b'&&package!='C' && package!='c')
{
cout <<" Error! You must select package A, B, or C. ";
cout <<"Enter the package purchased: ";
cin >> package;
}
cout <<" Enter the number of hours used: ";
cin >>hours;
cin.get();
while(hours < 0 || hours > 744)
{cout <<" Error! Hours cannot be negative or exceed 744. You must enter appropriate hours.";
cout <<" Enter the number of hours used. ";
cin >> hours;
}
if(package == 'A' || package == 'a')
{
if (hours <= 10)
cout<<" Your monthly fee is: $9.95";
else cout<<" Your monthly fee is: $"<<9.95+(hours-10)*2;
}
if(package == 'B' || package == 'b')
{if (hours <= 20)
cout<<" Your monthly fee is: $14.95";
else cout<<" Your monthly fee is: $"<<14.95 + hours - 20;}
if(package == 'C' || package == 'c')
cout<<" Your monthly fee is: $19.95";
cin.get();
return 0;
}

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