WGU C173 SCRIPTING AND PROGRAMMING – FOUNDATIONS
OBJECTIVE ASSESSMENT QUESTIONS AND
FINAL EXAM REVIEW AT THE END
1. Which operator should be used to determine if a number is evenly divisible b
g g g g g g g g g g g g g
y 5?
g
A+ g
B- g
C* g
D %: D
g g
2. A car drove 200 miles using 10 gallons of fuel.
g g g g g g g g g
Which operation should be used to compute the miles per gallon, which is 20?
g g g g g g g g g g g g g
A Addition
g
B Subtraction
g
C Multiplication
g
D Division: D
g g
3. A variable should hold a person's height in meters.
g g g g g g g g
Which data type should the variable be?
g g g g g g
1g/g18
,A Integer
g
B Float
g
C String
g
D Boolean: b
g G
4. A variable should hold the names of all past U.S. presidents.
g g g g g g g g g g
Which data type should the variable be?
g g g g g g
A Integer array
g g
B Float array
g g
C String array
g g
D Boolean array: C
g g g
5. A program uses the number of seconds in a minute in various calculations.
g g g g g g g g g g g g
How should the item that holds the number of seconds in a minute be de- clared
g g g g g g g g g g g g g g g
A Constant float userTime
g g g
B Variable float userTime
g g g
C Constant integer secondsPerMinute
g g g
D Variable integer secondsPerMinute: C
g g g g
6. A program determines if a user's age is high enough to run for U.S. presi-
g g g g g g g g g g g g g g
dent. The minimum age requirement is 35.
g g g g g g g
How should the item that holds the minimum age be declared?
g g g g g g g g g g
2g/g18
,A Constant integer minAge
g g g
B Variable integer minAge
g g g
C Constant integer 35
g g g
D Variable integer 35: A
g g g g
7. Given integer x = 3 and integer y = 5.
g g g g g g g g g
What is the value of the expression ( x / 2.0) + y?
g g g g g g g g g g g g
A 5.0
g
B 6.0g
C 6.5g
7 7.5: C
g g
8. Given float x = 10.2 and float y = 1.0.
g g g g g g g g g
What is the value of the expression x / y ?
g g g g g g g g g g
A 0.0
g
B 1.0g
C 10 g
D 10.2: D
g g
9. What kind of operator is the == in the expression i == 20?
g g g g g g g g g g g g
A Assignment
g
B Arithmetic
g
C Equality
g
D Logical: C
g g
3g/g18
, 10. What is the purpose of parentheses () in a programming expression?
g g g g g g g g g g
A To print expressions
g g g
B To group expressions
g g g
C To run expressions
g g g
D To compose expressions: B
g g g g
11. Given float x = 3.0. g g g g
Which expression evaluates to 2.0? g g g g
Ax /3*2+ 2 g g g g g g g
B x - 2/3 g g g
C x + 0.5 /2 g g g g
D x / 2 + 0.5 /2 + .25: D
g g g g g g g g g
12. Which expression evaluates to true only when the user is within 3 years of 2
g g g g g g g g g g g g g g
1 years, given a variable x containing a user's age?
g g g g g g g g g
A x >= 18) or ( x <= 24)
g g g g g g g g
B ( x >= 18) and ( x <= 24)
g g g g g g g g g
4g/g18
OBJECTIVE ASSESSMENT QUESTIONS AND
FINAL EXAM REVIEW AT THE END
1. Which operator should be used to determine if a number is evenly divisible b
g g g g g g g g g g g g g
y 5?
g
A+ g
B- g
C* g
D %: D
g g
2. A car drove 200 miles using 10 gallons of fuel.
g g g g g g g g g
Which operation should be used to compute the miles per gallon, which is 20?
g g g g g g g g g g g g g
A Addition
g
B Subtraction
g
C Multiplication
g
D Division: D
g g
3. A variable should hold a person's height in meters.
g g g g g g g g
Which data type should the variable be?
g g g g g g
1g/g18
,A Integer
g
B Float
g
C String
g
D Boolean: b
g G
4. A variable should hold the names of all past U.S. presidents.
g g g g g g g g g g
Which data type should the variable be?
g g g g g g
A Integer array
g g
B Float array
g g
C String array
g g
D Boolean array: C
g g g
5. A program uses the number of seconds in a minute in various calculations.
g g g g g g g g g g g g
How should the item that holds the number of seconds in a minute be de- clared
g g g g g g g g g g g g g g g
A Constant float userTime
g g g
B Variable float userTime
g g g
C Constant integer secondsPerMinute
g g g
D Variable integer secondsPerMinute: C
g g g g
6. A program determines if a user's age is high enough to run for U.S. presi-
g g g g g g g g g g g g g g
dent. The minimum age requirement is 35.
g g g g g g g
How should the item that holds the minimum age be declared?
g g g g g g g g g g
2g/g18
,A Constant integer minAge
g g g
B Variable integer minAge
g g g
C Constant integer 35
g g g
D Variable integer 35: A
g g g g
7. Given integer x = 3 and integer y = 5.
g g g g g g g g g
What is the value of the expression ( x / 2.0) + y?
g g g g g g g g g g g g
A 5.0
g
B 6.0g
C 6.5g
7 7.5: C
g g
8. Given float x = 10.2 and float y = 1.0.
g g g g g g g g g
What is the value of the expression x / y ?
g g g g g g g g g g
A 0.0
g
B 1.0g
C 10 g
D 10.2: D
g g
9. What kind of operator is the == in the expression i == 20?
g g g g g g g g g g g g
A Assignment
g
B Arithmetic
g
C Equality
g
D Logical: C
g g
3g/g18
, 10. What is the purpose of parentheses () in a programming expression?
g g g g g g g g g g
A To print expressions
g g g
B To group expressions
g g g
C To run expressions
g g g
D To compose expressions: B
g g g g
11. Given float x = 3.0. g g g g
Which expression evaluates to 2.0? g g g g
Ax /3*2+ 2 g g g g g g g
B x - 2/3 g g g
C x + 0.5 /2 g g g g
D x / 2 + 0.5 /2 + .25: D
g g g g g g g g g
12. Which expression evaluates to true only when the user is within 3 years of 2
g g g g g g g g g g g g g g
1 years, given a variable x containing a user's age?
g g g g g g g g g
A x >= 18) or ( x <= 24)
g g g g g g g g
B ( x >= 18) and ( x <= 24)
g g g g g g g g g
4g/g18