Question: You are required to write a Kotlin program using procedural programming principles ( i . e . , without using any classes or objects )

You are required to write a Kotlin program using procedural programming principles (i.e., without
using any classes or objects) to simulate the management of a library system. The library system
should keep track of books and students. Each student can borrow up to 3 books at a time. The
program should do the following:
1. Book Management:
o Define a structure to represent a book with the following attributes: title, author, and
status (available or borrowed).
o Allow adding new books to the library collection.
2. Student Management:
o Define a structure to represent a student with attributes: name, student ID, and the
list of books they have borrowed.
o Allow adding new students to the system.
3. Borrowing and Returning Books:
o Allow a student to borrow a book if its available and if they havent borrowed more
than 3 books.
o Update the books status when borrowed or returned.
o Prevent the student from borrowing the same book twice or borrowing more than 3
books.
4. Display Data:
o Implement a procedure to display the list of books and their availability.
o Implement a procedure to display which students have borrowed books and how
many.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!