Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Improving the Grade Categorizer | Mastering Functions
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Introduction to JavaScript

bookChallenge: Improving the Grade Categorizer

Task

Swipe to start coding

In a previous task, you wrote a program that calculated a student's grade based on their score. Now imagine you need to calculate grades for many students. To make this reusable, you'll convert the logic into a function.

Your tasks:

  1. Define a function called getGrade with one parameter named grade.
  2. Move the given grading logic inside the function.
  3. Instead of printing the result, return the grade message.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 4. ChapterΒ 7
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

bookChallenge: Improving the Grade Categorizer

Swipe to show menu

Task

Swipe to start coding

In a previous task, you wrote a program that calculated a student's grade based on their score. Now imagine you need to calculate grades for many students. To make this reusable, you'll convert the logic into a function.

Your tasks:

  1. Define a function called getGrade with one parameter named grade.
  2. Move the given grading logic inside the function.
  3. Instead of printing the result, return the grade message.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 4. ChapterΒ 7
single

single

some-alt