Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q 3 . 4 : Assume you are asked to write a simple JAVA class Borrower representing a library user. Your program needs to manage
Q: Assume you are asked to write a simple JAVA class Borrower representing a library user. Your program needs to manage the books borrowed from the university library.
a Write a Java class to represent a Borrower. This class should contain instance variables to hold the following pieces of information. Be careful to choose the best types to hold this information.
Marks
The name of the Borrower both first name and last name
The index number of student library card.
The number of books that the student is currently borrowing.
The total number of books that have been borrowed by the student.
b Write a constructor for your class. Your constructor will receive parameter data for first name, last name and library index number which you can assume is in the form of a digit string You may assume that books borrowed from library are zeros.
Marks
c Write a new class called Borrowers, which contains a single instance variable an array of all the students in the class. In its constructor, please use the array with instances of your Borrower class to hold information on the following students:
Marks
tableFirst Name,Last Name,Card numberSidongWang,MiaoLiTianZhang,
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started