SHARE
TWEET

Untitled

StellaIv Oct 20th, 2019 109 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace Toy_Shop
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double priceForTrip = double.Parse(Console.ReadLine());
  10.             int puzzelsCount = int.Parse(Console.ReadLine());
  11.             int dollsCount = int.Parse(Console.ReadLine());
  12.             int TeddyBearsCount = int.Parse(Console.ReadLine());
  13.             int minionsCount = int.Parse(Console.ReadLine());
  14.             int trucksCount = int.Parse(Console.ReadLine());
  15.  
  16.             int ToysCount = puzzelsCount + dollsCount + TeddyBearsCount + minionsCount + trucksCount;
  17.             double TotalPrice = (puzzelsCount * 2.60) + (dollsCount * 3) + (TeddyBearsCount * 4.10) + (minionsCount * 8.20) + (trucksCount * 2);
  18.  
  19.             if(ToysCount >= 50)
  20.             {
  21.                 TotalPrice *= 0.75;
  22.             }
  23.             TotalPrice *= 0.90;
  24.  
  25.             if(TotalPrice > priceForTrip)
  26.             {
  27.                 double moneyLeft = TotalPrice - priceForTrip;
  28.                 Console.WriteLine($"Yes! {moneyLeft:f2} lv left. ");
  29.             }
  30.  
  31.             else
  32.             {
  33.                 double money = priceForTrip - TotalPrice;
  34.                 Console.WriteLine($"Not enough money! {money:f2} lv needed.");
  35.             }
  36.         }
  37.     }
  38. }
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