Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- string product, town;
- cin >> product >> town;
- double quantity;
- cin >> quantity;
- double sum = 0;
- if (town == "Sofia") {
- if (product == "coffee") {
- sum = 0.5;
- }
- else if (product == "water") {
- sum = 0.8;
- }
- else if (product == "beer") {
- sum = 1.2;
- }
- else if (product == "sweets") {
- sum = 1.45;
- }
- else if (product == "peanuts") {
- sum = 1.6;
- }
- }
- else if (town == "Plovdiv") {
- if (product == "coffee") {
- sum = 0.4;
- }
- else if (product == "water") {
- sum = 0.7;
- }
- else if (product == "beer") {
- sum = 1.15;
- }
- else if (product == "sweets") {
- sum = 1.30;
- }
- else if (product == "peanuts") {
- sum = 1.5;
- }
- }
- else if (town == "Varna") {
- if (product == "coffee") {
- sum = 0.45;
- }
- else if (product == "water") {
- sum = 0.7;
- }
- else if (product == "beer") {
- sum = 1.1;
- }
- else if (product == "sweets") {
- sum = 1.35;
- }
- else if (product == "peanuts") {
- sum = 1.55;
- }
- }
- cout << sum * quantity << endl;;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement