Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. using System;
  2.  
  3. namespace padawan
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double budget = double.Parse(Console.ReadLine());
  10. double numberOfStudents = double.Parse(Console.ReadLine());
  11. double lightSaberPrice = double.Parse(Console.ReadLine());
  12. double robePrice = double.Parse(Console.ReadLine());
  13. double beltPrice = double.Parse(Console.ReadLine());
  14.  
  15. double lightSaberNumber = numberOfStudents + Math.Ceiling((numberOfStudents * 0.10));
  16. double freeBelt = Math.Floor(numberOfStudents / 6);
  17.  
  18. double price = (lightSaberNumber * lightSaberPrice) + (numberOfStudents * robePrice) + ((beltPrice * numberOfStudents) - freeBelt * beltPrice);
  19.  
  20. if (price > budget)
  21. {
  22. Console.WriteLine($"Ivan Cho will need {Math.Abs(budget - price):f2}lv more.");
  23. }
  24. else
  25. {
  26. Console.WriteLine($"The money is enough - it would cost {price:f2}lv.");
  27. }
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement