Advertisement
silvana1303

padawan equipment

Jun 19th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Diagnostics.CodeAnalysis;
  5. using System.Linq;
  6. using System.Threading;
  7.  
  8. namespace ConsoleApp1
  9. {
  10.     class Exam
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.  
  15.             double budget = double.Parse(Console.ReadLine());
  16.             int students = int.Parse(Console.ReadLine());
  17.             double pricePerSabre = double.Parse(Console.ReadLine());
  18.             double pricePerRobe = double.Parse(Console.ReadLine());
  19.             double pricePerBelt = double.Parse(Console.ReadLine());
  20.  
  21.             double sumMoney = pricePerSabre * Math.Ceiling(students * 1.10) + pricePerRobe * students + pricePerBelt * (students - (students / 6));
  22.  
  23.             if (budget >= sumMoney)
  24.             {
  25.                 Console.WriteLine($"The money is enough - it would cost {sumMoney:F2}lv.");
  26.             }
  27.             else
  28.             {
  29.                 Console.WriteLine($"Ivan Cho will need {sumMoney - budget:f2}lv more.");
  30.             }
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement