Foundations LATEST Exam COMPLETE VERIFIED
QUESTIONS AND WELL ELABORATED ANSWERS (A
NEW UPDATED VERSION) |ALREADY GRADED A+
2026-2027
Which data type should be used to keep track of how many planes
are in a hangar?
Integer
3 multiple choice options
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?
Hours and minutes
3 multiple choice options
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?
x
3 multiple choice options
,A function calculates the weight difference (Diff) given two
sample weights (S1 and S2).
What should be the output from the function?
Diff
3 multiple choice options
function P(integer x) returns
integer y y = 2 * x
What does P(5) evaluate to?
10
3 multiple choice options
Function F()
Put "Hey" to output
What entire output appears after three successive calls to F()?
HeyHeyHey
3 multiple choice options
What is a valid user-defined function name?
Any valid identifier
3 multiple choice options
, A function MyFct has an input x and an output
z. What does MyFct return?
z only
3 multiple choice options
What is the return value of a function?
Output of a function
3 multiple choice options
A program should continue accepting input numbers, adding each to
a sum, until a 0 is input.
Which control structure should be used?
While loop
3 multiple choice options
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?
Do-while loop
3 multiple choice options