Advertisement
deforse

Toys

Sep 21st, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.39 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Toy_Shop
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double excursia = double.Parse(Console.ReadLine());
  14.             double puzzels = double.Parse(Console.ReadLine());
  15.             double dolls = double.Parse(Console.ReadLine());
  16.             double bears = double.Parse(Console.ReadLine());
  17.             double minions = double.Parse(Console.ReadLine());
  18.             double trucks = double.Parse(Console.ReadLine());
  19.  
  20.             double orderNr = puzzels + dolls + bears + minions + trucks;
  21.             double orderPrice = (puzzels * 2.6 * 0.9) + (dolls * 3 * 0.9) + (bears * 4.1 * 0.9) + (minions * 8.2 * 0.9) + (trucks * 2 * 0.9);
  22.             double orderTotalPrice = 0;
  23.  
  24.             if (orderNr >= 50)
  25.             {
  26.                 orderTotalPrice = orderPrice * 0.75;
  27.             }
  28.             else
  29.             {
  30.                 orderTotalPrice = orderPrice;
  31.             }
  32.  
  33.             if (orderTotalPrice >= excursia)
  34.             {
  35.                 Console.WriteLine($"Yes! {orderTotalPrice - excursia:f2} lv left.");
  36.             }
  37.             else
  38.             {
  39.                 Console.WriteLine($"Not enough money! {Math.Abs(orderTotalPrice - excursia):f2} lv needed.");
  40.             }
  41.  
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement