Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace rent
- {
- class Program
- {
- static void Main(string[] args)
- {
- int months = int.Parse(Console.ReadLine());
- int percentComission = int.Parse(Console.ReadLine());
- double rentPerMonth = double.Parse(Console.ReadLine());
- double rentForSecondHalf = rentPerMonth * 0.80;
- double monthFirsHalf = months / 2;
- double sum = (monthFirsHalf * rentPerMonth) + (rentForSecondHalf * monthFirsHalf);
- double comission = sum * percentComission / 100;
- double total = comission + sum;
- Console.WriteLine($"Total: {total:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement