Student Report Card
This program is designed to manage student data and generate a report card. It allows the user to input details for multiple students, including their registration number, name, and marks in three subjects. The program then calculates the total marks and percentage for each student and displays a formatted report of the results. This helps in organizing and presenting student performance data effectively.
Code Breakdown
Algorithm
- Start
- Initialize Data Structures:
- Define a structure
student
with fields for registration number, name, and marks in three subjects. - Create an array
s
of typestudent
to store data for multiple students.
- Define a structure
- Input Number of Students:
- Read the number of students
n
.
- Read the number of students
- Input Student Details:
- For each student (from 1 to
n
):- Prompt and read the student's registration number.
- Prompt and read the student's name.
- Prompt and read the marks in three subjects.
- For each student (from 1 to
- Calculate and Display Results:
- Print the header for the report card.
- For each student:
- Calculate the total marks as the sum of marks in three subjects.
- Calculate the percentage as the average of the total marks.
- Print the student's registration number, name, marks, total, and percentage in a formatted table.
- End
Code Explanation
Example Flowchart
Start
|
V
Initialize `s[10]` (array of `student` structures)
|
V
Read number of students `n`
|
V
For each student (i from 0 to n-1):
|
|--- Read `regno` (Registration number)
| |
| V
| Read `name` (Name)
| |
| V
| Read marks `m1`, `m2`, and `m3` (Marks in 3 subjects)
| |
| V
|
V
Print header for report card
|
V
For each student (i from 0 to n-1):
|
|--- Calculate total `t = m1 + m2 + m3`
| |
| V
| Calculate percentage `p = t / 3.0`
| |
| V
| Print `regno`, `name`, `m1`, `m2`, `m3`, `t`, and `p`
|
V
End