This repository has been archived by the owner on Nov 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Workwear.java
90 lines (77 loc) · 2.04 KB
/
Workwear.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import java.util.*;
/**
* Subclass for the Accessory class.
*
* @author George Broadley
* @version 1.0.0
*/
public class Workwear extends Accessory
{
// instance variables
private String manufacturingStandard;
private String colour;
private String size;
/**
* Constructor for the Perishable class
*
* @param toolName
* @param itemCode
* @param position
* @param cost
* @param manufacturingStandard
* @param colour
* @param size
*/
public Workwear(String itemName, String itemCode, String position, int cost, String manufacturingStandard, String colour, String size)
{
super(itemName, itemCode, position, cost);
this.manufacturingStandard = manufacturingStandard;
this.colour = colour;
this.size = size;
}
public Workwear() {}
/**
* Prints details of this tool.
*/
public void printDetails()
{
super.printDetails();
System.out.printf("%-25s: %s\n", "Manufacturing Standard", manufacturingStandard);
System.out.printf("%-25s: %s\n", "Colour", colour);
System.out.printf("%-25s: %s\n", "Size", size);
}
public void extractData(Scanner fieldScanner)
{
manufacturingStandard = fieldScanner.next();
colour = fieldScanner.next();
size = fieldScanner.next();
super.extractData(fieldScanner);
}
/**
* Getters and Setters below
*/
public String getManufacturingStandard()
{
return manufacturingStandard;
}
public String getColour()
{
return colour;
}
public String getSize()
{
return size;
}
public void setManufacturingStandard(String manufacturingStandard)
{
this.manufacturingStandard = manufacturingStandard;
}
public void setColour(String colour)
{
this.colour = colour;
}
public void setSize(String size)
{
this.size = size;
}
}