What's new

C & C++ C++ Pa help

Oo, maaari itong paiksiin depende sa konteksto o detalye ng iyong katanungan o mensahe. Maaring magbigay ka ng higit pang impormasyon o paliwanag upang magawa kong magbigay ng mas konkretong sagot o tulong sa iyo.
 
how?
Oo, maaari itong paiksiin depende sa konteksto o detalye ng iyong katanungan o mensahe. Maaring magbigay ka ng higit pang impormasyon o paliwanag upang magawa kong magbigay ng mas konkretong sagot o tulong sa iyo.
 
#include <iostream>
using namespace std;
int main() {
int quantity;
double amount = 3.75, discount, totalBefore, totalAfter;
cout << "Enter quantity: ";
cin >> quantity;
totalBefore = quantity * amount;
if(quantity <= 50)
discount = totalBefore * 0;
else
discount = totalBefore * 0.2;
totalAfter = totalBefore - discount;
cout << "Before: $" << totalBefore << endl;
cout << "Discount: $" << discount << endl;
cout << "After: $" << totalAfter << endl;
return 0;
}

pa mark as solution na lang po
 
#include <iostream>
using namespace std;

int main() {
int quantity;
double amount = 3.75, discount, totalamountbeforediscount, totaldiscount, totalamountafterdiscount;

cout << "Enter quantity of flowers: ";
cin >> quantity;

totalamountbeforediscount = quantity * amount;

if (quantity <= 50) {
discount = totalamountbeforediscount * 0.0;
} else {
discount = totalamountbeforediscount * 0.20;
}

totalamountafterdiscount = totalamountbeforediscount - discount;

cout << "Amount before discount: $" << totalamountbeforediscount << endl;
cout << "Discount: $" << discount << endl;
cout << "Total amount after discount: $" << totalamountafterdiscount << endl;

return 0;
}
 
#include <iostream>
using namespace std;
int main() {
int quantity;
double amount = 3.75, discount, totalBefore, totalAfter;
cout << "Enter quantity: ";
cin >> quantity;
totalBefore = quantity * amount;
if(quantity <= 50)
discount = totalBefore * 0;
else
discount = totalBefore * 0.2;
totalAfter = totalBefore - discount;
cout << "Before: $" << totalBefore << endl;
cout << "Discount: $" << discount << endl;
cout << "After: $" << totalAfter << endl;
return 0;
}

pa mark as solution na lang po
#include <iostream>
using namespace std;

int main() {
int quantity;
double amount = 3.75, discount, totalamountbeforediscount, totaldiscount, totalamountafterdiscount;

cout << "Enter quantity of flowers: ";
cin >> quantity;

totalamountbeforediscount = quantity * amount;

if (quantity <= 50) {
discount = totalamountbeforediscount * 0.0;
} else {
discount = totalamountbeforediscount * 0.20;
}

totalamountafterdiscount = totalamountbeforediscount - discount;

cout << "Amount before discount: $" << totalamountbeforediscount << endl;
cout << "Discount: $" << discount << endl;
cout << "Total amount after discount: $" << totalamountafterdiscount << endl;

return 0;
}
thanks po
 

Similar threads

Back
Top