Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment Title: Student Records Management Description: Create a program to manage student records. The program should allow the user to read student information from a

Assignment Title: Student Records Management
Description:
Create a program to manage student records. The program should allow the user to read student
information from a file, perform operations on the records, and write the modified records back to a
file. You will also implement inheritance to handle different types of students.
Instructions:
1. Create a class named "Student" with the following attributes:
- id (int): The student's identification number.
- name (String): The student's name.
- grade (double): The student's overall grade.
2. Create a constructor in the Student class to initialize the attributes.
3. Create a method named "displayInfo" in the Student class that prints the student's information.
4. Create two subclasses named "UndergraduateStudent" and "GraduateStudent" that inherit from
the Student class.
5. The UndergraduateStudent class should have an additional attribute:
- year (int): The student's current year of study.
6. The GraduateStudent class should have an additional attribute:
- researchTopic (String): The topic of the student's research.
7. Implement the necessary constructors and displayInfo methods in the subclasses.
8. Implement equals method in all classes.
9. Create a main class named "StudentRecordsManager" that will serve as the entry point for your
program.
10. In the StudentRecordsManager class, implement the following methods:
- readFromFile(String filename): Reads student records from a file specified by the filename
parameter. Each line in the file should contain a student's information in the following format:
"id,name,grade,year,researchTopic" (for GraduateStudent) or "id,name,grade,year" (for
UndergraduateStudent). Store the records in an appropriate data structure (e.g., ArrayList).
- writeToFile(String filename, ArrayList students): Writes the student records stored in
the ArrayList back to a file specified by the filename parameter. Each line in the file should follow
the same format as mentioned above.
- displayStudentInfo(ArrayList students): Displays the information of all students in the
ArrayList.
- calculateAverageGrade(ArrayList students): Calculates and returns the average grade
of all students.
11. In the main method of the StudentRecordsManager class, create an instance of the class and
perform the following actions:
- Call the readFromFile method to read student records from a file.
- Call the displayStudentInfo method to display the student records.
- Call the calculateAverageGrade method and display the average grade.
- Modify the records (e.g., change the grade of a student) as per the rules below:
Increase scores between 80-90 by 2 points (so 85.5 will be 87.5,81.9 will be 83.9 etc.)
Increase score >90 by 1 points
Decrease score <80 by 2 points
- Call the calculateAverageGrade method and display the average grade.
- Call the writeToFile method to write the modified records back to a file.
- Call readFromFile and then displayStudentInfo method again to verify the changes.
Note: Make sure to handle file I/O exceptions and provide appropriate error messages to the user.
Submission:
Submit the Java source code file(s), screenshot of the output and updated student record file. Also
include a writeup that describes your implementation. Submission without the writeup will get a score
of 0.
Remember to comment your code appropriately and provide meaningful variable and method names.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

Suppose P(C) = 0.3 and P(D |C) = 0.8. Find P(C & D).

Answered: 1 week ago