Foundations - D278: (Latest Update 2025
/ 2026) Questions and Certified Answers |
100% Correct | A+ Grade.
Joe is building an online game. He wants to provide a
riddle and have the player guess the answer. The game
needs to prompt the user to enter the answer, check to see
if it the input provided does not match the correct answer,
and continue prompting the user until the answer entered
matches the correct answer.
Which control structure supports Joe's needs? - ANSWER
✓ Do-while loop
What is put to output by the following pseudocode?
x=3
do
Put x to output
,Put " " to output
x=x-1
while x > 0 - ANSWER ✓ 3 2 1
A variable ___ declares a new variable, specifying the
variable's name and type. - ANSWER ✓ A variable
declaration declares a new variable, specifying the
variable's name and type.
How should the item that holds the minimum age be
declared? - ANSWER ✓ Constant integer minAge
Given integer x = 3 and integer y = 5.
What is the value of the expression (x / 2.0) + y? -
ANSWER ✓ 6.5
Given float x = 10.2 and float y = 1.0.
,What is the value of the expression x / y? - ANSWER ✓
10.2
What kind of operator is the == in the expression i ==
20? - ANSWER ✓ Equality
What is the purpose of parentheses () in a programming
expression? - ANSWER ✓ To group expressions
Given float x = 3.0.
Which expression evaluates to 2.0? - ANSWER ✓ x / 2 +
0.5 /2 + .25
Which expression represents all the values of x, when x
is the age ranging from 18 to 24 years old? - ANSWER ✓
(x >= 18) and (x <= 24)
, Which data type is used for items that are measured in
length? - ANSWER ✓ Float
Which data type should be used to keep track of how
many planes are in a hangar? - ANSWER ✓ Integer
A function should convert hours and minutes to seconds,
such as converting 1 hour and 10 minutes to 4,200
seconds.
What should be the input to the function? - ANSWER ✓
Hours and minutes
A function returns a number x cubed. For example, if x is
3, the function returns 3 * 3 * 3, or 27.
What should be the input to the function? - ANSWER ✓ x
A function calculates the weight difference (Diff) given
two sample weights (S1 and S2).