Skip to content

Commit 5e57861

Browse files
committed
Studio
1 parent caf0e79 commit 5e57861

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

classes/studio/ClassStudio.js

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,33 @@ class CrewCandidate {
88
}
99
}
1010

11-
// Create objects for the candidates
12-
const bubbaBear = new CrewCandidate("Bubba Bear", 135, [88, 85, 90]);
13-
const merryMaltese = new CrewCandidate("Merry Maltese", 1.5, [93, 88, 97]);
14-
const gladGator = new CrewCandidate("Glad Gator", 225, [75, 78, 62]);
11+
const bear = new CrewCandidate("Bubba Bear", 135, [88, 85, 90]);
12+
const maltese = new CrewCandidate("Merry Maltese", 1.5, [93, 88, 97]);
13+
const gator = new CrewCandidate("Glad Gator", 225, [75, 78, 62]);
1514

16-
// Use console.log to verify the objects
17-
console.log(bubbaBear);
18-
console.log(merryMaltese);
19-
console.log(gladGator);
15+
console.log(bear);
16+
console.log(maltese);
17+
console.log(gator);
2018

2119

2220

2321
//Add methods for adding scores, averaging scores and determining candidate status as described in the studio activity.
2422

25-
23+
class CrewCandidate {
24+
constructor(name, mass, scores) {
25+
this.name = name;
26+
this.mass = mass;
27+
this.scores = scores;
28+
}
29+
30+
addScore(newScore) {
31+
this.scores.push(newScore);
32+
}
33+
}
34+
35+
bear.addScore(83);
36+
37+
console.log("Bubba's Scores:", bear.scores);
38+
2639

2740
//Part 4 - Use the methods to boost Glad Gator’s status to Reserve or higher. How many tests will it take to reach Reserve status? How many to reach Accepted? Remember, scores cannot exceed 100%.

0 commit comments

Comments
 (0)