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