Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace padawan
- {
- class Program
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- double numberOfStudents = double.Parse(Console.ReadLine());
- double lightSaberPrice = double.Parse(Console.ReadLine());
- double robePrice = double.Parse(Console.ReadLine());
- double beltPrice = double.Parse(Console.ReadLine());
- double lightSaberNumber = numberOfStudents + Math.Ceiling((numberOfStudents * 0.10));
- double freeBelt = Math.Floor(numberOfStudents / 6);
- double price = (lightSaberNumber * lightSaberPrice) + (numberOfStudents * robePrice) + ((beltPrice * numberOfStudents) - freeBelt * beltPrice);
- if (price > budget)
- {
- Console.WriteLine($"Ivan Cho will need {Math.Abs(budget - price):f2}lv more.");
- }
- else
- {
- Console.WriteLine($"The money is enough - it would cost {price:f2}lv.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement