n n n n n n
AM 2024 | ACTUAL REAL EXAM QUESTIONS AND ANS
n n n n n n n n
WERS WITH A PRACTICE EXAM TEST BANK AND ST
n n n n n n n n
UDY GUIDE | VERIFIED AND ACCURATE n n n n n
FOR GUARANTEED PASS | GRADED A n n n n n
What is the purpose of parentheses () in a programming exp
n n n n n n n n n n
ression?
A To print expressions
n n n
B To group expressions
n n n
C To run expressions
n n n
D To compose expressions - .....ANSWER .. B
n n n n n
Given float x = 3.0. n n n n
Which expression evaluates to 2.0?n n n n
Ax/3*2+2
n n n n n n n
B x - 2/3
n n n
C x + 0.5 /2
n n n n
D x / 2 + 0.5 /2 + .25 - .....ANSWER. .... D
n n n n n n n n n n
Which expression evaluates to true only when the user is
n n n n n n n n n n
within 3 years of 21 years, given a variable x containing a
n n n n n n n n n n n n
user's age? n
A x >= 18) or ( x <= 24)
n n n n n n n n
B ( x >= 18) and ( x <= 24)
n n n n n n n n n
C ( x < 18) or ( x > 24)
n n n n n n n n n
,D ( x < 18) and ( x > 24) - .....ANSWER. ..... B
n n n n n n n n n n n
Which data type is used for items that are measured in lengt
n n n n n n n n n n n
h?
A Integer
n
B Float
n
C String
n
D Boolean - .....ANSWER. . B
n n n
Which data type should be used to keep track of how many
n n n n n n n n n n n n
planes are in a hangar?
n n n n
A Integer
n
B Float
n
C String
n
D Boolean - .....ANSWER. . A
n n n
A function should convert hours and minutes to seconds,
n n n n n n n n n
such as converting 1 hour and 10 minutes to 4,200 second
n n n n n n n n n n
s.
What should be the input to the function?
n n n n n n n
A Hours only
n n
B Minutes only
n n
C Hours and minutes
n n n
D Hours, minutes, and seconds - .....ANSWER. . C
n n n n n n
A function returns a number x cubed. For example, if x is 3,
n n n n n n n n n n n n n
the function returns 3 * 3 * 3, or 27.
n n n n n n n n n
What should be the input to the function?
n n n n n n n
,Ax n
B x, x
n n
C x, x, x
n n n
D 27 - .....ANSWER. ..A
n n n
A function calculates the weight difference (Diff) given t
n n n n n n n n
wo sample weights (S1 and S2).
n n n n n
What should be the output from the function?
n n n n n n n
A S1 only
n n
B S2 only
n n
C S1 and S2
n n n
D Diff - .....ANSWER. .. D
n n n
function P(integer x) returns integer y n n n n n
y=2*x
n n n n n
What does P(5) evaluate to?
n n n n
A2 n
B5 n
C 10n
D 25 - .....ANSWER. ..C
n n n
Function F() n
Put "Hey" to output
n n n n
What entire output appears after three successive calls to
n n n n n n n n n
F()?
A Hey
n
B HHHey
n
, C HeyHeyHey
n
D Hey Hey Hey - .....ANSWER.... C
n n n n n
What is a valid user-defined function name?
n n n n n n
A A reserved word
n n n
B Any valid identifier
n n n
C Any variable name
n n n
D A floating-point number - .....ANSWER. . B
n n n n n
A function MyFct has an input x and an output z.
n n n n n n n n n n
What does MyFct return?
n n n
A Nothing
n
B x only
n n
C z only
n n
D x and z - .....ANSWER .... C
n n n n n
What is the return value of a function?
n n n n n n n
A Output of a function
n n n n
B Call to run the function
n n n n n
C Data passed to the function
n n n n n
D Variable in the declaration of the function -
n n n n n n n n
.....ANSWER. . A
A program should continue accepting input numbers, addi
n n n n n n n
ng each to a sum, until a 0 is input.
n n n n n n n n n
Which control structure should be used?
n n n n n
A If statement
n n
B For loop
n n