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 FruitShop
- {
- class Program
- {
- static void Main(string[] args)
- {
- String type = Console.ReadLine().ToLower();
- String day = Console.ReadLine().ToLower();
- double ammount = double.Parse(Console.ReadLine());
- if (day.Equals("sunday") || day.Equals("saturday"))
- {
- switch (type)
- {
- case "banana":
- Console.WriteLine("{0:0.00}",2.70 * ammount);
- break;
- case "apple":
- Console.WriteLine("{0:0.00}",1.25 * ammount);
- break;
- case "orange":
- Console.WriteLine("{0:0.00}",0.90 * ammount);
- break;
- case "grapefruit":
- Console.WriteLine("{0:0.00}",1.60 * ammount);
- break;
- case "kiwi":
- Console.WriteLine("{0:0.00}",3.00* ammount);
- break;
- case "pineapple":
- Console.WriteLine("{0:0.00}",5.60 * ammount);
- break;
- case "grapes":
- Console.WriteLine("{0:0.00}",4.20 * ammount);
- break;
- default:
- Console.WriteLine("error");
- break;
- }
- }
- else if (day == "monday" || day == "tuesday" || day == "wednesday" || day == "thursday" || day == "friday")
- {
- switch (type)
- {
- case "banana":
- Console.WriteLine("{0:0.00}",2.50 * ammount);
- break;
- case "apple":
- Console.WriteLine("{0:0.00}",1.20 * ammount);
- break;
- case "orange":
- Console.WriteLine("{0:0.00}",0.85 * ammount);
- break;
- case "grapefruit":
- Console.WriteLine("{0:0.00}",1.45 * ammount);
- break;
- case "kiwi":
- Console.WriteLine("{0:0.00}",2.70 * ammount);
- break;
- case "pineapple":
- Console.WriteLine("{0:0.00}",5.50 * ammount);
- break;
- case "grapes":
- Console.WriteLine("{0:0.00}",3.85 * ammount);
- break;
- default:
- Console.WriteLine("error");
- break;
- }
- }
- else
- {
- Console.WriteLine("error");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement