Skip to content

Commit f806955

Browse files
committed
studio done
1 parent 22df656 commit f806955

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

classes/studio/ClassStudio.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,36 @@
11
//Declare a class called CrewCandidate with a constructor that takes three parameters—name, mass, and scores. Note that scores will be an array of test results.
2+
class CrewCandidate {
3+
constructor(name, mass ,scores ){
4+
this.name = name;
5+
this.mass = mass;
6+
this.scores = scores;
7+
}
8+
addScore(score){
9+
this.scores.push(score)
10+
}
11+
average(){
12+
for (i=0; i<this.scores.length; i++){
13+
let sum = sum + this.scores
14+
average = sum / this.scores.length
15+
return Math.round(average*10)/10
16+
}
17+
}
18+
status(average){
19+
20+
}
221

22+
}
323

424

25+
26+
let bubbaBear = new CrewCandidate("Bubba Bear", 135, [88, 85, 90])
27+
let merryMaltese = new CrewCandidate("Merry Maltese", 1.5, [93, 88, 97])
28+
let gladGator = new CrewCandidate('Glad Gator', 225, [75 , 78, 62])
29+
530
//Add methods for adding scores, averaging scores and determining candidate status as described in the studio activity.
631

732

833

9-
//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%.
34+
35+
//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%.
36+
console.log(bubbaBear)

0 commit comments

Comments
 (0)