-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCell.java
More file actions
41 lines (37 loc) · 866 Bytes
/
Copy pathCell.java
File metadata and controls
41 lines (37 loc) · 866 Bytes
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
/* Name: Aida M. Akuyeva
* Pennkey: aakuyeva
* Recitation: 201
*
* Execution: java TwentyFourtyEight
*
* This program creates a cell object with a certain number
*
*/
public class Cell {
private int number;
//constructor
public Cell(int number) {
this.number = number;
}
/*
* Description: this function returns the cell's number
* Output: int number
*/
public int getNumber() {
return number;
}
/*
* Description: this function sets cell's number to a new inputted value
* Input: int num
*/
public void setNumber(int num) {
number = num;
}
/*
* Description: this function checks whether the cell is empty
* Output: boolean true/false based on condition
*/
public boolean isEmpty() {
return number == 0;
}
}