So I need help with a peculiar assignment. I have 3 files, "MainClass.java", "Human.java", & "Student.java".   In my Human File, I have the following code.... "public abstract class Human {     private String name;     private String address;     private short age;          // constructor that takes only two paras     public Human(String name, short age) {         this.name = name;         this.age = age;     }          public String getName() {         return name;     }          public void setName(String name) {         this.name = name;     }          public abstract String getAddress() ;          public abstract void setAddress(String address);               public short getAge() {         return age;     }          public void setAge(short age) {         this.age = age;     } }"   AND in my Student File, I have " public class Student extends Human {     // private instance variables for GPA and address     private double gpa;     private String address;     // constructor that takes only two parameters: name and age     public Student(String name, short age) {         super(name, age); // call the constructor of the parent class     }     // implementation of abstract getAddress method from Human class     @Override     public String getAddress() {         return address;     }     // implementation of abstract setAddress method from Human class     @Override     public void setAddress(String address) {         this.address = address;     }     // getter method for GPA     public double getGpa() {         return gpa;     }     // setter method for GPA     public void setGpa(double gpa) {         this.gpa = gpa;     } }". The code in those 2 are all set, But what i really need help with is completeing the following steps in my MainClass file " public class MainClass {          public static void main(String[] args) {         // ToDo 5: Fix the error                  // ToDo 6: Fix the constructor of Student class                                  // Todo 7: Create two classes for Freshman and Senior                                   // ToDo 8: The senior class should have a minimum of 85 credits                    // ToDo 9: Add a toString method for Freshman class                          // ToDo 10: Add a toString method for Senior class                          Freshman std1= new Student("James", 20, 12); // name, age, credits                                  Senior std2 = new Student("John", 30, 90);                  // ToDo 11: Set the gpa of the student using the scanner and user         //             input and then print the output.                  System.out.println(std1);                                  System.out.println(std2);                  // ToDo 12: add comments and explain your code                  // ToDo 13: submit using a pull request.     } }". Can someone help me do the "to-do"'s here?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

So I need help with a peculiar assignment. I have 3 files, "MainClass.java", "Human.java", & "Student.java".

 

In my Human File, I have the following code....

"public abstract class Human {
    private String name;
    private String address;
    private short age;
    
    // constructor that takes only two paras
    public Human(String name, short age) {
        this.name = name;
        this.age = age;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public abstract String getAddress() ;
    
    public abstract void setAddress(String address);
    
    
    public short getAge() {
        return age;
    }
    
    public void setAge(short age) {
        this.age = age;
    }
}"

 

AND in my Student File, I have

"

public class Student extends Human {
    // private instance variables for GPA and address
    private double gpa;
    private String address;

    // constructor that takes only two parameters: name and age
    public Student(String name, short age) {
        super(name, age); // call the constructor of the parent class
    }

    // implementation of abstract getAddress method from Human class
    @Override
    public String getAddress() {
        return address;
    }

    // implementation of abstract setAddress method from Human class
    @Override
    public void setAddress(String address) {
        this.address = address;
    }

    // getter method for GPA
    public double getGpa() {
        return gpa;
    }

    // setter method for GPA
    public void setGpa(double gpa) {
        this.gpa = gpa;
    }
}".

The code in those 2 are all set, But what i really need help with is completeing the following steps in my MainClass file

"

public class MainClass {
    
    public static void main(String[] args) {
        // ToDo 5: Fix the error
        
        // ToDo 6: Fix the constructor of Student class
                
                // Todo 7: Create two classes for Freshman and Senior 
                
                // ToDo 8: The senior class should have a minimum of 85 credits  
        
        // ToDo 9: Add a toString method for Freshman class
        
                // ToDo 10: Add a toString method for Senior class
                
        Freshman std1= new Student("James", 20, 12); // name, age, credits
                
                Senior std2 = new Student("John", 30, 90);
        
        // ToDo 11: Set the gpa of the student using the scanner and user
        //             input and then print the output.
        
        System.out.println(std1);
                
                System.out.println(std2);
        
        // ToDo 12: add comments and explain your code
        
        // ToDo 13: submit using a pull request.
    }

}". Can someone help me do the "to-do"'s here?

Expert Solution
steps

Step by step

Solved in 3 steps with 6 images

Blurred answer
Knowledge Booster
Developing computer interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education