Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.21 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _12._Toy_Shop
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double vacantionPrice = double.Parse(Console.ReadLine());
  10.             int puzzelCount = int.Parse(Console.ReadLine());
  11.             int dolls = int.Parse(Console.ReadLine());
  12.             int tadyBeert = int.Parse(Console.ReadLine());
  13.             int minions = int.Parse(Console.ReadLine());
  14.             int truskCount = int.Parse(Console.ReadLine());
  15.  
  16.             double toyCount = puzzelCount + dolls + tadyBeert + minions + truskCount;
  17.             double toyPrice = (puzzelCount * 2.60) + (dolls * 3) + (tadyBeert * 4.10) + (minions * 8.20) +
  18.             (truskCount * 2);
  19.            
  20.  
  21.             if (toyCount >= 50)
  22.             {
  23.                 toyPrice = toyPrice * 0.75;
  24.             }
  25.             toyPrice = toyPrice * 0.90;
  26.              
  27.              if (toyPrice > vacantionPrice)
  28.             {
  29.                 Console.WriteLine("Yes! {0:F2} lv left. ", toyPrice - vacantionPrice);
  30.             }
  31.             else
  32.             {
  33.                 Console.WriteLine("Not enough money! {0:F2} lv needed.", vacantionPrice - toyPrice);
  34.             }
  35.  
  36.  
  37.  
  38.  
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement