Sample problem with solution (2)
Sample problem with solution (2)
The goal of this problem is to implement a simple student grading system for a high school. The
system will allow teachers to enter student data, calculate their grades, and generate a report. It
will also save the results to a file.
Problem Description:
You are tasked with creating a Java program that performs the following operations for each
student:
1. Student Information: Collect information about 120 students from a comma delimited
file (students.txt):
5. Array:
○ Store the student data (Name, Student Number, Marks, Average, and Grade) in
an array.
========================================================================
SOLUTION:
Pseudocode
Create Student class with attributes:
- name
- studentNumber
- marks (array of 3 subjects)
- average
- grade
and methods:
● calculateAverage(): Compute the average marks
● calculateGrade(): Assign a grade based on average
main() method
- Load the file using readInputFile() method
- Display menu to user
● Save to file
● Display student report
● Find name in list
● Find student number in list
Code: https://onlinegdb.com/W1RSYhjv_