Hi all, i have problem running this code that i built based on this C++ question and I am having trouble running. Please helppp
The question is as follows
An Internet service provider has three different subscription packages for its customers:
Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour.
Package B: For $14.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour.
Package C: For $19.95 per month unlimited access is provided.
Write a program 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.
This is my code
#include <iostream>
using namespace std;
int main()
{
char package;
double total_amount=0;
int hours =0;
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;
while(hours < 0 || hours > 744)
{
cout << "Error! Hours cannot be negative or exceed 744. You must enter appopriate hours. ";
cout << "Enter the number of hours used. ";
cin >> hours;
}
@Donnie - Thank you soo much. You are a lifesaver. You program runs great. Also, would you have any idea how could i build a pseudocode for such a big program as this ? Can I copy and paste my pseudocode for your reference ? Also, how would I create a flowchart based on this program. That is a real biggie challenge. Any idea ? Thanks soo much again.
Nelson007, really glad the program works. Sorry I can't help you with pseudocode or flowcharts , still have to learn about them. By all means post it, but might take me awhile to get my mind around it! Cheers, Don