0% found this document useful (0 votes)
22 views5 pages

PRF192 Assignment

The document describes requirements for a student score management program that uses C language. It allows adding, displaying, searching students and calculating average scores using parallel arrays to store student IDs, names and scores. The program loads data from a file, handles empty lists and missing IDs, and limits students to 100.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views5 pages

PRF192 Assignment

The document describes requirements for a student score management program that uses C language. It allows adding, displaying, searching students and calculating average scores using parallel arrays to store student IDs, names and scores. The program loads data from a file, handles empty lists and missing IDs, and limits students to 100.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

PRF192 ASSIGNMENT

Requirements:
The problem "Student Score Management" is described as follows:
Objective: Build a program using the C language to manage the scores of students. The
program allows users to perform operations such as adding new students, displaying the list
of students, entering scores for students, searching for students by student ID, calculating
the average score, and saving student information to a file.
Requirements:
The program will automatically load the list of students from a file named "students.txt" into
the system.
Users can perform the following operations from the program menu:
- Add new student: Users enter the student ID, student name, and score from the keyboard.
The information of the new student will be added to the list.
- Display the list of students: The program will display the information of all students in the
list, including student ID, student name, and score.
- Search for students by student ID: Users enter the student ID from the keyboard. The
program searches for the student with the corresponding student ID in the list and displays
the information of that student.
- Calculate the average score: The program calculates the average score of all students in the
list and displays the result.
- Save the list of students to a file: The program saves the information of all students in the
list to a specified file.
- Sort the list of students in descending order of scores.
The list of students is managed using parallel arrays:
- Array `studentIDs`: Stores the student IDs of each student.
- Array `studentNames`: Stores the student names of each student.
- Array `scores`: Stores the scores of each student.
Limitation on the number of students: Maximum 100 students.

Main functions of the program:


- Load student information from an existing file. The data in the file follows the structure:
Student ID, Student Name, Score.

1
- Add new student: Users enter the student ID, student name, and score from the keyboard.
The information of the new student will be added to the arrays `studentIDs`,
`studentNames`, and `scores`.

- Display the list of students: The program iterates through the arrays `studentIDs`,
`studentNames`, and `scores` to display the information of all students in the list.

- Search for students by student ID: Users enter the student ID from the keyboard. The
program iterates through the `studentIDs` array to find the student with the corresponding
student ID and displays the information of that student.

- Calculate the average score: The program calculates the sum of scores of all students in the
`scores` array and divides it by the number of students to calculate the average score.

- Sort the list of students in descending order of scores: The program sorts the arrays
`studentIDs`, `studentNames`, and `scores` based on the `scores` array in descending order.

- Save the list of students to a file: The program opens a file in write mode and writes the
information of all students in the list to the specified file.

Note:
- The program uses parallel arrays to store student information instead of using a struct data
structure.
- The list of students is limited to a maximum of 100 students.
- The program needs to handle special cases such as an empty list, not finding a student with
a specific student ID, etc.

Implementation:
- Step 1: Declare the arrays `studentIDs`, `studentNames`, and `scores` with the maximum
size for the list of students.
- Step 2: Build functions to add new students, display the list of students, search for students
by student ID, calculate the average score, and save the list to a file.

2
- Step 3: Build the `main` function to perform operations from the program menu. In the
`main` function, use a loop to allow users to perform multiple operations consecutively until
they choose to exit the program.

Output
1. Add a new student.

2. Select 2 to display students list

3. Select 3 to search student

3
4. Select option 4.

5. Select option 5.

6. Select option 6.

4
NOTE that;
Your student ID and student Name must be at the top of your solution code.

You might also like