Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Fruit_Shop
- {
- class Program
- {
- static void Main(string[] args)
- {
- string fruit = Console.ReadLine();
- string day = Console.ReadLine().ToLower();
- var quantity = double.Parse(Console.ReadLine());
- var price = 0.0;
- if (day == "saturday" || day == "sunday")
- {
- if (fruit == "banana")
- {
- price = 2.70;
- Console.WriteLine("{0:f2}", price * quantity);
- }
- else if (fruit == "apple")
- {
- price = 1.25;
- Console.WriteLine("{0:f2}", price * quantity);
- }
- else if (fruit == "orange") {
- price = 0.90;
- Console.WriteLine("{0:f2}", price * quantity);
- }
- else if (fruit == "grapefruit")
- {
- price = 1.60;
- Console.WriteLine("{0:f2}", price * quantity);
- }
- else if (fruit == "kiwi")
- {
- price = 3.00;
- Console.WriteLine("{0:f2}", price * quantity);
- }
- else if (fruit == "pineapple")
- {
- price = 5.60;
- Console.WriteLine("{0:f2}", price * quantity);
- }
- else if (fruit == "grapes")
- {
- price = 4.20;
- Console.WriteLine("{0:f2}", price * quantity);
- }
- else
- {
- Console.WriteLine("error");
- }
- }
- else if (day == "monday" || day == "tuesday" || day == "wednesday" || day == "thursday" || day == "friday")
- {
- if (fruit == "banana")
- {
- price = 2.50;
- Console.WriteLine("{0:f2}", price * quantity);
- }
- else if (fruit == "apple")
- {
- price = 1.20;
- Console.WriteLine("{0:f2}", price * quantity);
- }
- else if (fruit == "orange")
- {
- price = 0.85;
- Console.WriteLine("{0:f2}", price * quantity);
- }
- else if (fruit == "grapefruit")
- {
- price = 1.45;
- Console.WriteLine("{0:f2}", price * quantity);
- }
- else if (fruit == "kiwi")
- {
- price = 2.70;
- Console.WriteLine("{0:f2}", price * quantity);
- }
- else if (fruit == "pineapple")
- {
- price = 5.50;
- Console.WriteLine("{0:f2}", price * quantity);
- }
- else if (fruit == "grapes")
- {
- price = 3.85;
- Console.WriteLine("{0:f2}", price * quantity);
- }
- else
- {
- Console.WriteLine("error");
- }
- }
- else
- {
- Console.WriteLine("error");
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement