-Annie-

TravellerBob

Dec 21st, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using System;
  2.  
  3. class TravellerBob
  4. {
  5.     static void Main()
  6.     {
  7.         string leapYear = Console.ReadLine();
  8.         int contractMonths = int.Parse(Console.ReadLine());
  9.         int familyMonths = int.Parse(Console.ReadLine());
  10.  
  11.         double travels = 0;
  12.        
  13.         travels += contractMonths * 4 * 3;
  14.         travels += familyMonths * 2 * 2;
  15.         double normalMonthsTravels = (12 - (contractMonths + familyMonths)) * 12 * 0.6;
  16.         travels += normalMonthsTravels;
  17.  
  18.         if (leapYear == "leap")
  19.         {
  20.             travels *= 1.05;
  21.         }
  22.  
  23.         Console.WriteLine((int)travels);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment