Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!