Question: In Java: Task 1 I. To compile an ILibraryBook interface for library service maintenance: Methods: o The book is borrowed by the reader argument: void
In Java:
Task 1
I. To compile an ILibraryBook interface for library service maintenance:
Methods:
o The book is borrowed by the reader argument: void get (Reader rdr);
o Book returns: void ret ();
II. To compile an IReader interface for reader service: The reader borrows (ret) the book (argument)
III. To compile a class Applicant hidden articles:
1. Hidden (Protected) members name, date of admission to university, success:
Name: String
date of birth:
success: double
Constructor:
o public Applicant (Date of birth, String name, double success)
Methods: get / set toString
IV. To compile a Student class, successor to the Applicant implementing Comparable hidden articles:
faculty number: String
Constructors:
o public Student (String name, String f_nom)
o public Student (Date date, String name, double success, String f_nom) {
Methods:
o get / set toString equals
V. To compile a Reader class, a successor to Student, implementing the IReader interface, Comparable:
1. Private members: LibraryBook
Collection of books
2. Explicit constructors:
public Reader (String nm, String fn)
public Reader (Date date, String name, double success, String f_nom)
3. Methods of reading / writing equivalence and string interpretation:
get / set, toString (), equals ()
VI. Create a LibraryBook class that implements ILibraryBook, Comparable:
public class LibraryBook implements ILibraryBook, Comparable
2. Private members:
Reader: Reader
Book name: String
Status: boolean
3. Explicit constructors
public LibraryBook (String bn)
public LibraryBook (String bn, boolean st)
4. Reading / writing, comparison and string interpretation methods:
VII. To compile a Main class with main function:
1. Creates a List of objects from VI
2. Simulates borrowing1 from a library, Displays;
3. Simulates borrowing2 from a library, Displays;
4. Sorts, displays
5. Checks for equivalence, outputs
=====================================================================================
Task 2
I. Define classes for exceptions, null object and missing data for classes II
and III, IV. Apply them at your own discretion.
II. To compile a "Stock" class, packet access implementing Comparable
Private fields:
manufacturer
availability (count)
price
Constructors:
II.1 Implicit Explicit:
II.2. By manufacturer and availability;
II.3. Manufacturer.
Methods:
II. 4 Read and rewrite fields
II.5 Implementing the interface (optional)
II.6. Equivalence comparison
II.7 For string interpretation
III. Create an "InternalComponent" class that implements Stock.
Private fields:
frequency
Constructor:
III.1 Explicit
Methods:
III.2. String implementation
IV. To compile an "ExternalComponent" class inherits Stock.
Private fields:
inches
Constructor:
IV.1 Explicit
Methods:
IV.2. String implementation
V. To compile a class "Shop"
Private fields:
List of products, type Set, of objects of class I.
Constructor:
V.1 Default:
V.2. String implementation
V.3. Method of adding a new class I or class II product
V.4. Finding the manufacturer with the most products returns the name (s) of
manufacturer (s)
V.5. Finding the item with the best frequency returns the frequency
VI. Main function
VI.1 Creates a Class V object
VI.2 Finding the manufacturer with the most products
VI.3 Finding the item with the best frequency
VI.4 Handling exceptions
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
