Question and answers 100% correct 2025
1. Which operator should be used to determine if %
a number is evenly divisible by 5?
2. A car drove 200 miles using 10 gallons Division
of fuel. Which operation should be used
to compute the miles per gallon, which
is 20?
3. A variable should hold a person's height in me- Float
ters.
Which data type should the variable be?
4. A variable should hold the names of all past U.S. String array
presidents.
Which data type should the variable be?
5. A program uses the number of 8. Given float x
seconds in a minute in various = 10.2 and
calculations. float y =
How should the item that holds the 1.0. What is
number of seconds in a minute be the value of
declared? the
expression x
6. A program determines if a user's age is /y?
high enough to run for U.S. president.
The minimum age requirement is 35.
How should the item that holds the
minimum age be declared?
7. Given integer x = 3 and integer y = 5.
What is the value of the expression ( x /
2.0) + y?
1/
30
,Ultimate D278 Scripting and Programming Foundations
Question and answers 100% correct 2025
Constant integer secondsPerMinute
6.5
Constant integer minAge
10.2
9. Equality
2/
30
,Ultimate D278 Scripting and Programming Foundations
Question and answers 100% correct 2025
What kind of operator is the == in the
expres- sion i == 20?
10. What is the purpose of parentheses () ingroup expressions
a pro- gramming expression?
11. Given float x = 3.0. 2 + 0.5 /2 + .25
Which expression evaluates to 2.0?
12. Which expression evaluates to true only >= 18) and ( x <= 24)
when the user is within 3 years of 21
years, given a variable x containing a
user's age?
13. Which data type is used for items that are mea- Float
sured in length?
14. Which data type should be used to keep Integer
track of how many planes are in a
hangar?
Hours and minutes
15. 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?
16. A function returns a number x cubed. For
exam- x ple, if x is 3, the function returns
3 * 3 * 3, or 27. What should be the input
to the function?
17. A function calculates the weight difference (Diff)
3/
30