Problem 07.Fruit Shop тест #9 ми гърми
#include <iostream>
#include <string>
using namespace std;
int main() {
string day, fruit;
double quantity;
cin >> fruit>>day>>quantity;
cout.setf(ios::fixed);
cout.precision(2);
if (day=="Saturday"||day=="Sunday"){
if (fruit=="banana") {
cout <<2.70*quantity << endl;
}else if (fruit == "apple") {
cout <<1.25 * quantity << endl;
}else if (fruit == "orange") {
cout << 0.90 * quantity << endl;
}else if (fruit == "grapefruit") {
cout << 1.60 * quantity << endl;
}else if (fruit == "kiwi") {
cout << 3.00 * quantity << endl;
}else if (fruit == "pineapple") {
cout << 5.60 * quantity << endl;
}else if (fruit == "grapes") {
cout << 4.20 * quantity << endl;
}else{
cout << "error" << endl;
}
}else if (day == "Monday" || day == "Tuesday" || day == "Wendesday"
|| day == "Thursday" || day == "Friday") {
if (fruit == "banana") {
cout << 2.50 * quantity << endl;
}else if (fruit == "apple") {
cout << 1.20 * quantity << endl;
}else if (fruit == "orange") {
cout << 0.85 * quantity << endl;
}else if (fruit == "grapefruit") {
cout << 1.45 * quantity << endl;
}else if (fruit == "kiwi") {
cout << 2.70 * quantity << endl;
}else if (fruit == "pineapple") {
cout << 5.50 * quantity << endl;
}else if (fruit == "grapes") {
cout << 3.85 * quantity << endl;
}else{
cout << "error" << endl;
}
}else{
cout << "error" << endl;
}
return 0;
}