Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- class Program
- {
- static void Main()
- {
- string dayOfWeek = Console.ReadLine();
- decimal quantity1 = decimal.Parse(Console.ReadLine());
- string product1 = Console.ReadLine();
- decimal quantity2 = decimal.Parse(Console.ReadLine());
- string product2 = Console.ReadLine();
- decimal quantity3 = decimal.Parse(Console.ReadLine());
- string product3 = Console.ReadLine();
- decimal priceBanana = 1.80m;
- decimal priceCucumber = 2.75m;
- decimal priceTomato = 3.20m;
- decimal priceOrange = 1.60m;
- decimal priceApple = 0.86m;
- decimal total = 0;
- decimal currPrice1 = 0;
- decimal currPrice2 = 0;
- decimal currPrice3 = 0;
- if (product1 == "banana" && dayOfWeek == "Tuesday")
- {
- currPrice1 = priceBanana-(priceBanana*0.2m);
- }
- else if (product1 == "banana" && dayOfWeek=="Thursday")
- {
- currPrice1 = priceBanana-(priceBanana*0.3m);
- }
- else if (product1 == "banana")
- {
- currPrice1 = priceBanana;
- }
- else if (product1 == "cucumber"&& dayOfWeek=="Wednesday")
- {
- currPrice1 = priceCucumber - (priceCucumber * 0.1m);
- }
- else if (product1 == "cucumber")
- {
- currPrice1 = priceCucumber;
- }
- else if (product1 == "tomato" && dayOfWeek=="Wednesday")
- {
- currPrice1 = priceTomato - (priceTomato - 0.1m);
- }
- else if (product1 == "tomato")
- {
- currPrice1 = priceTomato;
- }
- else if (product1 == "orange"&& dayOfWeek=="Tuesday")
- {
- currPrice1 = priceOrange - (priceOrange * 0.2m);
- }
- else if (product1 == "orange")
- {
- currPrice1 = priceOrange;
- }
- else if (product1 == "apple" && dayOfWeek=="Tuesday")
- {
- currPrice1 = priceApple - (priceApple * 0.2m);
- }
- else if (product1 == "apple")
- {
- currPrice1 = priceApple;
- }
- if (product2 == "banana" && dayOfWeek == "Tuesday")
- {
- currPrice2 = priceBanana - (priceBanana * 0.2m);
- }
- else if (product2 == "banana" && dayOfWeek == "Thursday")
- {
- currPrice2 = priceBanana - (priceBanana * 0.3m);
- }
- else if (product2 == "banana")
- {
- currPrice2 = priceBanana;
- }
- else if (product2 == "cucumber" && dayOfWeek == "Wednesday")
- {
- currPrice2 = priceCucumber - (priceCucumber * 0.1m);
- }
- else if (product2 == "cucumber")
- {
- currPrice2 = priceCucumber;
- }
- else if (product2 == "tomato" && dayOfWeek == "Wednesday")
- {
- currPrice2 = priceTomato - (priceTomato - 0.1m);
- }
- else if (product2 == "tomato")
- {
- currPrice2 = priceTomato;
- }
- else if (product2 == "orange" && dayOfWeek == "Tuesday")
- {
- currPrice2 = priceOrange - (priceOrange * 0.2m);
- }
- else if (product2 == "orange")
- {
- currPrice2 = priceOrange;
- }
- else if (product2 == "apple" && dayOfWeek == "Tuesday")
- {
- currPrice2 = priceApple - (priceApple * 0.2m);
- }
- else if (product2 == "apple")
- {
- currPrice2 = priceApple;
- }
- if (product3 == "banana" && dayOfWeek == "Tuesday")
- {
- currPrice3 = priceBanana - (priceBanana * 0.2m);
- }
- else if (product3 == "banana" && dayOfWeek == "Thursday")
- {
- currPrice3 = priceBanana - (priceBanana * 0.3m);
- }
- else if (product3 == "banana")
- {
- currPrice3 = priceBanana;
- }
- else if (product3 == "cucumber" && dayOfWeek == "Wednesday")
- {
- currPrice3 = priceCucumber - (priceCucumber * 0.1m);
- }
- else if (product3 == "cucumber")
- {
- currPrice3 = priceCucumber;
- }
- else if (product3 == "tomato" && dayOfWeek == "Wednesday")
- {
- currPrice3 = priceTomato - (priceTomato - 0.1m);
- }
- else if (product3 == "tomato")
- {
- currPrice3 = priceTomato;
- }
- else if (product3 == "orange" && dayOfWeek == "Tuesday")
- {
- currPrice3 = priceOrange - (priceOrange * 0.2m);
- }
- else if (product3 == "orange")
- {
- currPrice3 = priceOrange;
- }
- else if (product3 == "apple" && dayOfWeek == "Tuesday")
- {
- currPrice3 = priceApple - (priceApple * 0.2m);
- }
- else if (product3 == "apple")
- {
- currPrice3 = priceApple;
- }
- switch (dayOfWeek)
- {
- case "Friday":
- total = quantity1 * currPrice1 + quantity2 * currPrice2 + quantity3 * currPrice3 - ((quantity1 * currPrice1 + quantity2 * currPrice2 + quantity3 * currPrice3) * 0.1m);
- Console.WriteLine("{0:F2}", total);
- break;
- case "Sunday":
- total = quantity1 * currPrice1 + quantity2 * currPrice2 + quantity3 * currPrice3 - ((quantity1 * currPrice1 + quantity2 * currPrice2 + quantity3 * currPrice3) * 0.05m);
- Console.WriteLine("{0:F2}", total);
- break;
- case "Tuesday":
- total = quantity1 * currPrice1 + quantity2 * currPrice2 + quantity3 * currPrice3;
- Console.WriteLine("{0:F2}", total);
- break;
- case "Wednesday":
- total = quantity1 * currPrice1 + quantity2 * currPrice2 + quantity3 * currPrice3;
- Console.WriteLine("{0:F2}", total);
- break;
- case "Thursday":
- total = quantity1 * currPrice1 + quantity2 * currPrice2 + quantity3 * currPrice3;
- Console.WriteLine("{0:F2}", total);
- break;
- case "Monday":
- total = quantity1 * currPrice1 + quantity2 * currPrice2 + quantity3 * currPrice3;
- Console.WriteLine("{0:F2}", total);
- break;
- case "Saturday":
- total = quantity1 * currPrice1 + quantity2 * currPrice2 + quantity3 * currPrice3;
- Console.WriteLine("{0:F2}", total);
- break;
- default:
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement