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
PLEASE HELP ASAP!!!!!!!!!!!
Bingel [31]

Answer:

True

Explanation:

3 0
2 years ago
Read 2 more answers
________ are devices in a computer that are in either the on or off state
Vanyuwa [196]
The appropriate response is Electrical Switches. These are electromechanical gadgets that are utilized as a part of electrical circuits to control, recognize when frameworks are outside their working reaches, flag controllers of the whereabouts of machine individuals and work pieces, give a way to manual control of machine and process capacities, control lighting, et cetera.
6 0
3 years ago
Please answer this question​
RSB [31]

Answer:

what is the other language

is it Assamese clarify me in the comment section bro

4 0
2 years ago
Use ordinary pipes to implement an inter-process communication scheme for message passing between processes. Assume that there a
Naya [18.7K]

Answer:

Yup

Explanation:

6 0
3 years ago
IT professionals should help to protect users’ personal information, such as bank account information or Social Security numbers
sesenic [268]

To prevent theft of account information, identity theft, money, important passwords, and personal information.


Hope it helps ❤️

8 0
3 years ago
Read 2 more answers
Other questions:
  • Which action will help you protect data in your computer in case of an earthquake?
    7·2 answers
  • Can you please answer these questions for me: Is it illegal to copyright? What does it mean to get copyrighted? What are example
    12·2 answers
  • 10. Question
    15·1 answer
  • Which director has shot a movie in HD? George Lucas, Michael Mann, Michael Moore, none of the above, all of the above
    14·1 answer
  • Why would you use quotation marks in a search string when conducting an internet search?
    12·1 answer
  • Whats the answer :)?<br>i will give brainslist​
    11·1 answer
  • A file named loan.html, write an HTML document that looks similar to figure 9-7 in the textbook. Write four functions with these
    8·1 answer
  • A signal has a wavelength of 1 11m in air. How far can the front of the wave travel during 1000 periods?
    7·1 answer
  • What is 5 times 5 times 16 times 11 2345
    6·2 answers
  • Write the simplest statement that prints the following: 3 2 1 Go! python
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!