Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _9._Padawan_Equipment
- {
- class Program
- {
- static void Main(string[] args)
- {
- //The amount of money Ivan Cho has – floating - point number in range[0.00…1, 000.00]
- // The count of students – integer in range[0…100]
- // The price of lightsabers for a single sabre – floating - point number in range[0.00…100.00]
- // The price of robes for a single robe – floating - point number in range[0.00…100.00]
- // The price of belts for a single belt – floating - point number in range[0.00…100.00]
- double money = double.Parse(Console.ReadLine());
- int students = int.Parse(Console.ReadLine());
- double priceForLightsabers = double.Parse(Console.ReadLine());
- double priceForRobes = double.Parse(Console.ReadLine());
- double priceForBelts = double.Parse(Console.ReadLine());
- double totalPrice = 0;
- int belts = students / 6;
- double students1 = Math.Ceiling((students * 0.1) + students);
- totalPrice = (students1 * priceForLightsabers) + ((students-belts) * priceForBelts) + (students * priceForRobes);
- if ( totalPrice > money)
- {
- Console.WriteLine($"Ivan Cho will need {totalPrice - money:f2}lv more.");
- }
- else if (totalPrice <= money)
- {
- Console.WriteLine($"The money is enough - it would cost {totalPrice:f2}lv.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement