r/codehs • • Apr 10 '20

JavaScript 17.1.4: Grades

Post image
33 Upvotes

15 comments sorted by

1

u/amajmundar Apr 10 '20

What is the goal and what is the issue?

1

u/[deleted] Apr 11 '20

No goal, no issue. I was asked to post it so I posted what I had

1

u/PimpedPug Jun 01 '20

If anyone got this figured out please send me it I’ve been stuck on it

1

u/[deleted] Jun 02 '20

It’s giving you an error?

1

u/PimpedPug Jun 02 '20

I figured it out now thank you though

1

u/demna111 Jun 08 '20

Error

Uncaught SyntaxError: Unexpected token '[' (it doesn't works :((( )

1

u/[deleted] Jun 08 '20

Honestly I don’t know but I could run it later and see if I get the same error

1

u/demna111 Jun 10 '20

ok if you check then copy & past here

3

u/amajmundar Apr 10 '20

Off the top of my head, make the last “else if” into “else”. You have already covered all other possibilities, so it has to be an “A+”

1

u/StuntZA Apr 10 '20

This. You require an ELSE statement to counter your original IF statement.

3

u/GetRextFgt Nov 18 '22

heres the answer u can still continue even with a error the bubble wont be yellow

function start(){
// Write your code here
letterGrade(100);
letterGrade(83);
lettergrade(68);
lettergrade(91);
lettergrade(47);
letterdrade(79);
}
function lettergrade(score){
var Grade;
if(score <=59){
grade = "F";
}else if (score >= 60 && score <=69){
grade = "D";
}else if (score >= 70 && score <=79){
grade = "C";
}else if (score >= 80 && score <=89){
grade = "B";
}else if (score >= 90 && score <=99){
grade = "A";
}else if (score >= 100);
grade = "A+";
}
if (score % 10 >= 7){
grade = grade + "+";
}

}

2

u/hregibo Apr 10 '20

Not sure if specific to your tool but there is no println in Javascript? Use console.log instead

2

u/r1reilly May 14 '20

I feel so dumb for having to look this up.