Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package July2018Exam;
- import java.util.Scanner;
- public class GameStatistic03 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int minutes = Integer.parseInt(scanner.nextLine());
- String player = scanner.nextLine();
- if (minutes == 0) {
- System.out.println("Match has just began!");
- }
- if (minutes > 0 && minutes < 45 ) {
- System.out.println("First half time.");
- if (minutes <= 10) {
- System.out.printf("%s missed a penalty.%n", player);
- if (minutes%2 == 0 ) {
- System.out.printf("%s was injured after the penalty.", player);
- }
- }
- if (minutes > 10 && minutes <= 35 ) {
- System.out.printf("%s received yellow card.%n", player);
- if (minutes%2 != 0) {
- System.out.printf("%s got another yellow card.", player);
- }
- }
- if (minutes > 35) {
- System.out.printf("%s SCORED A GOAL !!!", player);
- }
- }
- if (minutes >= 45) {
- System.out.println("Second half time.");
- if (minutes > 45 && minutes <= 55) {
- System.out.printf("%s got a freekick.%n", player);
- if (minutes%2 == 0) {
- System.out.printf("%s missed the freekick.", player);
- }
- }
- if (minutes > 55 && minutes <= 80) {
- System.out.printf("%s missed a shot from corner.%n", player);
- if (minutes%2 != 0) {
- System.out.printf("%s has been changed with another player.", player);
- }
- }
- if (minutes > 80 && minutes <= 90) {
- System.out.printf("%s SCORED A GOAL FROM PENALTY !!!",player);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement