Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

e ) Complete the method borrowBook ( in b:book ) :Boolean , this method add the received book to the user borrow book list. public

e) Complete the method borrowBook(in b:book):Boolean , this method add the received book to the user borrow book list.
public boolean borrowBook(book b){
line 1
line 2
line 3
line 4
}
select the correct code for line 1 :
a.if (nbr == borrowedBooks.length)
b.if (nbr < borrowedBooks.length)
c.if (nbr <=3)
d.for ( int i =0 ; i <3 ; i++)
e) Complete the method borrowBook(in b:book):boolean , this method add the received book to the user borrow book list.
public boolean borrowBook(book b){
line 1
line 2
line 3
line 4
}
select the correct code for line 2 :
a.borrowedBooks[nbr++]=new Book(b);
b.borrowedBooks[nbr++]=b;
c.borrowedBooks[i]=b;
d.borrowedBooks[nbr+1]=b;
e) Complete the method borrowBook(in b:book):boolean , this method add the received book to the user borrow book list.
public boolean borrowBook(book b){
line 1
line 2
line 3
line 4
}
select the correct code for line 3 :
a.return nbr!=3;
b.return false;
c.return nbr< borrowedBooks.length;
d.return true;
e) Complete the method borrowBook(in b:book):boolean , this method add the received book to the user borrow book list.
public boolean borrowBook(book b){
line 1
line 2
line 3
line 4
}
select the correct code for line 4 :
a.return nbr< borrowedBooks.length;
b.return true;
c.return false;
d.return nbr!=3;

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions