vault backup: 2024-02-20 13:05:19
This commit is contained in:
30
Semester 2/Programming 2/Project/Part 2/Periodical.java
Normal file
30
Semester 2/Programming 2/Project/Part 2/Periodical.java
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
/**
|
||||
* 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 );
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user