Function Design for Flashcard Programs

Function Design for Flashcard Programs

9th - 12th Grade

6 Qs

quiz-placeholder

Similar activities

Solids

Solids

11th Grade

11 Qs

Coordinate Geometry

Coordinate Geometry

10th Grade

10 Qs

6.1-6.2 Quiz B

6.1-6.2 Quiz B

10th - 12th Grade

10 Qs

THREE DIMENSIONAL GEOMETRY

THREE DIMENSIONAL GEOMETRY

11th Grade

10 Qs

Rational Function

Rational Function

11th Grade

10 Qs

Definite Integral Quiz

Definite Integral Quiz

12th Grade

10 Qs

EDITED Upp 5 Maths Test 2

EDITED Upp 5 Maths Test 2

9th - 12th Grade

11 Qs

General Maths Week 2 Quiz Consumer Arithmetic 1b

General Maths Week 2 Quiz Consumer Arithmetic 1b

11th - 12th Grade

10 Qs

Function Design for Flashcard Programs

Function Design for Flashcard Programs

Assessment

Quiz

Mathematics

9th - 12th Grade

Practice Problem

Medium

CCSS
RI.9-10.4, RI.11-12.4, RI.7.4

+1

Standards-aligned

Created by

Jeremy Harkin

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

6 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

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