Write a program only in c++ Problem is as follows Marcy\'s Department store is h
ID: 3637395 • Letter: W
Question
Write a program only in c++Problem is as follows
Marcy's Department store is having a BoGoHo (buy one, get one half off) sale. The store manager wants a program that allows the salesclerk to enter the prices of two items. The program should both calculate and display the total amount the customer owes. The half-off should always be taken on the item having the lowest price. For example, if the items cost $24.99 and $10, the half-off would be taken on the $10 item.
Please write program in c++ that's all.
Explanation / Answer
please rate - thanks
#include <iostream>
using namespace std;
int main()
{double price1,price2,total;
cout<<"Enter price of 1st item: ";
cin>>price1;
cout<<"Enter price of 2nd item: ";
cin>>price2;
if(price1<price2)
total=price2+.5*price1;
else
total=price1+.5*price2;
cout<<"Your total price is $"<<total<<" plus tax ";
system("pause");
return 0;
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.