vault backup: 2024-02-20 13:05:19

This commit is contained in:
2024-02-20 13:05:19 +00:00
parent 7f6d033cc4
commit 0134f066d6
45 changed files with 1429 additions and 76 deletions

View File

@@ -0,0 +1,47 @@
/**
* Write a description of class Book here.
*
* @author (your name)
* @version (a version number or a date)
*/
import java.util.Scanner;
import java.util.ArrayList;
import java.util.NoSuchElementException;
public class Book extends LibraryItem
{
private String title;
private String itemCode;
private int cost;
private int timesBorrowed;
private boolean onLoan;
private String author;
private int isbn;
/**
* Constructor for objects of class Book
*/
public Book()
{
this.title = "";
this.itemCode = "";
this.cost = 0;
this.timesBorrowed = 0;
this.author = "";
this.isbn = 0;
}
public void readItemData( Scanner detailScanner ){
if ( detailScanner != null ) {
this.title = detailScanner.next().trim();
this.itemCode = detailScanner.next().trim();
this.cost = Integer.parseInt( detailScanner.next() );
this.timesBorrowed = Integer.parseInt( detailScanner.next() );
this.onLoan = Boolean.parseBoolean( detailScanner.next() );
this.author = detailScanner.next().trim();
this.isbn = Integer.parseInt( detailScanner.next() );
}
}
}