I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
Now that the teacher has all of the information they need, they want to be able to message the student with the results.
Complete the studentMsg function with totalScores and studentScore for parameters. The function should return a string representing a message to the student.
If the student passed the course, the string should follow this format:
Example Code
Class average: average-goes-here. Your grade: grade-goes-here. You passed the course.
If the student failed the course, the string should follow this format:
Example Code
Class average: average-goes-here. Your grade: grade-goes-here. You failed the course.
Replace average-goes-here with the average of the total scores. Replace grade-goes-here with the student’s grade.
Tips
Use the getAverage function to get the class average.
Use the getGrade function to get the student’s grade.
Use string concatenation (+) to build the message.
Be careful with the punctuation and spaces in the message.
Still not getting it, I have removed the extra } and added space on ".Your but still not going through
here’s the error I’m getting
Your function call of studentMsg([92, 88, 12, 77, 57, 100, 67, 38, 97, 89], 37) should return the following message: "Class average: 71.7. Your grade: F. You failed the course." .
Edit: You need to add the correct quote marks and add a space before Your grade: string. Also the first latter of Class average string should be capitalized.
it shouldn’t matter though? (The space between a string and the concatenation operator would not cause a step to fail unless there’s a bug in the test)