0% found this document useful (0 votes)
14 views

15 marker-2d-second-0478

The document outlines a program for managing library accounts using two 2D arrays: LibraryAccounts[] for user credentials and BookDetails[] for borrowed book information. It specifies user restrictions such as borrowing limits and overdue book conditions, and includes functionality for verifying user credentials, displaying a menu, and executing actions related to borrowing and returning books. The program requires local variable declarations and comments explaining the code logic, without needing to initialize global arrays.

Uploaded by

Mamatha
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

15 marker-2d-second-0478

The document outlines a program for managing library accounts using two 2D arrays: LibraryAccounts[] for user credentials and BookDetails[] for borrowed book information. It specifies user restrictions such as borrowing limits and overdue book conditions, and includes functionality for verifying user credentials, displaying a menu, and executing actions related to borrowing and returning books. The program requires local variable declarations and comments explaining the code logic, without needing to initialize global arrays.

Uploaded by

Mamatha
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

A two-dimensional (2D) array LibraryAccounts[] stores library users’

names and passwords for accessing their accounts.


Another 2D array BookDetails[] contains three columns with the following
details for each book borrowed by a user:
 Column one stores the title of the book, for example, "The Great
Gatsby".
 Column two stores the due date of the borrowed book, for example,
"2025-02-15".
 Column three stores the status of the book as either "Returned" or
"Not Returned".
Each user can borrow multiple books, but no more than a defined
BorrowLimit. If the user has already reached the BorrowLimit, they cannot
borrow additional books until one or more are returned. Additionally, users
with overdue books cannot borrow new ones until all overdue books are
returned.
Each user has a unique Account ID, which corresponds to their stored data
in the arrays. For example, Account ID 5 would have its details stored in:
 LibraryAccounts[5,1] and LibraryAccounts[5,2] (name and
password)
 Multiple rows in BookDetails[][] where the first column matches
Account ID 5
The variable TotalUsers stores the total number of library users. The arrays
and TotalUsers have already been set up and initialized.
Write a program that does the following:
1. Verifies that the Account ID exists and that the entered username and
password match the stored credentials before any action is allowed.
2. Displays a menu with the following options:
1. View borrowed books
2. Borrow a new book
3. Return a book
4. Exit
3. Executes the selected action using separate procedures with the
Account ID as a parameter.
4. Ensures all inputs and outputs display appropriate messages, such as
indicating overdue books or when the BorrowLimit is reached.
Use pseudocode or programming code and include comments explaining
how your code works.
You only need to declare local variables and arrays used in the program.
You do not need to declare or initialize the global arrays LibraryAccounts[],
BookDetails[], or TotalUsers.

You might also like