Hi again everyone, so it seems I have everything working except my rounding. I want the final output to give me two decimal places not one. Also how do you write it into the forum as code?
int main()
{
//Declare Variables
string userInput;
double basePrice = 0.0;
double subTotal = 0.0;
double finalPrice = 0.0;
string optionPackageCodeArray[5] = { "BB", "SP", "NP", "HE", "UC" };
string packageNameArray[5] = { "Base", "Sport", "Intermediate", "Luxury", "User Specified" };
double packageCostArray[5] = { 1500.00, 3250.00, 4575.00, 7500.00, 5220.00 };
//Prompt user for Base Price
cout << "Enter Base Price for Car:";
cin >> basePrice;
//Promt user for Code
cout << "Enter the 2-letter Code:";
cin >> userInput;
//Loop to check if code is Valid
for (int i = 0; i < 5; i++)
{
if (userInput == optionPackageCodeArray[i])
{
//Code is valid
//Prices are computed
subTotal = basePrice + packageCostArray [i];
finalPrice = (subTotal * .015) + subTotal;
//Display the result
cout <<"Package: " <<packageNameArray[i] << endl <<"Final Price : $" << setprecision (2) << finalPrice << endl;
//This is here because otherwise system refused to pause, it is also efficient.
system ("PAUSE");
return 0;
}//end if
}//end for
//Code input was not valid
cout << "ERROR: Bad Code" << endl;
system ("PAUSE");
return 0;
} //end of main