Function Design for Flashcard Programs
Quiz
•
Mathematics
•
9th - 12th Grade
•
Practice Problem
•
Medium
+1
Standards-aligned
Jeremy Harkin
Used 2+ times
FREE Resource
Enhance your content in a minute
6 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the guess parameter in the function checkAnimal(guess)?
To store the correct answer so the program knows what to check
To receive the user’s input and compare it to the correct answer
To make the function run automatically
To output the correct animal
Tags
CCSS.RI.11-12.4
CCSS.RI.7.4
CCSS.RI.8.4
CCSS.RI.9-10.4
CCSS.RI.9-10.4
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Question: You're building a flash card program that checks if the user’s answer is correct.
You’ve already written one function to display a question.
Now you want to write another function to check if the answer is correct.
Which of the following would be the most flexible way to design that second function?
Hardcode the correct answer inside the function, like correctAnswer = 12, so it only checks one problem.
Use global variables for everything so you don’t need to pass any values into the function.
Put all the code into one function so you don’t have to reuse anything.
Use a parameter so the function can check different answers depending on the question.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why should your answer-checking function take at least one parameter?
Because parameters make the program run faster
To avoid using variables in your program
So it can check answers for different questions, not just one
So you can hardcode the answer for every question
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You want to randomly generate a flashcard question like “5 + 7”. Where should that logic go?
Inside the same function that checks the answer
In a separate function that only creates the problem
In the global variables
It doesn't matter—it should be hardcoded
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You write a function that checks if userAnswer == correctAnswer. What kind of value should that function return?
A string that says "Correct!" or "Wrong!"
A random number
A boolean value: true or false
It shouldn't return anything
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In your flashcard program, you want to check if the user’s answer is correct. What is the best reason to use a parameter in your answer-checking function?
So you don’t have to call the function from another function
So the function always checks for the same answer every time
So you can use the same function to check different answers for different questions
So you can avoid using if statements
Similar Resources on Wayground
10 questions
Quiz 3 - Sampling & Sampling Distribution
Quiz
•
11th Grade
10 questions
Maths Grade 11-Recap
Quiz
•
9th - 11th Grade
10 questions
9.6_Linear Transformation of data
Quiz
•
9th - 10th Grade
10 questions
The Brain Quiz - Demo(Practice) Round (Carries No Value)
Quiz
•
1st - 12th Grade
10 questions
Identify the Equation
Quiz
•
9th Grade
10 questions
Formative Assessment 1 [Arithmetic Sequence]
Quiz
•
10th Grade
10 questions
TFA-4.1b Nilai Fungsi
Quiz
•
11th Grade
10 questions
SOH CAH TOA
Quiz
•
9th - 10th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Mathematics
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
33 questions
Algebra 1 Semester 1 Final 2025
Quiz
•
8th - 10th Grade
10 questions
Exploring Global Holiday Traditions
Interactive video
•
6th - 10th Grade
10 questions
Guess the Christmas Movie by the Scene Challenge
Interactive video
•
6th - 10th Grade
10 questions
Guess the Christmas Songs Challenge
Interactive video
•
6th - 10th Grade
20 questions
Function or Not a Function
Quiz
•
8th - 9th Grade
10 questions
Test Your Christmas Trivia Skills
Interactive video
•
6th - 10th Grade
15 questions
Holiday Trivia!
Quiz
•
9th Grade
