What's new

Help Pa Unlock po Chegg salmat po

#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;

}
 
[XX='Hoshiumi, c: 1196029, m: 631418'][/XX] Magandang gawi to idol. Para yung mga nag rerequests eh mahikayat na aralin muna yung mga requests nila. Keep it up po! :giggle:
 
1620895587490.png


Boss Hoshiumi
 

Attachments

[XX='Hoshiumi, c: 1196087, m: 631418'][/XX] Naku po wag mo i-lang yan idol! Big deal yan noh! Ganyan din ako sa mga na-unlock ko kapag forte ko yung topic. Support kita!~
 

Similar threads

Back
Top