vault backup: 2024-03-05 16:01:50

This commit is contained in:
2024-03-05 16:01:50 +00:00
parent 8ce640b4ba
commit 28ea6a0a9b
36 changed files with 314 additions and 89 deletions

View File

@@ -1,9 +1,9 @@
/**
* Write a description of class DVD here.
* Subclass of AudioVisual to create objects of DVD items.
*
* @author (your name)
* @version (a version number or a date)
* @George Wilkinson
* @1.0
*/
import java.util.Scanner;
@@ -11,26 +11,40 @@ import java.util.Scanner;
public class DVD extends AudioVisual
{
private String director;
/**
* Constructor for objects of class DVD
* Since all field variables initialise as null, nothing should happen here.
*/
public DVD(){}
/*
* Return value of @director.
*/
public String getDirector()
{
return director;
}
/*
* Set value of @director.
*/
public void setDirector( String director )
{
this.director = director;
}
/*
* Print relevant details of the current object.
*/
public void printDetails() {
System.out.println( "Director: " + director );
super.printDetails();
}
/*
* Passed a scanner object, give the relevant variable a value.
*/
public void readItemData( Scanner detailScanner ){
if ( detailScanner != null ) {
this.director = detailScanner.next().trim();