Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
82
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 Toy_Shop
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double vacPtrice = double.Parse(Console.ReadLine());
  10.             int puzzles = int.Parse(Console.ReadLine());
  11.             int dolls = int.Parse(Console.ReadLine());
  12.             int tedBears = int.Parse(Console.ReadLine());
  13.             int minions = int.Parse(Console.ReadLine());
  14.             int trucks = int.Parse(Console.ReadLine());
  15.            
  16.             double totalPrice = puzzles * 2.60 + dolls * 3 + tedBears * 4.10
  17.                 + minions * 8.20 + trucks * 2;
  18.            
  19.             int numToys = puzzles + dolls + tedBears + minions + trucks;
  20.            
  21.             if (numToys >= 50)
  22.             {
  23.                 totalPrice = totalPrice- totalPrice * 0.25;
  24.             }
  25.             totalPrice = totalPrice - totalPrice * 0.10;
  26.             if (totalPrice >= vacPtrice)
  27.             {
  28.                 Console.WriteLine($" Yes! { totalPrice - vacPtrice:f2} lv left.");
  29.  
  30.             }
  31.             else
  32.             {
  33.                 Console.WriteLine($"Not enough money! {vacPtrice-totalPrice:f2} lv needed.");
  34.                
  35.             }
  36.  
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement