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();
- double Qantity = double.Parse(Console.ReadLine());
- double price = 0;
- if (Day == "Monday" || Day == "Tuesday" || Day == "Wednesday" ||
- Day == "Thursday" || Day == "Friday")
- {
- if (Fruit == "banana")
- {
- price = Qantity * 2.50;
- Console.WriteLine($"{price:f2}");
- }
- else if (Fruit == "apple")
- {
- price = Qantity * 1.20;
- Console.WriteLine($"{price:f2}");
- }
- else if (Fruit == "orange")
- {
- price = Qantity * 0.85;
- Console.WriteLine($"{price:f2}");
- }
- else if (Fruit == "grapefruit")
- {
- price = Qantity * 1.45;
- Console.WriteLine($"{price:f2}");
- }
- else if (Fruit == "kiwi")
- {
- price = Qantity * 2.70;
- Console.WriteLine($"{price:f2}");
- }
- else if (Fruit == "pineapple")
- {
- price = Qantity * 5.50;
- Console.WriteLine($"{price:f2}");
- }
- else if (Fruit == "grapes")
- {
- price = Qantity * 3.85;
- Console.WriteLine($"{price:f2}");
- }
- else
- {
- Console.WriteLine("error");
- }
- }
- else if (Day == "Saturday" || Day == "Sunday")
- {
- if (Fruit == "banana")
- {
- price = Qantity * 2.70;
- Console.WriteLine($"{price:f2}");
- }
- else if (Fruit == "apple")
- {
- price = Qantity * 1.25;
- Console.WriteLine($"{price:f2}");
- }
- else if (Fruit == "orange")
- {
- price = Qantity * 0.90;
- Console.WriteLine($"{price:f2}");
- }
- else if (Fruit == "grapefruit")
- {
- price = Qantity * 1.60;
- Console.WriteLine($"{price:f2}");
- }
- else if (Fruit == "kiwi")
- {
- price = Qantity * 3.00;
- Console.WriteLine($"{price:f2}");
- }
- else if (Fruit == "pineapple")
- {
- price = Qantity * 5.60;
- Console.WriteLine($"{price:f2}");
- }
- else if (Fruit == "grapes")
- {
- price = Qantity * 4.20;
- Console.WriteLine($"{price:f2}");
- }
- else
- {
- Console.WriteLine("error");
- }
- }
- else
- {
- Console.WriteLine("error");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment