SHARE
TWEET

Untitled

a guest Jun 18th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  using System;
  2.  
  3. namespace ConditionalStatements
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double priceHoliday = double.Parse(Console.ReadLine());
  10.             int puzzel = int.Parse(Console.ReadLine());
  11.             int doll = int.Parse(Console.ReadLine());
  12.             int teddybear = int.Parse(Console.ReadLine());
  13.             int minions = int.Parse(Console.ReadLine());
  14.             int lego = int.Parse(Console.ReadLine());
  15.             double pricePuzzel = 2.60 * puzzel;
  16.             double priceDoll = 3 * doll;
  17.             double priceTeddybear = 4.10 * teddybear;
  18.             double priceMinions = 8.20 * minions;
  19.             double priceLego = 2 * lego;
  20.             double price = pricePuzzel + priceDoll + priceLego + priceMinions + priceTeddybear;
  21.             double number = puzzel + doll + lego + minions + teddybear;
  22.             if(number>=50)
  23.             {
  24.                 price -= price * 0.25;
  25.             }
  26.             double money = price - price * 0.1;
  27.            
  28.            
  29.             if (price >= priceHoliday)
  30.             {
  31.              
  32.                 Console.WriteLine($"Yes! {money-priceHoliday:f2} lv left.");
  33.             }
  34.             else
  35.             {
  36.                 Console.WriteLine($"Not enough money! {priceHoliday-money:f2} lv needed.");
  37.             }
  38.         }
  39.     }
  40.    
  41. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top