insert
Code:
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
//declare variables
double itemOnePrice = 0.0;
double itemTwoPrice = 0.0;
char discountHalfOff = ' ';
cout << "Enter item one price: ";
cin >> itemOnePrice;
cout << "Enter item two price: ";
cin << itemTwoPrice;
cout << "Discount? If yes press Y if no press any other key: ";
cin >> discountHalfOff with ".50";
//Calculate total owed, if necessary
if (toupper (discountPercentage) == 'Y')
{ total = itemOnePrice + itemTwoPrice / discountPercentage;
//calculate total owed
total = itemOnePrice + itemTwoPrice / discountHalfOff;
{
total = itemOnePrice + itemTwoPrice / 2;
}
cout << "Total Owed: $" << total << endl;
return 0;
}
Is this more accurate. The program must take the half off of the lowest priced item. Thank you for your notes on the program