Guest User

Untitled

a guest
Jun 27th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.72 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp16
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double CostOfVacantion = double.Parse(Console.ReadLine());
  10.  
  11.             int numOfpuzzles = int.Parse(Console.ReadLine());
  12.  
  13.             int numOfbarbies = int.Parse(Console.ReadLine());
  14.  
  15.             int numOfbears = int.Parse(Console.ReadLine());
  16.  
  17.             int numOfminions = int.Parse(Console.ReadLine());
  18.  
  19.             int numOftrucks = int.Parse(Console.ReadLine());
  20.  
  21.             int numOfallorder = numOfpuzzles + numOfbarbies + numOfbears + numOfminions + numOftrucks;
  22.  
  23.             double priceOfpuzzles = numOfpuzzles * 2.60;
  24.  
  25.             double priceOfbarbies = numOfbarbies * 3;
  26.  
  27.             double priceOfbears = numOfbears * 4.10;
  28.  
  29.             double priceOfminions = numOfminions * 8.20;
  30.  
  31.             double priceOftrucks = numOftrucks * 2;
  32.  
  33.             double priceOfallorder = priceOfpuzzles + priceOfbarbies + priceOfbears + priceOfminions + priceOftrucks;
  34.  
  35.             if (numOfallorder >= 50)
  36.             {
  37.                 double off = priceOfallorder * 0.25;
  38.                 double finalprice = priceOfallorder - off;
  39.  
  40.                 double rent = finalprice * 0.1;
  41.                 double moneyleft = finalprice - rent;
  42.  
  43.  
  44.  
  45.  
  46.  
  47.                 if (moneyleft >= CostOfVacantion)
  48.                 {
  49.                     double lefting = moneyleft - CostOfVacantion;
  50.                     Console.WriteLine($"Yes! {lefting:f2} lv left.");
  51.                 }
  52.                 else
  53.                 {
  54.                     Console.WriteLine($"Not enough money! {CostOfVacantion - moneyleft:f2} lv needed.");
  55.                 }
  56.             }
  57.  
  58.  
  59.             }
  60.         }
  61.     }
Advertisement
Add Comment
Please, Sign In to add comment