1 Last updated 11/16/2020 CSC110 Final Project For your final project, you will be reusing Person.java from Module 0111 and creating three new files: Teacher.java, Student.java, and Section.java. In...

1 answer below »
Not really sure what to put for referencing and pages, just let me know what you need! (:


1 Last updated 11/16/2020 CSC110 Final Project For your final project, you will be reusing Person.java from Module 0111 and creating three new files: Teacher.java, Student.java, and Section.java. In these files, you are going to implement the Java classes required to store a course section in which each section of a course has exactly one teacher and some number of students. Required Classes You will subclass the Person class from Module 0111 to create Teacher and Student classes. You will also create a Section class that stores the details required to connect a course title, Teacher object, and Student objects to create a section of a course. Class Diagrams in Unified Modeling Language (UML) NOTE: The UML notation for arrays such as scores: int[1..*] should be written in Java as int[] scores 2 Last updated 11/16/2020 Class Requirements Teacher getEmployeeID: standard getter for employeeID setEmployeeID: standard setter for employeeID isSameTeacher: returns true if the instance employeeID and the otherTeacher employeeID string match, false otherwise printDetails: overrides the printDetails method of Person to display employee details in the format shown below; must include a call to super.printDetails() to print the name, birthdate, age, and adult/minor status. Employee ID 1001 Richard Feynman born 5/11/1918 age 102 adult Student getStudentID, getScores: standard getter for studentID, scores setStudentID, setScores: standard setter for studentID, scores isSameStudent: returns true if the instance studentID and the otherStudent studentID string match, false otherwise computeWorstScore: returns the lowest score from the instance scores computeBestScore: returns the highest score from the instance scores computeAverageScore: returns the average of all of the instance scores computeGrade: call computeAverageScore to find the average score and then returns the student grade using the scale: A ≥ 90 B ≥ 80 and < 90="" c="" ≥="" 70="" and="">< 80="" d="" ≥="" 60="" and="">< 70="" f="">< 60 printdetails: overrides the printdetails method of person to display student details in the format shown below; must include a call to super.printdetails() to print the name, birthdate, age, and adult/minor status. student id 2001 laurie brown born 4/1/1928 age 92 adult scores 96 100 85 91 worst 85 best 100 average 93 grade a section gettitle, getteacher, getstudent: standard getters for title, teacher, student settitle, setteacher, setstudent: standard setters for title, teacher, student printroster: displays the course title, teacher details, and student details in the format shown below; should include a single system.out.println for the title, single call to teacher printdetails to print the teacher, and multiple calls to student printdetails to print the student: class physics 101 employee id 1001 richard feynman born 5/11/1918 age 102 adult student id 2001 laurie brown born 4/1/1928 age 92 adult scores 96 100 85 91 worst 85 best 100 average 93 grade a student id 2002 michel baranger born 7/31/1927 age 93 adult scores 90 70 80 76 worst 70 best 90 average 79 grade c 3 last updated 11/16/2020 project setup you should work through this assignment creating one class at a time in the following order. your instructor has provided a test class that you should run at each step to verify that you have implemented your class correctly. all work should be completed in the same project in eclipse where you completed the person class. the following steps assume this was your labs project. if you used a different project, please use that wherever labs appears in the direction. teacher 1. create a new java class named teacher in your labs folder. 2. your existing person.java file should already be in your labs folder. 3. from the canvas final project module, choose final test files, right-click on teachertest.java, choose save as, and then save the file to the directory where teacher.java is located. 4. in the eclipse package explorer window, click on labs to highlight it and then go to file | refresh. the teachertest.java files should appear. 5. write the code for teacher.java. 6. when you are ready to test teacher.java, double-click teachertest.java in the package explorer to make it the current file and then press the run button. 7. repeat steps 5 and 6 until teachertest.java reports 0 errors and the printed details match the example given in the teacher class requirements section of this document. student 1. create a new java class named student. 2. from the canvas final project module, choose final test files, right-click on studenttest.java, choose save as, and then save the file to the directory where student.java is located. 3. in the eclipse package explorer window, click on labs to highlight it and then go to file | refresh. the studenttest.java file should appear. 4. write the code for student.java. 5. when you are ready to test student.java, double-click studenttest.java in the package explorer and then press the run button. 6. repeat steps 4 and 5 until studenttest.java reports 0 errors and the printed details match the example given in the student class requirements section of this document. section 1. create a new java class named section. 2. from the canvas final project module, choose final test files, right-click on sectiontest.java, choose save as, and then save the file to the directory where section.java is located. 3. in the eclipse package explorer window, click on labs to highlight it and then go to file | refresh. the sectiontest.java file should appear. 4. write the code for section.java. 5. when you are ready to test section.java, double-click sectiontest.java in the package explorer and then press the run button. 6. repeat steps 4 and 5 until sectiontest.java reports 0 errors and the printed details match the example given in the section class requirements section of this document. studentgradetest 1. create a new java class named studentgradetest. 2. given this new class a main method. 4 last updated 11/16/2020 3. create a student object and give it your first name, your last name, the birthdate 5/1/1998, and the student id 1001. 4. to test that you are assigning the correct grades, create a loop that counts from 50 to 100 by 5. each time, give your student object this number as a single score and call printdetails. this will allow you to verify that the right grade is assigned for 50, 55, 60, 65, 70, 75, 80, 75, 90, 95, and 100. submitting your work when everything is complete, submit only these files in canvas: • person.java • teacher.java • student.java • section.java • studentgradetest.java bonus for bonus points, recall that early in the semester we discussed system.out.printf which allows data to be formatted. research system.out.printf and use it to create new method in section called printprettyroster which will print the roster in the following format: class physics 101 richard feynman id name avg grade scores 2001 laurie brown 93 a 96 100 85 91 2002 michel baranger 79 c 90 70 80 76 for full bonus points, your scores must be “right-aligned” such as how the final 0 of 70 and 100 line up over each other. for testing, change sectiontest.java from calling printroster to calling printprettyroster. 60="" printdetails:="" overrides="" the="" printdetails="" method="" of="" person="" to="" display="" student="" details="" in="" the="" format="" shown="" below;="" must="" include="" a="" call="" to="" super.printdetails()="" to="" print="" the="" name,="" birthdate,="" age,="" and="" adult/minor="" status.="" student="" id="" 2001="" laurie="" brown="" born="" 4/1/1928="" age="" 92="" adult="" scores="" 96="" 100="" 85="" 91="" worst="" 85="" best="" 100="" average="" 93="" grade="" a="" section="" gettitle,="" getteacher,="" getstudent:="" standard="" getters="" for="" title,="" teacher,="" student="" settitle,="" setteacher,="" setstudent:="" standard="" setters="" for="" title,="" teacher,="" student="" printroster:="" displays="" the="" course="" title,="" teacher="" details,="" and="" student="" details="" in="" the="" format="" shown="" below;="" should="" include="" a="" single="" system.out.println="" for="" the="" title,="" single="" call="" to="" teacher="" printdetails="" to="" print="" the="" teacher,="" and="" multiple="" calls="" to="" student="" printdetails="" to="" print="" the="" student:="" class="" physics="" 101="" employee="" id="" 1001="" richard="" feynman="" born="" 5/11/1918="" age="" 102="" adult="" student="" id="" 2001="" laurie="" brown="" born="" 4/1/1928="" age="" 92="" adult="" scores="" 96="" 100="" 85="" 91="" worst="" 85="" best="" 100="" average="" 93="" grade="" a="" student="" id="" 2002="" michel="" baranger="" born="" 7/31/1927="" age="" 93="" adult="" scores="" 90="" 70="" 80="" 76="" worst="" 70="" best="" 90="" average="" 79="" grade="" c="" 3="" last="" updated="" 11/16/2020="" project="" setup="" you="" should="" work="" through="" this="" assignment="" creating="" one="" class="" at="" a="" time="" in="" the="" following="" order.="" your="" instructor="" has="" provided="" a="" test="" class="" that="" you="" should="" run="" at="" each="" step="" to="" verify="" that="" you="" have="" implemented="" your="" class="" correctly.="" all="" work="" should="" be="" completed="" in="" the="" same="" project="" in="" eclipse="" where="" you="" completed="" the="" person="" class.="" the="" following="" steps="" assume="" this="" was="" your="" labs="" project.="" if="" you="" used="" a="" different="" project,="" please="" use="" that="" wherever="" labs="" appears="" in="" the="" direction.="" teacher="" 1.="" create="" a="" new="" java="" class="" named="" teacher="" in="" your="" labs="" folder.="" 2.="" your="" existing="" person.java="" file="" should="" already="" be="" in="" your="" labs="" folder.="" 3.="" from="" the="" canvas="" final="" project="" module,="" choose="" final="" test="" files,="" right-click="" on="" teachertest.java,="" choose="" save="" as,="" and="" then="" save="" the="" file="" to="" the="" directory="" where="" teacher.java="" is="" located.="" 4.="" in="" the="" eclipse="" package="" explorer="" window,="" click="" on="" labs="" to="" highlight="" it="" and="" then="" go="" to="" file="" |="" refresh.="" the="" teachertest.java="" files="" should="" appear.="" 5.="" write="" the="" code="" for="" teacher.java.="" 6.="" when="" you="" are="" ready="" to="" test="" teacher.java,="" double-click="" teachertest.java="" in="" the="" package="" explorer="" to="" make="" it="" the="" current="" file="" and="" then="" press="" the="" run="" button.="" 7.="" repeat="" steps="" 5="" and="" 6="" until="" teachertest.java="" reports="" 0="" errors="" and="" the="" printed="" details="" match="" the="" example="" given="" in="" the="" teacher="" class="" requirements="" section="" of="" this="" document.="" student="" 1.="" create="" a="" new="" java="" class="" named="" student.="" 2.="" from="" the="" canvas="" final="" project="" module,="" choose="" final="" test="" files,="" right-click="" on="" studenttest.java,="" choose="" save="" as,="" and="" then="" save="" the="" file="" to="" the="" directory="" where="" student.java="" is="" located.="" 3.="" in="" the="" eclipse="" package="" explorer="" window,="" click="" on="" labs="" to="" highlight="" it="" and="" then="" go="" to="" file="" |="" refresh.="" the="" studenttest.java="" file="" should="" appear.="" 4.="" write="" the="" code="" for="" student.java.="" 5.="" when="" you="" are="" ready="" to="" test="" student.java,="" double-click="" studenttest.java="" in="" the="" package="" explorer="" and="" then="" press="" the="" run="" button.="" 6.="" repeat="" steps="" 4="" and="" 5="" until="" studenttest.java="" reports="" 0="" errors="" and="" the="" printed="" details="" match="" the="" example="" given="" in="" the="" student="" class="" requirements="" section="" of="" this="" document.="" section="" 1.="" create="" a="" new="" java="" class="" named="" section.="" 2.="" from="" the="" canvas="" final="" project="" module,="" choose="" final="" test="" files,="" right-click="" on="" sectiontest.java,="" choose="" save="" as,="" and="" then="" save="" the="" file="" to="" the="" directory="" where="" section.java="" is="" located.="" 3.="" in="" the="" eclipse="" package="" explorer="" window,="" click="" on="" labs="" to="" highlight="" it="" and="" then="" go="" to="" file="" |="" refresh.="" the="" sectiontest.java="" file="" should="" appear.="" 4.="" write="" the="" code="" for="" section.java.="" 5.="" when="" you="" are="" ready="" to="" test="" section.java,="" double-click="" sectiontest.java="" in="" the="" package="" explorer="" and="" then="" press="" the="" run="" button.="" 6.="" repeat="" steps="" 4="" and="" 5="" until="" sectiontest.java="" reports="" 0="" errors="" and="" the="" printed="" details="" match="" the="" example="" given="" in="" the="" section="" class="" requirements="" section="" of="" this="" document.="" studentgradetest="" 1.="" create="" a="" new="" java="" class="" named="" studentgradetest.="" 2.="" given="" this="" new="" class="" a="" main="" method.="" 4="" last="" updated="" 11/16/2020="" 3.="" create="" a="" student="" object="" and="" give="" it="" your="" first="" name,="" your="" last="" name,="" the="" birthdate="" 5/1/1998,="" and="" the="" student="" id="" 1001.="" 4.="" to="" test="" that="" you="" are="" assigning="" the="" correct="" grades,="" create="" a="" loop="" that="" counts="" from="" 50="" to="" 100="" by="" 5.="" each="" time,="" give="" your="" student="" object="" this="" number="" as="" a="" single="" score="" and="" call="" printdetails.="" this="" will="" allow="" you="" to="" verify="" that="" the="" right="" grade="" is="" assigned="" for="" 50,="" 55,="" 60,="" 65,="" 70,="" 75,="" 80,="" 75,="" 90,="" 95,="" and="" 100.="" submitting="" your="" work="" when="" everything="" is="" complete,="" submit="" only="" these="" files="" in="" canvas:="" •="" person.java="" •="" teacher.java="" •="" student.java="" •="" section.java="" •="" studentgradetest.java="" bonus="" for="" bonus="" points,="" recall="" that="" early="" in="" the="" semester="" we="" discussed="" system.out.printf="" which="" allows="" data="" to="" be="" formatted.="" research="" system.out.printf="" and="" use="" it="" to="" create="" new="" method="" in="" section="" called="" printprettyroster="" which="" will="" print="" the="" roster="" in="" the="" following="" format:="" class="" physics="" 101="" richard="" feynman="" id="" name="" avg="" grade="" scores="" 2001="" laurie="" brown="" 93="" a="" 96="" 100="" 85="" 91="" 2002="" michel="" baranger="" 79="" c="" 90="" 70="" 80="" 76="" for="" full="" bonus="" points,="" your="" scores="" must="" be="" “right-aligned”="" such="" as="" how="" the="" final="" 0="" of="" 70="" and="" 100="" line="" up="" over="" each="" other.="" for="" testing,="" change="" sectiontest.java="" from="" calling="" printroster="" to="" calling="">
Answered Same DayDec 02, 2021

Answer To: 1 Last updated 11/16/2020 CSC110 Final Project For your final project, you will be reusing...

Sayed Shad Ahmad answered on Dec 06 2021
142 Votes
src/Person.java
src/Person.java
//Importing LocalDate class for getting system date
import java.time.LocalDate;
//Class Person
public class Person 
{
    //Instance variables for Person name & date of birth
    private String firstName;
    private String lastName;
    private int birthM
onth;
    private int birthDay;
    private int birthYear;

    //Getter method to get first name of Person
    public String getFirstName()
    {
        return firstName;
    } 

    //Getter method to get last name of Person
    public String getLastName()
    {
        return lastName;
    } 

    //Getter method to get birth month of Person
    public int getBirthMonth() 
    {
        return birthMonth;
    } 

    //Getter method to get birth day of Person
    public int getBirthDay()
    {
        return birthDay;
    } 

    //Getter method to get birth year of Person
    public int getBirthYear()
    {
        return birthYear;
    }

    //Setter method to set first name of Person
    public void setFirstName(String newFirstName) 
    {
        this.firstName = newFirstName;
    } 

    //Setter method to set last name of Person
    public void setLastName(String newLastName) 
    {
        this.lastName = newLastName;
    } 

    //Setter method to set date of birth of Person
    public void setBirthDate(int newBirthMonth, int newBirthDay, int newBirthYear)
    {
        this.birthMonth = newBirthMonth;
        this.birthDay = newBirthDay;
        this.birthYear = newBirthYear;
    }

    //Method to calculate age of Person 
    public int computeAge()
    {
        //Getting current system date
        LocalDate ld = LocalDate.now();

        int currYear = ld.getYear();

        return currYear - this.birthYear;
    }

    //Method to check whether the Person is an adult
    public boolean isAdult()
    {
        return this.computeAge() >= 18;
    }

    //Method to print Person details
    public void printDetails()
    {
        System.out.println(this.firstName + " " + this.lastName + " born " +
                            this.birthMonth + "/" + this.birthDay + "/" +
                            this.birthYear + " age " + this.computeAge() +
                            " " + (isAdult() ? "adult" : "minor"));
    }
}
src/Section.java
src/Section.java
//Class Section
public class Section 
{
    //Instance variable for Section title, Teacher object & array of Student objects
    private String title;
    private Teacher teacher;
    private Student students[];

    //Getter method to get title of Section
    public String getTitle() 
    {
        return title;
    }

    //Getter method to get Teacher object
    public Teacher getTeacher() 
    {
        return teacher;
    }

    //Getter method to get array of Student objects
    publ...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here