So I'm trying to write a program that will determine how much someone has for a phone bill for a project for my C++ class and I cannot for the life of me figure out what is wrong with my last switch statement. Can somebody help me please?
cout << "Your account number is " << accoutnnumber << "." << endl;
cout << "You have a regular user acount." << endl;
cout << "You have used " << totalminutes << " minutes." << endl;
cout << "Your amount due is " << setprecision(2) << fixed << totalcost << endl ;
}
break ;
}
case 'P' :
{
const double cost = 15 ;
const double addcost = .1 ;
const double nightcost = .05 ;
const int minutes = 75 ;
const int nightminutes = 100 ;
double addminutes = 0 ;
double addnightminutes = 0 ;
double extracost = 0 ;
int totalminutes = 0 ;
double totalcost = 0 ;
char night ;
int minutesused = 0 ;
int nightminutesused = 0 ;
int totalnightminutes = 0 ;
cout << "Please enter the number of minutes used." << endl ;
cin >> minutesused ;
cout << "Were any night minutes used? Please enter 'Y' or 'N'." << endl ;
cin >> night ;
cout << "Your account number is " << accoutnnumber << "." << endl;
cout << "You have a premium user acount." << endl;
cout << "You have used " << totalminutes << " minutes." << endl;
cout << "Your amount due is " << setprecision(2) << fixed << totalcost << endl ;
}
break ;
}
}
{
case 'Y' :
{
cout << "please enter the total number of night minutes used." ;
cin >> nightminutesused ;
cout << "Your account number is " << accoutnnumber << "." << endl;
cout << "You have a premium user acount." << endl;
cout << "You have used " << totalminutes << " minutes and "<< totalnightminutes << " night minutes." << endl;
cout << "Your amount due is $15.00" << endl ;
}
2) Why do you think there's something wrong with it? If there's a problem that you're seeing, then tell us what the problem is. Don't make us jump through hoops and have to guess.