1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
stiks02 [169]
3 years ago
11

Create a program that generates a report that displays a list of students, classes they are enrolled in and the professor who te

aches that class. There are 3 files that provide the input data: 1. FinalRoster.txt : List of students and professors ( S: student, P: professor) Student row: S,Student Name, StudentID Professor row: P, Professor Name, Professor ID, Highest Education 2. FinalClassList.txt: List of classes and professor who teach them (ClassID, ClassName, ID of Professor who teach that class) 3. FinalStudentClassList.txt: List of classes the students are enrolled in. (StudentID, ClassID) The output shall be displayed on screen and stored in a file in the format described in FinalOutput.txt You will need to apply all course concepts in your solution. 1. Student and Professor should be derived from a super class "Person" 2. Every class should implement toString method to return data in the format required for output 3. Exception handling (e.g. FileNotFound etc.) must be implemented 4. Source code must be documented in JavaDoc format 5. Do not hard code number of students, professors or classes. Submit source Java files, the output file and screenshot of the output in a zip format

Computers and Technology
1 answer:
Ainat [17]3 years ago
6 0

Answer:

All the classes are mentioned with code and screenshots. . That class is shown at last.

Explanation:

Solution

Class.Java:

Code

**

* atauthor your_name

* This class denotes Class at the college.

*

*/

public class Class {

 

  private String className,classID;

  private Professor professor;

 

  /**

  * atparam className

  * atparam classID

  * atparam professor

  */

  public Class(String className, String classID, Professor professor) {

      this.classID=classID;

      this.className=className;

      this.professor=professor;

  }

     /**

  * at return classID of the class

  */

  public String getClassID() {

      return classID;

  }

    /**

  * Override toString() from Object Class

  */

  public String toString() {    

      return classID+" "+className+" "+professor.getName()+" "+professor.getEducation();        

  }  

}

Person.Java:

Code:

/**

* atauthor your_name

* This class represents Person

*

*/

public class Person {    

  protected String name;  

  /**method to fetch name

  * at return

  */

  public String getName() {

      return name;

  }

  /**method to set name

  * at param name

  */

  public void setName(String name) {

      this.name = name;

  }

Professor.java:

Code:

import java.util.ArrayList;

import java.util.List;  

/**

* at author your_name

*

*This class represents professors

*

*/

public class Professor extends Person{    

  private String professorID, education;

  private List<Class> classes=new ArrayList<Class>();    

  /**

  * at param name

  * at param professorID

  * at param education

  */

  public Professor(String name,String professorID,String education) {        

      this.name=name;

      this.professorID=professorID;

      this.education=education;        

  }

  /**

  * at return

  */

  public String getEducation() {

      return this.education;

  }    

  /**

  * at return

  */

  public String getprofessorID() {

      return this.professorID;

  }  

  /** to add classes

  * at param Class

  */

  public void addClass(Class c) {

      classes.add(c);

  }  

  /**

  * Override toString() from Object Class

  */

  public String toString() {

      String result=this.getName()+" - "+professorID+" - "+education;

      for(Class c:classes) {

          result+=c.toString()+"\n";

      }      

      return result;

  }

}

}

Student.java:

Code:

import java.util.ArrayList;

import java.util.List;  

/**

* This class represents students

*  at author your_Name

*

*/

public class Student extends Person{    

  private String studentID;

  private List<Class> classes=new ArrayList<Class>();    

  /**

  * atparam name

  * atparam studentID

  */

  public Student(String name,String studentID) {      

      this.name=name;

      this.studentID=studentID;      

  }  

  /**

  * atreturn

  */

  public String getStudentID() {

      return studentID;

  }

     /**

  * atparam c

  */

  public void addClass(Class c) {

      classes.add(c);

  }    

  /**

  * atreturn

  */

  public int getClassCount() {

      return classes.size();

  }

  /**

  * Override toString() from Object Class

  */

  public String toString() {

      String result=this.getName()+" - "+studentID+"\n";

      for(Class c:classes) {

          result+=c.toString()+"\n";

      }    

      return result;

  }  

}

NOTE: Kindly find an attached copy of screenshot of the output, which is a part of the solution to this question

You might be interested in
"if" statements are part of creating computer programs, what are these instructions called and how would you use them?
podryga [215]

Answer:

if means that like (if this happen it will come or not come answer)

Explanation:

sorry I don't know how to tell but plz reply if you understand or not.

7 0
2 years ago
Read 2 more answers
In linux, a(n) ____ is a data structure that stores all information (such as file permissions, ownership, and file type) about a
Galina-37 [17]
Hi,


Answer => <span>Inode


Good Lessons </span>
4 0
3 years ago
Which type of mountain is formed due to the collision of two different kinds of plates?
Lyrx [107]
D) Andean mountains are formed due to the collision of two different kinds of plates.
6 0
3 years ago
Read 2 more answers
Which of the following is the most common tool that Windows administrators use on the domain controller?
baherus [9]

Answer:

D. The Active Directory Users and Computers

Explanation:

The Active Directory Users and Computers (ADUC) is one of the many tools used to administer the Active Directory and it is the most common tool that Windows admins use on the domain controller. It provides most of the admins functions such as

i. resetting of password

ii. unlocking users

iii. delegating of permissions to users to manage group policy

iv. managing Active Directory objects - users, computers, contacts, groups - and their attributes.

Other tools are Active Directory Component Services (allows to manage component services), Active Directory Domains and Trusts (allows to manage trusts between forests and domains), Active Directory Administrative Center (allows to manage password policies and even get the history of PowerShell logs).

<em>Hope this helps!</em>

3 0
3 years ago
​to add notes or comments, insert a comment tag using the syntax _____.
Aneli [31]
The needed syntax would be:
<!--comment-->
Hope I could be of assistance! ;)
4 0
3 years ago
Read 2 more answers
Other questions:
  • When employees are hired, they agree to only use cell phones during breaks. How would you classify this?
    8·2 answers
  • What steps should Jeremy take to get himself motivated to study for the test?
    12·2 answers
  • IN THE MOVIE BACK TO THE FUTURE 1985 IS 1985 THE PUBLICATION DATE?WHERE CAN I FIND THE MOVIE?
    6·1 answer
  • Which principle of design does a designer apply when they create rhythmic movement in a garment by using recurring pleats or det
    13·1 answer
  • You have a web application hosted in AWS cloud where the application logs are sent to Amazon CloudWatch. Lately, the web applica
    7·1 answer
  • Manuel has set up his network so that some employees can open and view files but are unable to edit them. Others can open, view,
    10·1 answer
  • 9. Which of the following is the most popular eSport game ever?
    13·1 answer
  • Any device that uses light to read and write information.
    9·2 answers
  • Based on the following quote from Leonardo Da Vinci, what would be his definition of a fine artist? “Principles for the Developm
    11·2 answers
  • joe is in the planning stages to make sure that an upcoming company promotion during a major sporting event will not overwhelm h
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!