In: Computer Science
Answer: Hi! Kindly find your solution here. You didn't mention any language for a program that's why I used C++ language. If you have any queries, feel free to ask me. Thanks.
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int item;
double tax,cost,total,save;
cout<<"There are two items in
sale:"<<endl;
cout<<"Item 1"<<endl;
cout<<"Item 2"<<endl;
cout<<"Which item do you want to buy? enter 1
for Item 1 and 2 for Item,3 for both 2"<<endl;
cin>>item;
if(item==2)
{
cost=item*65.50;
tax=cost*7/100;
cost=cost+tax;
cout<<"Total cost is: $
"<<fixed<<setprecision(2)<<cost;
}
else
if(item==3)
{
cost=39.75+65.50;
tax=cost*7/100;
cost=cost/2;
save=cost;
cost=cost+tax;
cout<<endl<<"Total cost
is:$'<<fixed<<setprecision(2)<<cost;
cout<<endl<<"He saved
:$ "<<save;
}
return 0;
}
cost=65.50; tax-cost 7/100; cost cost+tax: Total cost is: $59.99 He saved : $ 52.62