3
AssignmentMultiple Choice

VPython Applications

Question 3 • SC-Fundamentals of Computing - Content Recovery - Design & Development

In your program, your ball dropped. What condition made the ball stop when it reached the origin of the axes you had drawn?

Answer
A
while ball.pos.y > 0
B
while ball.pos.x > 0
C
while ball.pos.z > 0
D
while ball.pos > 0

Explanation

The ball stops at the origin when its vertical position reaches y = 0. The condition `while ball.pos.y > 0` keeps the ball moving only while it is above the origin, so the loop ends when it reaches that height. The x- and z-coordinates describe other directions, and `ball.pos` is a vector rather than a single coordinate.

AI-written and checked against the verified answer.

Previous
Next