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;
- using System.Threading.Tasks;
- namespace _04.OnlineRadioDatabase
- {
- class Program
- {
- static void Main(string[] args)
- {
- string fruit = Console.ReadLine();
- string day = Console.ReadLine();
- double quantity = double.Parse(Console.ReadLine());
- var price1 = new Dictionary<string, double>()
- {
- { "banana", 2.50 },
- { "apple", 1.20 },
- { "orange", 0.85 },
- { "grapefruit", 1.45 },
- { "kiwi", 2.70 },
- { "pineapple", 5.50 },
- { "grapes", 3.85 }
- };
- var price2 = new Dictionary<string, double>()
- {
- { "banana", 2.70 },
- { "apple", 1.25 },
- { "orange", 0.90 },
- { "grapefruit", 1.60 },
- { "kiwi", 3.00 },
- { "pineapple", 5.60 },
- { "grapes", 4.20 }
- };
- if (fruit == "banana" || fruit == "apple" || fruit == "orange" || fruit == "grapefruit" || fruit == "kiwi" || fruit == "pineapple" || fruit == "grapes")
- {
- double result1 = quantity * price1[fruit];
- double result2 = quantity * price2[fruit];
- if (day == "Monday" || day == "Tuesday" || day == "Wednesday" || day == "Thursday" || day == "Friday") Console.WriteLine("{0:0.00}", result1);
- else if (day == "Saturday" || day == "Sunday") Console.WriteLine("{0:0.00}", result2);
- else Console.WriteLine("error");
- }
- else
- {
- Console.WriteLine("error");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement