Solution 12 to 25
Solution 23

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

  1. Start
  2. Initialize Data Structures:
    • Define a structure student with fields for registration number, name, and marks in three subjects.
    • Create an array s of type student to store data for multiple students.
  3. Input Number of Students:
    • Read the number of students n.
  4. Input Student Details:
    • For each student (from 1 to n):
      1. Prompt and read the student's registration number.
      2. Prompt and read the student's name.
      3. Prompt and read the marks in three subjects.
  5. Calculate and Display Results:
    • Print the header for the report card.
    • For each student:
      1. Calculate the total marks as the sum of marks in three subjects.
      2. Calculate the percentage as the average of the total marks.
      3. Print the student's registration number, name, marks, total, and percentage in a formatted table.
  6. 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