// Get the users name.
cout << "Enter your name: ";
cin.getline(UserName, MaxString);
//Get the number of daytime minutes.
cout << "Enter the daytime minutes: ";
cin >> Dmins;
//Get the number of nighttime minutes.
cout << "Enter the nighttime minutes: ";
cin >> Nmins;
//Calculate the price for regular plan.
if (Dmins+Nmins)<=50;
{
RPlan=10;
}
else
{
RPlan=10+((Dmins+Nmins)*.2);
}
//Calculate the price for premium plan.
if Dmins<=75;
PPlanDay=0;
else
PPlanDay=Dmins*.1;
{
if (Nmins)<=100;
PPlanNight=0;
else
PPlanNight=Nmins*.05;
}
PPlan=25+(PPlanDay+PPlanNight);
//Print the plan that is the cheapest.
if RPlan < PPlan;
{
cout << UserName << ", you are better off with the " << RPlan << endl;
}
else
{
cout << UserName << ", you are better off with the " << PPlan << endl;
}