vault backup: 2024-02-20 13:05:19
This commit is contained in:
BIN
Semester 2/Programming 2/Project/Part 1/Book.class
Normal file
BIN
Semester 2/Programming 2/Project/Part 1/Book.class
Normal file
Binary file not shown.
8
Semester 2/Programming 2/Project/Part 1/Book.ctxt
Normal file
8
Semester 2/Programming 2/Project/Part 1/Book.ctxt
Normal file
@@ -0,0 +1,8 @@
|
||||
#BlueJ class context
|
||||
comment0.params=
|
||||
comment0.target=Book()
|
||||
comment0.text=\n\ Constructor\ for\ objects\ of\ class\ Book\n
|
||||
comment1.params=y
|
||||
comment1.target=int\ sampleMethod(int)
|
||||
comment1.text=\n\ An\ example\ of\ a\ method\ -\ replace\ this\ comment\ with\ your\ own\n\ \n\ @param\ \ y\ \ \ a\ sample\ parameter\ for\ a\ method\n\ @return\ \ \ \ \ the\ sum\ of\ x\ and\ y\ \n
|
||||
numComments=2
|
47
Semester 2/Programming 2/Project/Part 1/Book.java
Normal file
47
Semester 2/Programming 2/Project/Part 1/Book.java
Normal 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() );
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
@@ -1,35 +1,32 @@
|
||||
#BlueJ class context
|
||||
comment0.params=title\ itemCode\ cost\ timesBorrowed\ onLoan
|
||||
comment0.target=LibraryItem(java.lang.String,\ java.lang.String,\ int,\ int,\ boolean)
|
||||
comment0.text=\n\ Constructor\ for\ objects\ of\ class\ LibraryItem\n
|
||||
comment0.params=
|
||||
comment0.target=LibraryItem()
|
||||
comment0.text=\n\ Default\ constructor\ for\ object\ of\ class\ LibraryItem\n
|
||||
comment1.params=
|
||||
comment1.target=LibraryItem()
|
||||
comment1.text=\n\ Default\ constructor\ for\ object\ of\ class\ LibraryItem\n
|
||||
comment10.params=timesBorrowed
|
||||
comment10.target=void\ setTimesBorrowed(int)
|
||||
comment11.params=onLoan
|
||||
comment11.target=void\ setOnLoan(boolean)
|
||||
comment12.params=
|
||||
comment12.target=void\ printDetails()
|
||||
comment12.text=\n\ Field\ Mutator\ End\n
|
||||
comment13.params=detailScanner
|
||||
comment13.target=void\ readData(java.util.Scanner)
|
||||
comment1.target=java.lang.String\ getTitle()
|
||||
comment1.text=\n\ Field\ Accessor\ Start\n
|
||||
comment10.params=onLoan
|
||||
comment10.target=void\ setOnLoan(boolean)
|
||||
comment11.params=
|
||||
comment11.target=void\ printDetails()
|
||||
comment11.text=\n\ Field\ Mutator\ End\n
|
||||
comment12.params=detailScanner
|
||||
comment12.target=void\ readData(java.util.Scanner)
|
||||
comment2.params=
|
||||
comment2.target=java.lang.String\ getTitle()
|
||||
comment2.text=\n\ Field\ Accessor\ Start\n
|
||||
comment2.target=java.lang.String\ getItemCode()
|
||||
comment3.params=
|
||||
comment3.target=java.lang.String\ getItemCode()
|
||||
comment3.target=int\ getCost()
|
||||
comment4.params=
|
||||
comment4.target=int\ getCost()
|
||||
comment4.target=int\ getTimesBorrowed()
|
||||
comment5.params=
|
||||
comment5.target=int\ getTimesBorrowed()
|
||||
comment6.params=
|
||||
comment6.target=boolean\ getOnLoan()
|
||||
comment7.params=title
|
||||
comment7.target=void\ setTitle(java.lang.String)
|
||||
comment7.text=\n\ Field\ Accessor\ End\n\ \n\ Field\ Mutator\ Start\n
|
||||
comment8.params=itemCode
|
||||
comment8.target=void\ setItemCode(java.lang.String)
|
||||
comment9.params=cost
|
||||
comment9.target=void\ setCost(int)
|
||||
numComments=14
|
||||
comment5.target=boolean\ getOnLoan()
|
||||
comment6.params=title
|
||||
comment6.target=void\ setTitle(java.lang.String)
|
||||
comment6.text=\n\ Field\ Accessor\ End\n\ \n\ Field\ Mutator\ Start\n
|
||||
comment7.params=itemCode
|
||||
comment7.target=void\ setItemCode(java.lang.String)
|
||||
comment8.params=cost
|
||||
comment8.target=void\ setCost(int)
|
||||
comment9.params=timesBorrowed
|
||||
comment9.target=void\ setTimesBorrowed(int)
|
||||
numComments=13
|
||||
|
@@ -22,26 +22,19 @@ public class LibraryItem
|
||||
/**
|
||||
* Constructor for objects of class LibraryItem
|
||||
*/
|
||||
public LibraryItem( String title, String itemCode, int cost, int timesBorrowed, boolean onLoan)
|
||||
/*public LibraryItem( String title, String itemCode, int cost, int timesBorrowed, boolean onLoan)
|
||||
{
|
||||
this.title = title;
|
||||
this.itemCode = itemCode;
|
||||
this.cost = cost;
|
||||
this.timesBorrowed = timesBorrowed;
|
||||
this.onLoan = onLoan;
|
||||
}
|
||||
}*/
|
||||
|
||||
/*
|
||||
* Default constructor for object of class LibraryItem
|
||||
*/
|
||||
public LibraryItem()
|
||||
{
|
||||
title = "";
|
||||
itemCode = "";
|
||||
cost = 0;
|
||||
timesBorrowed = 0;
|
||||
onLoan = false;
|
||||
}
|
||||
public LibraryItem(){}
|
||||
|
||||
/*
|
||||
* Field Accessor Start
|
||||
|
BIN
Semester 2/Programming 2/Project/Part 1/Periodical.class
Normal file
BIN
Semester 2/Programming 2/Project/Part 1/Periodical.class
Normal file
Binary file not shown.
8
Semester 2/Programming 2/Project/Part 1/Periodical.ctxt
Normal file
8
Semester 2/Programming 2/Project/Part 1/Periodical.ctxt
Normal file
@@ -0,0 +1,8 @@
|
||||
#BlueJ class context
|
||||
comment0.params=
|
||||
comment0.target=Periodical()
|
||||
comment0.text=\n\ Constructor\ for\ objects\ of\ class\ Periodical\n
|
||||
comment1.params=y
|
||||
comment1.target=int\ sampleMethod(int)
|
||||
comment1.text=\n\ An\ example\ of\ a\ method\ -\ replace\ this\ comment\ with\ your\ own\n\ \n\ @param\ \ y\ \ \ a\ sample\ parameter\ for\ a\ method\n\ @return\ \ \ \ \ the\ sum\ of\ x\ and\ y\ \n
|
||||
numComments=2
|
33
Semester 2/Programming 2/Project/Part 1/Periodical.java
Normal file
33
Semester 2/Programming 2/Project/Part 1/Periodical.java
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
/**
|
||||
* Write a description of class Periodical here.
|
||||
*
|
||||
* @author (your name)
|
||||
* @version (a version number or a date)
|
||||
*/
|
||||
public class Periodical extends LibraryItem
|
||||
{
|
||||
// instance variables - replace the example below with your own
|
||||
private int x;
|
||||
|
||||
/**
|
||||
* Constructor for objects of class Periodical
|
||||
*/
|
||||
public Periodical()
|
||||
{
|
||||
// initialise instance variables
|
||||
x = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* An example of a method - replace this comment with your own
|
||||
*
|
||||
* @param y a sample parameter for a method
|
||||
* @return the sum of x and y
|
||||
*/
|
||||
public int sampleMethod(int y)
|
||||
{
|
||||
// put your code here
|
||||
return x + y;
|
||||
}
|
||||
}
|
@@ -9,12 +9,12 @@ package.editor.width=1774
|
||||
package.editor.x=0
|
||||
package.editor.y=31
|
||||
package.numDependencies=1
|
||||
package.numTargets=2
|
||||
package.numTargets=4
|
||||
package.showExtends=true
|
||||
package.showUses=true
|
||||
project.charset=UTF-8
|
||||
target1.editor.height=1049
|
||||
target1.editor.width=1591
|
||||
target1.editor.width=960
|
||||
target1.editor.x=0
|
||||
target1.editor.y=31
|
||||
target1.height=50
|
||||
@@ -24,18 +24,44 @@ target1.showInterface=false
|
||||
target1.type=ClassTarget
|
||||
target1.typeParameters=
|
||||
target1.width=100
|
||||
target1.x=70
|
||||
target1.y=10
|
||||
target2.editor.height=1049
|
||||
target2.editor.width=1920
|
||||
target2.editor.x=0
|
||||
target2.editor.y=31
|
||||
target1.x=250
|
||||
target1.y=110
|
||||
target2.editor.height=700
|
||||
target2.editor.width=900
|
||||
target2.editor.x=40
|
||||
target2.editor.y=51
|
||||
target2.height=50
|
||||
target2.name=Library
|
||||
target2.name=Periodical
|
||||
target2.naviview.expanded=true
|
||||
target2.showInterface=false
|
||||
target2.type=ClassTarget
|
||||
target2.typeParameters=
|
||||
target2.width=80
|
||||
target2.x=170
|
||||
target2.y=60
|
||||
target2.width=90
|
||||
target2.x=350
|
||||
target2.y=210
|
||||
target3.editor.height=1049
|
||||
target3.editor.width=960
|
||||
target3.editor.x=960
|
||||
target3.editor.y=31
|
||||
target3.height=50
|
||||
target3.name=Book
|
||||
target3.naviview.expanded=true
|
||||
target3.showInterface=false
|
||||
target3.type=ClassTarget
|
||||
target3.typeParameters=
|
||||
target3.width=80
|
||||
target3.x=170
|
||||
target3.y=210
|
||||
target4.editor.height=1049
|
||||
target4.editor.width=1920
|
||||
target4.editor.x=0
|
||||
target4.editor.y=31
|
||||
target4.height=50
|
||||
target4.name=Library
|
||||
target4.naviview.expanded=true
|
||||
target4.showInterface=false
|
||||
target4.type=ClassTarget
|
||||
target4.typeParameters=
|
||||
target4.width=80
|
||||
target4.x=170
|
||||
target4.y=60
|
||||
|
Reference in New Issue
Block a user