Write a Java or C++ program that will display the given menu: A Simple Library System 1. Add a Student 2. Add a Book 3. Display All Students 4. Display All Books 5. Search a Student 6. Search a Book 7. Borrow a Book 8. Display Borrowed Books 9. Return a Book (optional) 10. Exit ➢ When 1 is chosen, ask the user to enter the student’s information(5-digit ID number, surname, first name, age, and sex) ➢ When 2 is chosen, ask the user to enter the book’s information(5-digit book number, Title, Author’s name(Surname, first name), date of purchase, and status (available/not available)) ➢ When 3 is chosen, display list of all students(5-digit ID number, surname, first name, age, and sex) ➢ When 4 is chosen, display list of all books(5-digit book number, Title, Author’s name(Surname, first name), date of purchase, and status (available/not available) ➢ When 5 is chosen, ask the user if he wants to search the list by Surname or ID number. If record is found, display the corresponding record, else display an appropriate prompt. ➢ When 6 is chosen, ask the user if he wants to search the list by Title, Author or Book number. If record is found, display the corresponding record, else display an appropriate prompt. ➢ When 7 is chosen is chosen, display the list of all available books, then ask the user the ID number of the student who wants to borrow a book, the book that he wants to borrow, and the current date. ➢ When 8 is chosen, display the list of borrowed books (display Book Number, Title, borrower’s name(Surname, first name), and date Borrowed) ➢ When 9 is chosen, ask the user the book number and the student ID number then update the corresponding record (you will get an additional 10 points(maximum) if you include this in your program) ➢ When 10 is chosen , end the program Other Requirements/limitations ➢ The data(student and book records must be stored in a file for permanent storage (use Java file handling) ➢ Include exception handling (data validation) ➢ Use of Java Swing is not allowed(GUI is not required) Submission Requirements ➢ Algorithm ➢ *.java, *.class, executable files and data/text files(containing the initial records)
Write a Java or C++ program that will display the given menu:
A Simple Library System
1. Add a Student
2. Add a Book
3. Display All Students
4. Display All Books
5. Search a Student
6. Search a Book
7. Borrow a Book
8. Display Borrowed Books
9. Return a Book (optional)
10. Exit
➢ When 1 is chosen, ask the user to enter the student’s information(5-digit ID number,
surname, first name, age, and sex)
➢ When 2 is chosen, ask the user to enter the book’s information(5-digit book number,
Title, Author’s name(Surname, first name), date of purchase, and status (available/not
available))
➢ When 3 is chosen, display list of all students(5-digit ID number, surname, first name,
age, and sex)
➢ When 4 is chosen, display list of all books(5-digit book number, Title, Author’s
name(Surname, first name), date of purchase, and status (available/not available)
➢ When 5 is chosen, ask the user if he wants to search the list by Surname or ID
number. If record is found, display the corresponding record, else display an
appropriate prompt.
➢ When 6 is chosen, ask the user if he wants to search the list by Title, Author or Book
number. If record is found, display the corresponding record, else display an
appropriate prompt.
➢ When 7 is chosen is chosen, display the list of all available books, then ask the user
the ID number of the student who wants to borrow a book, the book that he wants to
borrow, and the current date.
➢ When 8 is chosen, display the list of borrowed books (display Book Number, Title,
borrower’s name(Surname, first name), and date Borrowed)
➢ When 9 is chosen, ask the user the book number and the student ID number then
update the corresponding record (you will get an additional 10 points(maximum) if
you include this in your program)
➢ When 10 is chosen , end the program
Other Requirements/limitations
➢ The data(student and book records must be stored in a file for permanent storage
(use Java file handling)
➢ Include exception handling (data validation)
➢ Use of Java Swing is not allowed(GUI is not required)
Submission Requirements
➢
➢ *.java, *.class, executable files and data/text files(containing the initial records)

Trending now
This is a popular solution!
Step by step
Solved in 4 steps









