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 ie 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 books at a time. The
program should do the following:
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.
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.
Borrowing and Returning Books:
o Allow a student to borrow a book if its available and if they havent borrowed more
than books.
o Update the books status when borrowed or returned.
o Prevent the student from borrowing the same book twice or borrowing more than
books.
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
