Question: I need help getting these outputs to turn out correctly. New to programming. #include #include using namespace std; int main ( ) { int numCredits

I need help getting these outputs to turn out correctly. New to programming.
#include
#include
using namespace std;
int main()
{
int numCredits =0;
char parkingOption ='';
char numResidencyCode ='';
double costTution =0;
double totalBill =0;
const double costParkingCharge =50.00;
const double priceCounty =100.00;
const double priceState =150.00;
const double priceOutOfState=300.00;
//assign rates
if(numResidencyCode =='c')
{
costTution = priceCounty;
}
if(numResidencyCode =='s')
{
costTution = priceState;
}
else if(numResidencyCode =='o')
{
costTution = priceOutOfState;
}
//calculate tution
{
cout << "Enter the number of credits:";
cin >> numCredits;
cout << "Enter the resisdency code (c)county,(s)state,(o)out of state:";
cin >> numResidencyCode;
numResidencyCode = toupper(numResidencyCode);
cout << "Enter the parking option (y/n):";
cin >> parkingOption;
if(parkingOption =='y')
{
costTution = costTution + costParkingCharge;
}
else if(parkingOption =='n')
costTution = totalBill;
}
cout << fixed << setprecision(2);
cout << "Total bill: $"<< totalBill << endl;
cout << endl <<"Tuition Bill" << setw(8)<< endl;
cout << "Number of Credits:" << setw(8)<< numCredits << endl;
cout << "Tuition Cost:" << setw(8)<< costTution << endl;
cout << "Parking Charge:" << setw(8)<< costParkingCharge << endl;
cout << "Total Bill:" << setw(8)<< totalBill << endl;
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!