SHARE
TWEET

PadwanEquipment

a guest Sep 23rd, 2019 105 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace PadawanEquipment
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double money = double.Parse(Console.ReadLine());
  10.             int numberOfStudents = int.Parse(Console.ReadLine());
  11.             double priceLightsabers = double.Parse(Console.ReadLine());
  12.             double priceRobes = double.Parse(Console.ReadLine());
  13.             double priceBelts = double.Parse(Console.ReadLine());
  14.             double lightSabers = Math.Ceiling(numberOfStudents +  numberOfStudents*0.1);
  15.             int freeBelts = numberOfStudents / 6;
  16.             double totalMoneyNeeded = lightSabers * priceLightsabers + numberOfStudents * priceRobes + (numberOfStudents - freeBelts) * priceBelts;
  17.             if (money >= totalMoneyNeeded)
  18.             {
  19.                 Console.WriteLine($"The money is enough - it would cost {totalMoneyNeeded:f2}lv.");
  20.             }
  21.             else
  22.             {
  23.                 Console.WriteLine($"Ivan Cho will need {totalMoneyNeeded-money:f2}lv more.");
  24.             }
  25.         }
  26.     }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top