Scenario-Based Questions
Question 1 (15 Marks)
A school wants to manage student attendance records for an academic term. The school stores
student names in a one-dimensional (1D) array Students[] and attendance records in a
two-dimensional (2D) array Attendance[]. Each row in Attendance[] corresponds to a student, and
each column represents the number of days they were present in each month.
Write a program that meets the following requirements:
- Allows the number of months in the term to be input and stored, with a maximum of 6 months.
- Validates the number of months entered.
- Allows the names of students to be input and stored.
- Allows the number of days attended for each month to be input and stored for each student.
- Ensures that the number of attended days does not exceed the maximum number of school days
in a month (assume 22 school days per month).
- Calculates and stores the total attendance for each student across all months.
- Determines the student(s) with the highest attendance.
- Outputs the name(s) of the student(s) with the highest attendance and their total attended days.
All inputs and outputs must contain suitable messages. You must use pseudocode or program code
and add comments to explain how your code works.
Question 2 (15 Marks)
A library wants to track book borrowings for a month. The library keeps book titles in a
one-dimensional (1D) array Books[] and records borrowing data in a two-dimensional (2D) array
Borrowings[]. Each row in Borrowings[] represents a book, and each column represents the number
of times the book was borrowed in a specific week.
Write a program that meets the following requirements:
- Allows the number of weeks to be input and stored, with a maximum of 4 weeks.
- Validates the number of weeks entered.
- Allows the book titles to be input and stored.
- Allows the number of borrowings for each week to be input and stored for each book.
- Ensures that no book is borrowed more than 50 times in a single week.
- Calculates and stores the total borrowings for each book across all weeks.
- Determines the most borrowed book(s).
- Outputs the title(s) of the most borrowed book(s) and their total borrowings.
All inputs and outputs must contain suitable messages. You must use pseudocode or program code
and add comments to explain how your code works.