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
- {
- class Program
- {
- static void Main(string[] args)
- {
- var fruit = Console.ReadLine();
- var size = Console.ReadLine();
- var quantity = double.Parse(Console.ReadLine());
- var big = 5;
- var small = 2;
- var price = 0.0;
- switch (size)
- {
- case "small":
- {
- switch (fruit)
- {
- case "Watermelon": price = 56.00 * small; break;
- case "Mango": price = 36.66 * small; break;
- case "Pineapple": price = 42.10 * small; break;
- case "Raspberry": price = 20.00 * small; break;
- }
- break;
- }
- case "big":
- {
- switch (fruit)
- {
- case "Watermelon": price = 28.70 * big; break;
- case "Mango": price = 19.60 * big; break;
- case "Pineapple": price = 24.80 * big; break;
- case "Raspberry": price = 15.20 * big; break;
- }
- break;
- }
- }
- var totalPrice = price * quantity;
- if (totalPrice >= 400 && totalPrice <= 1000)
- {
- totalPrice = totalPrice * 0.85;
- Console.WriteLine($"{totalPrice:f2} lv.");
- }
- else if (totalPrice > 1000)
- {
- totalPrice = totalPrice * 0.50;
- Console.WriteLine($"{totalPrice:f2} lv.");
- }
- else
- {
- Console.WriteLine($"{totalPrice:f2} lv.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement