Question: For this java project, you will create a Java program for a school. The purpose is to create a report containing one or more classrooms.

For this java project, you will create a Java program for a school. The purpose is to create a report containing one or more classrooms. For each classroom, the report will contain: The room number of the classroom. The teacher and the subject assigned to the classroom. A list of students assigned to the classroom including their student id and final grade. ApplicationStructureProject should be organized in a directory. Create a directory called LastNamesP1 (replaceLastNames with last name of group members) The following shows the directory and files you should have: LastNamesP1 DirectoryDisplayable.java (15 points)Create Displayable interface. The interface should declare one method as follows: public abstract String display ()Person.java (15 points)Create Person class. Make it an abstract class. Declare the following instance variables:String firstNameString lastNameInclude the getter and setter methods for each variable. Use the camelcasenaming convention for methods and variables. Include a method namedgetFullName() that returns both names concatenated into a String with space between the first and last name.Teacher.java (15 points)Create the Teacher class. It inherits the Person abstract class and implements the Displayable interface. It defines only one variable as follows:String subjectInclude the getter and setter methods for the variable. Use the camelcasenaming convention. Provide a constructor that uses the following parameters to initialize the variables:String firstNameString lastNameString subjectOverride the display() method. It should return a String containing the teachersname using the getFullName() method defined in Person and the subject taught as follows:Student.java (15 points)Create the Student class. It inherits the Person abstract class and implements the Displayable interface. It defines two variables:int studentIdint finalGradeInclude the getter and setter methods for the variables. Use thecamelcase naming convention. Provide a constructor that uses thefollowing parameters to initialize the variables:String firstNameString lastNameint studentIdIntfinalGradeOverride the display() method. It should return a String containing thestudents id, the students name using the getFullName() method definedin Person, and the students final grade as follows: Student ID: 1 John Doe Final Grade: 90Classroom.java (15 points)Create the Classroom class. It inherits the Person abstract class andimplements the Displayable interface. It defines three variables:int roomNumberDisplayable teacher (note that the Teacher instance is downcastto the Displayable interface) ArrayList students (note that the Student instancesis downcast to the Displayable interface)Provide a no argument constructor. Provide another constructor that usesthe following parameters to initialize the variables:int roomNumberDisplayable teacherArrayList studentsOverride the display() method. It should return a String containing theclass room number, teacher information and list of students as follows:ProgrammingLogicIn your project directory create the PrintReports class.PrintReports should define the following methods using the listed methodsignatures:public PrintReports()public Displayable enterClassroom()public Displayable enterTeacher()public Displayable enterStudents()void report(ArrayList)Note that the methods are non static. One way to escape the staticrequirement main() imposes is to use this approach:Room Number: 10001John Smith teaches Computer ScienceStudent ID: 110001 Eric Jones Final Grade: 95Student ID: 110002 David Smith Final Grade: 90public class School{ public static void main(String[] args) { New PrintReports(); }The PrintReports class (25 points)The public PrintReport() constructorIn a do..while loop collect the data need to create a Classroomobject using the enterClassroom() method. You should be ableto create any number of Classroom objects. Prompt the user sohe or she can enter another Classroom or quit the loop. Storethe Classroom objects in an ArrayList collection.The public Displayable enterClassroom() MethodPrompt the user for a room number. Save it as an int. The roomnumber must be 100 or greater. If the user enters a lowernumber, he or she should be prompted again until anacceptable number is entered.Call enterTeacher() to obtain an instance of a teacher and storeit as a Displayable object.In a do..while loop, call enterStudent() to obtain a Student as aDisplayable object and store it in an ArrayListcollection. Prompt the user so he or she can enter anotherstudent or quit the loop.The public Displayable enterTeacher() Method The method should prompt the user for their first and last nameas well as the subject they teach. Create an instance ofTeacher using that data and return the object as instance ofDisplayable.The public Displayable enterStudent() MethodPrompt the user for student id, first and last names, and theirfinal grade. Using the data, create a Student instance. Astudents id must be greater than 0. A students final grade mustbe between 0 and 100. Return the student object as aDisplayable object.The void report(ArrayLIst) MethodA for loop, iterate through the ArrayList collectioncontaining the downcast Classroom objects.Call the display() method defined in Classroom. It should reportthe room number.It should call the display() method in the teacher variable toreport the teacher assigned to the classroom.In a for loop it should iterate through the ArrayListcollection of Student objects calling the display() method foreach one.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!