Skip to content

Instantly share code, notes, and snippets.

@codecademydev

codecademydev/main.js Secret

Created Apr 3, 2020
Embed
What would you like to do?
Codecademy export
// Write your function here:
let finalGrade = (num1, num2, num3)=>{
if (num1 < 0 || num2 < 0 || num3 < 0 || num1 > 100 || num2 > 100 || num3 > 100 ){
return 'You have entered an invalid grade.'
}
let average = ((num1 + num2 + num3))/3;
finalGrade() === average()
if (average>=0 & average<=59){
return 'F'
} else if (average >=60 & average<=69){
return "D"
} else if (average >=70 & average <=79){
return "C"
} else if (average >=80 & average <=89){
return "B"
}else if(average >=90 & average <=100){
return "A"
} else {return "Invalid Code, check the programm"}
};
// Uncomment the line below when you're ready to try out your function
console.log(finalGrade(99, 92, 95)) // Should print 'A'
// We encourage you to add more function calls of your own to test your code!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.