Advertisement
skipter

Fruit Coctail

Sep 18th, 2017
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.97 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace FriutCoctails
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string fruit = Console.ReadLine();
  14.             string bigOrSmall = Console.ReadLine();
  15.             int drinksCount = int.Parse(Console.ReadLine());
  16.  
  17.             double watermelon = 0;
  18.             double mango = 0;
  19.             double pineapple = 0;
  20.             double raspeberry = 0;
  21.  
  22.             if (bigOrSmall.Equals("small"))
  23.             {
  24.                 watermelon = 56 * 2;
  25.                 mango = 36.66 * 2;
  26.                 pineapple = 42.10 * 2;
  27.                 raspeberry = 20 * 2;
  28.             }
  29.             else if (bigOrSmall == "big")
  30.             {
  31.                 watermelon = 28.70 * 5;
  32.                 mango = 19.60 * 5;
  33.                 pineapple = 24.80 * 5;
  34.                 raspeberry = 15.20 * 5;
  35.             }
  36.             double fruitsPrice = 0;
  37.             if (fruit.Equals("Watermelon"))
  38.             {
  39.                 fruitsPrice = watermelon * drinksCount;
  40.             }
  41.             else if (fruit.Equals("Mango"))
  42.             {
  43.                 fruitsPrice = mango * drinksCount;
  44.             }
  45.             else if (fruit.Equals("Pineapple"))
  46.             {
  47.                 fruitsPrice = pineapple * drinksCount;
  48.             }
  49.             else if (fruit.Equals("Raspberry"))
  50.             {
  51.                 fruitsPrice = raspeberry * drinksCount;
  52.             }
  53.             double fruitPriceDiscount = 0;
  54.             if (fruitsPrice >= 400 && fruitsPrice <= 1000)
  55.             {
  56.                 fruitPriceDiscount = fruitsPrice * 0.15;
  57.             } else if (fruitsPrice > 1000)
  58.             {
  59.                 fruitPriceDiscount = fruitsPrice * 0.50;
  60.             }
  61.             double totalPrice = fruitsPrice - fruitPriceDiscount;
  62.             Console.WriteLine("{0:F2} lv.", totalPrice);
  63.         }
  64.     }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement