Advertisement
dimipan80

C#Exams 1. Joro, the Football Player (on Java Code)

Aug 21st, 2014
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class _1_JoroTheFootballPlayer {
  4.  
  5.     public static void main(String[] args) {
  6.         // TODO Auto-generated method stub
  7.         Scanner scan = new Scanner(System.in);
  8.         char year = scan.next().charAt(0);
  9.         int holidays = scan.nextInt();
  10.         int hometownWeekends = scan.nextInt();
  11.  
  12.         int allWeekends = 52;
  13.         int normalWeekends = allWeekends - hometownWeekends;
  14.         double playTimes = (double) normalWeekends * 2 / 3;
  15.         playTimes += hometownWeekends;
  16.         playTimes += (double) holidays / 2;
  17.         if (year == 't') {
  18.             playTimes += 3;
  19.         }
  20.  
  21.         int totalPlayTimes = (int) playTimes;
  22.         System.out.println(totalPlayTimes);
  23.     }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement