Advertisement
markopizzy

Untitled

Nov 2nd, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Exam_13 {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int minutes = Integer.parseInt(scanner.nextLine());
  8. String namePlayer = scanner.nextLine();
  9.  
  10. if (minutes < 1) {
  11. System.out.println("Match has just began!");
  12.  
  13. } else if (minutes < 45) {
  14. System.out.println("First half time.");
  15. if (minutes <= 10) {
  16. System.out.printf("%s missed a penalty.%n", namePlayer);
  17. if (minutes % 2 == 0)
  18. System.out.printf("%s was injured after the penalty.", namePlayer);
  19.  
  20. } else if (minutes <= 35) {
  21. System.out.printf("%s received yellow card.%n", namePlayer);
  22. if (minutes % 2 != 0)
  23. System.out.printf("%s got another yellow card.", namePlayer);
  24. } else {
  25. System.out.printf("%s SCORED A GOAL !!!", namePlayer);
  26. }
  27.  
  28. } else {
  29. System.out.println("Second half time.");
  30. if (minutes <= 55) {
  31. System.out.printf("%s got a freekick.", namePlayer);
  32. if (minutes % 2 == 0)
  33. System.out.printf("%s missed the freekick.%n", namePlayer);
  34.  
  35. } else if (minutes <= 80) {
  36. System.out.printf("%s missed a shot from corner.", namePlayer);
  37. if (minutes % 2 != 0)
  38. System.out.printf("%s has been changed with another player.%n", namePlayer);
  39. } else if (minutes <= 90) {
  40. System.out.printf("%s SCORED A GOAL FROM PENALTY !!!", namePlayer);
  41. }
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement