#include <iostream>
#include <string>
using namespace std
int main()
{
string price[5], quantity[5];
int total[5], total_ammount=0, discount;
cout<<"Add item[Y/N]: "
string response;
cin>>response;
int n=0;
while(response=="Y" and n<5){
cout<<"Enter price: "
cin>>price[n];
cout<<"Enter quantity: ";
cin>>quantity[n];
total[n]=stoi(price[n])*stoi(quantity[n]);
total_ammount=total_ammount+total[n];
n++
cout<<"Add more items[Y/N]: ";
cin>>response;
}
cout<<"OFFICIAL RECIEPT"<<endl;
cout<<"Item Price Qty Total"<<endl;
for(int i=0;i<n;i++){
cout<<i+1<<" "<<price<<" "<<quantity<<" "<<total<<endl
}
if(total_ammount>5000){
discount=0.70*total_ammount;
}
else if(total_ammount>2500){
discount=0.50*total_ammount;
}
else if(total_ammount>1000){
discount=0.35*total_ammount;
}
else{
discount=0.15*total_ammount;
}
cout<<"discount = "<<discount<<endl
cout<<"TOTAL php"<<total_ammount-discount<<endl;
return 0;
}