We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35afdda commit 4c73ff0Copy full SHA for 4c73ff0
Gas.js
@@ -0,0 +1,33 @@
1
+class Gas {
2
+ constructor(name, amount) {
3
+ this.name = name;
4
+ this.amount = amount;
5
+
6
+ switch(name) {
7
+ case "H2":
8
+ this.boilingPoint = 1;
9
+ break;
10
+ case "He":
11
+ this.boilingPoint = 0.8;
12
13
+ }
14
15
16
+ getAmount() {
17
+ return this.amount;
18
19
+ getName() {
20
+ return this.name;
21
22
23
+ setAmount(x) {
24
+ this.amount = x;
25
26
+ setName(x) {
27
+ this.name = x;
28
29
30
+ formatGas() {
31
+ return "You have " + this.amount + " " + this.name + " molecules.";
32
33
+}
0 commit comments