Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace EnergyBooster
- {
- class Program
- {
- static void Main(string[] args)
- {
- string fruit = Console.ReadLine();
- string size = Console.ReadLine();
- int volume = int.Parse(Console.ReadLine());
- double sumFruit = 0;
- double sumSize = 0;
- switch (fruit)
- {
- case "Watermelon":
- if (size == "small")
- {
- sumFruit = 56 * 2;
- }
- else if (size == "big")
- {
- sumFruit = 28.7 * 5;
- }
- break;
- case "Mango":
- if (size == "small")
- {
- sumFruit = 36.66 * 2;
- }
- else if (size == "big")
- {
- sumFruit = 19.6 * 5;
- }
- break;
- case "Pineapple":
- if (size == "small")
- {
- sumFruit = 42.1 * 2;
- }
- else if (size == "big")
- {
- sumFruit = 24.8 * 5;
- }
- break;
- case "Raspberry":
- if (size == "small")
- {
- sumFruit = 20 * 2;
- }
- else if (size == "big")
- {
- sumFruit = 15.2 * 5;
- }
- break;
- }
- double total = sumFruit * volume;
- if (total >= 400 && total <= 1000)
- {
- total *= 0.85;
- }
- else if (total > 1000)
- {
- total /= 2;
- }
- Console.WriteLine($"{total:F2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement