Advertisement
Guest User

Untitled

a guest
Mar 8th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.42 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 Change_Tiles
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             decimal moneyGathered = decimal.Parse(Console.ReadLine());
  14.             decimal widthFloor = decimal.Parse(Console.ReadLine());
  15.             decimal lenghtFloor = decimal.Parse(Console.ReadLine());
  16.             decimal sidePlate = decimal.Parse(Console.ReadLine());
  17.             decimal heightPlate = decimal.Parse(Console.ReadLine());
  18.             decimal pricePlate = decimal.Parse(Console.ReadLine());
  19.             decimal priceMaistor = decimal.Parse(Console.ReadLine());
  20.             decimal moneyNeeded = 0M;
  21.  
  22.            
  23.                 decimal s = widthFloor * lenghtFloor;
  24.                 decimal s1 = (sidePlate * heightPlate) / 2;
  25.                 decimal plateNeeded = s / s1;
  26.                 plateNeeded = Math.Ceiling(plateNeeded) + 5;
  27.                 moneyNeeded = (plateNeeded * pricePlate) + priceMaistor;
  28.                 if (moneyNeeded <= moneyGathered)
  29.                 {
  30.                     Console.WriteLine("{0:F2} lv left.", moneyGathered - moneyNeeded);
  31.                 }
  32.                 else
  33.                 {
  34.                     Console.WriteLine("You'll need {0:f2} lv more.", moneyNeeded - moneyGathered);
  35.                 }
  36.  
  37.            
  38.            
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement