
CODE M4 Review Quiz PART 2
Quiz by Katrina Knoedl
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
What is the value of x after this line of code executes?
int x = 1 + 10 / 5 * 2 + 14;
What is the value of x after this line of code executes?
int x = 25 % 2;
What is the value of x after this line of code executes?
int x = 26 + 44;
What is the value of x after this line of code executes?
int x = 6 * 8;
In the code below, what text is printed on screen?
var myString = "Hi! My name is Jan.";
text(myString, 100, 100);
What is the output of the code shown below?
var myGreeting = "Hello";
var myName = "Angela";
var sayHello = myGreeting + ", " + myName + "!";
What is the output of the sample code below?
var xPos = 15;
var yPos = 30;
var label = "The coordinates are " + xPos + ", " + yPos;
Jack is programming a game called TreasureHunter Extreme, where players must collect as much gold as possible in 5 minutes.
Which variable would he most likely use a string data type for?
What is the pseudocode equivalent of this JavaScript?
var secrect_code = "2023";
Joselyn is developing a recipe app.
Here is a part of her program that sets up some variables:
title ← "Mashed potatoes"prepTime ← 15cookTime ← 40rating ← 4.0category ← "Vegetables"How many string variables is this code storing?
The following variable assignments are from a family tree program.
Identify which variables store numbers and which store strings:
birthYear ← 1967 [1]
birthMonth ← "June" [2]
birthDay ← 16 [3]
Match them to the correct group: Number or String.
The following variable assignments are from a baseball stats program.
Identify which variables store numbers and which store strings:
numAtBats ← 25 [1]
numHits ← 11 [2]
playerName ← "Bernardo" [3]
playerTeam ← "Sharks" [4]
Match them to the correct group: Number or String.
Which of these variables are storing a number data type?