Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- int numberOfMonths = int.Parse(Console.ReadLine());
- int commissionInPercent = int.Parse(Console.ReadLine());
- double rent = double.Parse(Console.ReadLine());
- double firstMonthRent = Math.Floor((double)numberOfMonths / 2) * rent;
- double secondMonthRent = Math.Ceiling((double)numberOfMonths / 2) * rent * 4 / 5;
- double commission = (firstMonthRent + secondMonthRent) * commissionInPercent / 100;
- double grandTotal = firstMonthRent + secondMonthRent + commission;
- Console.WriteLine($"Total: {grandTotal:f2}");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement