Challenge: Defining a Compound Function
Task
Swipe to start coding
You are given a function called getGrade(score) that calculates a student's grade based on their score.
Now you need to create another function that uses this information to display complete student details.
Your tasks:
- Define a function called
showStudentDatawith the following parameters:name,age,score. - Inside the function:
- Use the
getGradefunction by passingscoreas an argument. - Combine the student's name, age, and grade into a single message.
- Use the
- The final message should follow this format:
Name: Alice, Age: 22, Grade: A
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 4. ChapterΒ 8
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 1.35
Challenge: Defining a Compound Function
Swipe to show menu
Task
Swipe to start coding
You are given a function called getGrade(score) that calculates a student's grade based on their score.
Now you need to create another function that uses this information to display complete student details.
Your tasks:
- Define a function called
showStudentDatawith the following parameters:name,age,score. - Inside the function:
- Use the
getGradefunction by passingscoreas an argument. - Combine the student's name, age, and grade into a single message.
- Use the
- The final message should follow this format:
Name: Alice, Age: 22, Grade: A
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 4. ChapterΒ 8
single