-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCell.java
64 lines (58 loc) · 1.32 KB
/
Cell.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
/**
* Cell.java
* A class for a cell object characterized by molecular concentrations.
*
* Last modified: 2024-12-12
* @author Antoine A. Ruzette
*
* Introduction to Computer Science using Java II, Fall 2024, Harvard Extension School
*/
/**
* The Cell class represents a cell with two chemical concentrations, A and B.
*
* @param A the concentration of molecule A
* @param B the concentration of molecule B
*/
public class Cell {
private double A;
private double B;
/**
* Constructor for a cell with default concentrations of 1.0 for A and 0.0 for B.
*/
public Cell() {
this.A = 1.0;
this.B = 0.0;
}
/**
* Returns the concentration of molecule A.
*
* @return the concentration of molecule A
*/
public double getA() {
return A;
}
/**
* Sets the concentration of molecule A.
*
* @param a the concentration of molecule A
*/
public void setA(double a) {
A = a;
}
/**
* Returns the concentration of molecule B.
*
* @return the concentration of molecule B
*/
public double getB() {
return B;
}
/**
* Sets the concentration of molecule B.
*
* @param b the concentration of molecule B
*/
public void setB(double b) {
B = b;
}
}