Files
G4G0-1/Semester 2/Programming 2/Project/Part 2/Periodical.java

31 lines
1.1 KiB
Java

/**
* Write a description of class Periodical here.
*
* @author (your name)
* @version (a version number or a date)
*/
import java.util.Scanner;
public class Periodical extends LibraryItem
{
private String publicationDate;
public Periodical(){}
public void printDetails() {
System.out.println("\n==================\n( " + getItemCode() + " )" + " Publication Date: " + publicationDate + " Periodical " + getTitle() + ", published by " + getPublisher() + " has " + getNoOfPages() + " pages .\nIt has been borrowed " + getTimesBorrowed() + " times.");
if( getOnLoan() )
System.out.println( "The Periodical is currently on loan, and costs " + getCost() + " pence. ");
else
System.out.println( "The Periodical is currently not on loan, and costs " + getCost() + " pence. ");
}
public void readItemData( Scanner detailScanner ){
if ( detailScanner != null ) {
this.publicationDate = detailScanner.next().trim();
super.readItemData( detailScanner );
}
}
}