Challenge: Improving the Grade Categorizer
Swipe to start coding
In one of the tasks in the previous section, you wrote a program which calculated the grades of the students based on their score.
Imagine we would like to calculate the grades of many different students. For that, it would be more convenient to convert this code into a function, therefore, in this task the goal is to convert the given code into a function.
- Define a function called
getGradewith a parameter calledgrade. - Put the given code inside the
getGradefunction. - Finally, call the function four times with the following values respectively:
30,50,70,97.
Løsning
Tak for dine kommentarer!
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Fantastisk!
Completion rate forbedret til 1.33
Challenge: Improving the Grade Categorizer
Stryg for at vise menuen
Swipe to start coding
In one of the tasks in the previous section, you wrote a program which calculated the grades of the students based on their score.
Imagine we would like to calculate the grades of many different students. For that, it would be more convenient to convert this code into a function, therefore, in this task the goal is to convert the given code into a function.
- Define a function called
getGradewith a parameter calledgrade. - Put the given code inside the
getGradefunction. - Finally, call the function four times with the following values respectively:
30,50,70,97.
Løsning
Tak for dine kommentarer!
single