Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Threading;
- namespace ConsoleApp4
- {
- class Program
- {
- static void Main(string[] args)
- {
- string fruit = Console.ReadLine();
- string day = Console.ReadLine();
- double amount = double.Parse(Console.ReadLine());
- double banana = 2.50;
- double apple = 1.20;
- double orange = 0.85;
- double grapefruit = 1.45;
- double kiwi = 2.70;
- double pineapple = 5.50;
- double grapes = 3.85;
- double weekendBanana = 2.70;
- double weekendApple = 1.25;
- double weekendOrange = 0.90;
- double weekendGrapefruit = 1.60;
- double weekendKiwi = 3.00;
- double weekendPineapple = 5.60;
- double weekendGrapes = 4.20;
- if (day == "Monday" || day == "Tuesday" || day == "Wednesday" || day == "Thursday" || day == "Friday")
- {
- if (fruit == "banana")
- {
- Console.WriteLine($"{banana * amount:f2}");
- }
- else if (fruit == "apple")
- {
- Console.WriteLine($"{apple * amount:f2}");
- }
- else if (fruit == "orange")
- {
- Console.WriteLine($"{orange * amount:f2}");
- }
- else if (fruit == "grapefruit")
- {
- Console.WriteLine($"{grapefruit * amount:f2}");
- }
- else if (fruit == "kiwi")
- {
- Console.WriteLine($"{kiwi * amount:f2}");
- }
- else if (fruit == "pineapple")
- {
- Console.WriteLine($"{pineapple * amount:f2}");
- }
- else if (fruit == "grapes")
- {
- Console.WriteLine($"{grapes * amount:f2}");
- }
- else
- {
- Console.WriteLine("error");
- }
- }
- else if (day == "Saturday" || day == "Sunday")
- {
- if (fruit == "banana")
- {
- Console.WriteLine($"{weekendBanana * amount:f2}");
- }
- else if (fruit == "apple")
- {
- Console.WriteLine($"{weekendApple * amount:f2}");
- }
- else if (fruit == "orange")
- {
- Console.WriteLine($"{weekendOrange * amount:f2}");
- }
- else if (fruit == "grapefruit")
- {
- Console.WriteLine($"{weekendGrapefruit * amount:f2}");
- }
- else if (fruit == "kiwi")
- {
- Console.WriteLine($"{weekendKiwi * amount:f2}");
- }
- else if (fruit == "pineapple")
- {
- Console.WriteLine($"{weekendPineapple * amount:f2}");
- }
- else if (fruit == "grapes")
- {
- Console.WriteLine($"{weekendGrapes * amount:f2}");
- }
- else
- {
- Console.WriteLine("error");
- }
- }
- else
- {
- Console.WriteLine("error");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement