Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.20 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Toy_Store
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double vacationPrice = double.Parse(Console.ReadLine());
  10.             int puzzles = int.Parse(Console.ReadLine());
  11.             int dolls = int.Parse(Console.ReadLine());
  12.             int teddies = int.Parse(Console.ReadLine());
  13.             int minions = int.Parse(Console.ReadLine());
  14.             int trucks = int.Parse(Console.ReadLine());
  15.            
  16.             double total = puzzles * 2.60 + dolls * 3 + teddies * 4.10 + minions * 8.20 + trucks * 2;
  17.  
  18.             int numOfToys = puzzles + dolls + teddies + minions + trucks;
  19.             if (numOfToys >= 50)
  20.             {
  21.                 total = total - total * 0.25;
  22.                 //total = * 0.75;
  23.                 //total = totla - 25/100  * total
  24.             }
  25.             total = total - total * 0.10;
  26.             if (total >= vacationPrice)
  27.             {
  28.                 Console.WriteLine($"Yes!{total - vacationPrice:F2} lv left.");
  29.             }
  30.             else
  31.             {
  32.                 Console.WriteLine($"Not enough money!{vacationPrice - total:F2} lv needed.");
  33.             }
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement