WGU D278 SCRIPTING AND PROGRAMMING FOUNDATIONS
FINAL REVIEW QUESTIONS AND SOLUTIONS
◉ A program determines if a user's age is 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?
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
FINAL REVIEW QUESTIONS AND SOLUTIONS
◉ A program determines if a user's age is 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?
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