SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace toyshop
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double vPrice = double.Parse(Console.ReadLine());
  14.             int puzzles = int.Parse(Console.ReadLine());
  15.             int dolls = int.Parse(Console.ReadLine());
  16.             int teddyBears = int.Parse(Console.ReadLine());
  17.             int minions = int.Parse(Console.ReadLine());
  18.             int trucks = int.Parse(Console.ReadLine());
  19.  
  20.             double moneyGet = (puzzles * 2.60) + (dolls * 3) + (teddyBears * 4.10) + (minions * 8.20) + (trucks * 2);
  21.  
  22.             int toysSold = puzzles + dolls + teddyBears + minions + trucks;
  23.             if (toysSold > 50)
  24.             {
  25.                 moneyGet = moneyGet - (moneyGet * 0.25);
  26.             }
  27.  
  28.           double  moneyLeft =  moneyGet - (moneyGet * 0.10);
  29.             if (moneyLeft >= vPrice)
  30.             {
  31.                 Console.WriteLine("Yes! {0:F2} lv left.",moneyLeft - vPrice);
  32.             }
  33.             else
  34.             {
  35.                 Console.WriteLine("Not enough money! {0:F2} lv needed.",Math.Abs (vPrice - moneyLeft));
  36.             }
  37.         }
  38.     }
  39. }
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