Grade Report Generator

Turn numeric scores into grade report objects.

Start building, submit solution and get feedback from the community.
2Submit Solution
5 upvotes10 upvotes

Grade Report Generator

Turn a numeric score into a grade report. The report should include the letter grade, whether the student passed, and a short feedback message.

Write these functions:

  • getLetterGrade(score) should return "A", "B", "C", "D", or "F" based on the score.

  • hasPassed(score) should return true when the score is 60 or higher.

  • getFeedback(grade) should return a short message for the grade.

  • createGradeReport(name, score) should return one object with name, score, grade, passed, and feedback.

Sample checks:

js
console.log(createGradeReport('Ava', 92));console.log(createGradeReport('Noah', 48));console.log(createGradeReport('Mina', 75));console.log(createGradeReport('Sam', 60));

Expected output:

txt
{ name: "Ava", score: 92, grade: "A", passed: true, feedback: "Excellent work" }{ name: "Noah", score: 48, grade: "F", passed: false, feedback: "Keep practicing" }{ name: "Mina", score: 75, grade: "C", passed: true, feedback: "You passed" }{ name: "Sam", score: 60, grade: "D", passed: true, feedback: "You passed" }

Use the grade from getLetterGrade when choosing the feedback.

Join the Community

roadmap.sh is the most starred project on GitHub and is visited by hundreds of thousands of developers every month.

Rank  out of 28M!

361K

GitHub Stars

Star us on GitHub
Help us reach #1

+90k every month

+2.1M

Registered Users

Register yourself
Commit to your growth

+2k every month

49K

Discord Members

Join on Discord
Join the community

Roadmaps Best Practices Guides Videos FAQs YouTube

roadmap.sh by @kamrify

Community created roadmaps, best practices, projects, articles, resources and journeys to help you choose your path and grow in your career.

ThewNewStack

The top DevOps resource for Kubernetes, cloud-native computing, and large-scale development and deployment.