Professional Documents
Culture Documents
Book
- ID: String
- name: String
- year: int
- authors: String
+ Book()
+ getID(): String
+ getName(): String
+ getYear(): int
Extends + getAuthors(): String
+ input(): void
EBook + output(): void
- URL: String
- size: int
+ EBook()
1. Class Book
Fields
Contructor: set ID = “”, name = “”, year = 0, authors = “”
get…(): return value of field
set…(...): set value of field = …
input(): allow user input value of all fields
output(): show all field values
2. Class EBook
extends Book
Fields
Contructor: call super contructor, set URL = “”, size = 0
get…(): return value of field
set…(…): set value of field = …
input(): allow user input value of all fields
output(): show all field values
3. Class Application
Write a ebook management program with the following functions:
Create menu for this program as below:
----- EBOOK MANAGEMENT -----
1. Adds new ebook.
2. Shows all ebooks.
3. The biggest size ebook.
4. Quit.
Please select a function:
When user select the first function, the application will receive ebook information and
append this ebook into a list.
----- Add new ebook -----
Input ID: 01
Input name: HTML
Input year: 2022
Input authors: Peter, John
Input URL: www.google.com
Input size (kilobyte): 100
Ebook created and added to list of ebooks successful!
----- EBOOK MANAGEMENT -----
1. Adds new ebook.
2. Shows all ebooks.
3. The biggest size ebook.
4. Quit.
Please select a function:
When user select the second function, the list of ebooks will be shown
----- List of ebooks -----
-- ID -- Ebook name -- Year – Authors -- URL -- Size --
-- 01 -- HTML -- 2020 -- Peter, John -- htmltutorial.com – 100 --
-- 02 -- OOP -- 2019 –- Tom -- javapoint.com – 150 --
-- 03 -- SQL -- 2020 -- Alice --wschools.com – 100 --
----- EBOOK MANAGEMENT -----
1. Adds new ebook.
2. Shows all ebooks.
3. The biggest size ebook.
4. Quit.
Please select a function:
When user select the third function, the list ebook have biggest size
----- List of the biggest size ebooks -----
-- ID -- Ebook name -- Year – Authors -- URL -- Size --
-- 02 -- OOP -- 2019 –- Tom -- javapoint.com – 150 --
----- EBOOK MANAGEMENT -----
1. Adds new ebook.
2. Shows all ebooks.
3. The biggest size ebook.
4. Quit.
Please select a function:
When user select the last function, the application will be stopped and shown some
message as below:
THANK FOR USING MY APPLICATION!
SEE YOU AGAIN!
When user selected invalid function, the application will be shown the warning
message
The function of application must be from 1 to 3!
BUILD SUCCESSFUL