AlexKondov

Java Joro The Football Player

May 6th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. package Exams;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class JoroTheFootballPlayer {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner input = new Scanner(System.in);
  9.        
  10.         char typeOfYear = input.findInLine(".").charAt(0);
  11.         int p = input.nextInt();
  12.         int h = input.nextInt();
  13.        
  14.         double normalPlays = ((52d - h) / 3d) * 2d;
  15.         double holidayPlays = p / 2d;
  16.         double homePlays = h;
  17.        
  18.         double sum = normalPlays + holidayPlays + homePlays;
  19.        
  20.         if (typeOfYear == 't') {
  21.             sum = sum + 3;
  22.         }
  23.         System.out.println((int)sum);
  24.     }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment