Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class TravellerBob
- {
- static void Main()
- {
- string leapYear = Console.ReadLine();
- int contractMonths = int.Parse(Console.ReadLine());
- int familyMonths = int.Parse(Console.ReadLine());
- double year = 12;
- double monthWeeks = 4;
- double normalMonths = year - (contractMonths+familyMonths); // 12 - 3 = 9
- double contractMonthSum = (contractMonths*monthWeeks)*3; // 2*4*3 = 24
- double familyMonthSum = (familyMonths * 2) * 2; // 2*2 = 4
- double normalDaySum = ((normalMonths*12)*3)/5; //9*12*3/5 = 64.8
- double allSum = normalDaySum + familyMonthSum + contractMonthSum; // 64.8 + 4 + 24 = 92.8
- if (leapYear == "leap")
- {
- allSum = allSum + (allSum * 5 / 100); // 92.8 + 4.64 = 97.44
- Console.WriteLine(Math.Floor(allSum));
- }
- if (leapYear == "normal")
- {
- Console.WriteLine(Math.Floor(allSum)); //92.8 = 92
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement