-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPeriodical.java
More file actions
99 lines (89 loc) · 1.86 KB
/
Copy pathPeriodical.java
File metadata and controls
99 lines (89 loc) · 1.86 KB
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
91
92
93
94
95
96
97
98
99
/**
* Define properties of periodical
* @author Kelly Chen
* @version 0.1
* CSE 017 Project 1
* Date of creation: February 28, 2022
* Last Date Modified: March 1, 2022
*/
package Project1;
public class Periodical extends Titles {
//Data Members
protected int month;
protected int issueNumber;
/**
* Default constructor
*/
public Periodical()
{
super();
}
/**
* Constructor with given inputs
* @param c call number to set
* @param t title to set
* @param p publisher to set
* @param y year to set
* @param copies to set
* @param m month to set
* @param i issue number to set
*/
public Periodical(String c, String t, String p, int y, int copies, int m, int i)
{
super(c, t, p, y, copies);
month = m;
issueNumber = i;
}
//Getter Methods
/**
* Getter for data member month
* @return data member month
*/
public int getMonth()
{
return month;
}
/**
* Getter for data member issueNumber
* @return data for issue number
*/
public int getIssueNumber()
{
return issueNumber;
}
//Setter Methods
/**
* Setter for data member month
* @param m given month to set
*/
public void setMonth(int m)
{
month = m;
}
/**
* Setter for data member issueNumber
* @param i given issue number to set
*/
public void setIssueNumber(int i)
{
issueNumber = i;
}
/**
* Method to get the Periodical information
* @return formatted string containing the value of the data members
*/
@Override
public String toString()
{
return super.toString();
}
/**
* Method to get the Periodical information
* @return formatted string with each data member on its own line
*/
@Override
public String simpleString()
{
return super.simpleString() + "\nMonth: " + month + "\nIssue Number: " + issueNumber;
}
}