Score: 0.9/1.0

World Cup Superclass

public class WorldCup {
    public String team1;
    public String team2;
    public String team3;
    public String team4;
    public String team5;
    public String color;
    
    public WorldCup (String team1, String team2, String team3, String team4, String team5, String color) {
        this.team1 = team1;
        this.team2 = team2;
        this.team3 = team3;
        this.team4 = team4;
        this.team5 = team5;
        this.color = color;
    }

    public String getTeam1() {
        return team1;
    }

    public String getTeam2() {
        return team2;
    }

    public String getTeam3() {
        return team3;
    }

    public String getTeam4() {
        return team4;
    }

    public String getTeam5() {
        return team5;
    }

    public void main(String[] args) {
        System.out.println("Team 1: " + this.team1);
        System.out.println("Team 2: " + this.team2);
        System.out.println("Team 3: " + this.team3);
        System.out.println("Team 4: " + this.team4);
        System.out.println("Team 5: " + this.team5);
        System.out.println("Team Colors: " + this.color);
    }
}

public class Argentina extends WorldCup {

    public Argentina(String team1, String team2, String team3, String team4, String team5, String color) {
        super(team1, team2, team3, team4, team5, color);
    }
}

public class Portugal extends WorldCup {

    public Portugal(String team1, String team2, String team3, String team4, String team5, String color) {
        super(team1, team2, team3, team4, team5, color);
    }
}

public class Morocco extends WorldCup {

    public Morocco(String team1, String team2, String team3, String team4, String team5, String color) {
        super(team1, team2, team3, team4, team5, color);
    }
}

public class Croatia extends WorldCup {

    public Croatia(String team1, String team2, String team3, String team4, String team5, String color) {
        super(team1, team2, team3, team4, team5, color);
    }
}

public class Brazil extends WorldCup {

    public Brazil(String team1, String team2, String team3, String team4, String team5, String color) {
        super(team1, team2, team3, team4, team5, color);
    }
}

Argentina arg = new Argentina("Argentina", "Null", "Null", "Null", "Null", "Blue and White");
Portugal por = new Portugal("Portugal", "Null", "Null", "Null", "Null", "Green and Red");
Morocco mor = new Morocco("Morocco", "Null", "Null", "Null", "Null", "Green and Red");
Croatia cro = new Croatia("Croatia", "Null", "Null", "Null", "Null", "Red and White");
Brazil brz = new Brazil("Brazil", "Null", "Null", "Null", "Null", "Green and Yellow");

arg.main(null);
por.main(null);
mor.main(null);
cro.main(null);
brz.main(null);
Team 1: Argentina
Team 2: Null
Team 3: Null
Team 4: Null
Team 5: Null
Team Colors: Blue and White
Team 1: Portugal
Team 2: Null
Team 3: Null
Team 4: Null
Team 5: Null
Team Colors: Green and Red
Team 1: Morocco
Team 2: Null
Team 3: Null
Team 4: Null
Team 5: Null
Team Colors: Green and Red
Team 1: Croatia
Team 2: Null
Team 3: Null
Team 4: Null
Team 5: Null
Team Colors: Red and White
Team 1: Brazil
Team 2: Null
Team 3: Null
Team 4: Null
Team 5: Null
Team Colors: Green and Yellow

Inheritance (To Do)

public class Person {
   protected String name;
   protected String birthday;

   public Person (String name, String birthday){
      this.name = name;
      this.birthday = birthday;
   }

   public String getName(){
      return name;
   }

   public int getAge() {
        return 2022 - Integer.parseInt(birthday);
   }

   @Override
   public String toString() {
        return "Person (name: " + name + ", birthday: " + birthday + ")";
   }
}

public class Student extends Person {
   private int grade;
   private double gpa;


   public Student (String name, String birthday, int grade, double gpa) {
      super(name, birthday);
      this.grade = grade;
      this.gpa = gpa;
   }

   // return gpa
   public double getGPA() {
       return gpa;
   }


   // return grade
   public int getGrade(){
      return grade;
   }

   @Override
   public String toString() {
        return "Student (name: " + name + ", birthday: " + birthday +  ", gpa: " + gpa + ", grade: " + grade + ")";
   }
}

public class Teacher extends Person {
     private String subject;
     private String degree;
  
     public Teacher (String name, String birthday, String subject, String degree) {
        super(name, birthday);
        this.subject = subject;
        this.degree = degree;
     }
  
     // return subject
     public String getSubject() {
        return subject;
     }
  
     // return yearsOfExperience

     // return degree
     public String getDegree() {
        return degree;
     }

     @Override
     public String toString() {
           return "Teacher (name: " + name + ", birthday: " + birthday + ", subject: " + subject +  ", degree: " + degree + ")";
     }
}

Person steve = new Person("Steve", "1990");
System.out.println(steve.toString());
Person jazair = new Student("Jazair", "2005", 11, 4.0);
System.out.println(jazair.toString());
Person george = new Teacher("George", "1980", "math", "Data Science");
System.out.println(george.toString());
Person (name: Steve, birthday: 1990)
Student (name: Jazair, birthday: 2005, gpa: 4.0, grade: 11)
Teacher (name: George, birthday: 1980, subject: math, degree: Data Science)