














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















This comprehensive 100-question exam bank is designed to prepare candidates for PLTW Computer Science Essentials Activity 2.1.2 - Coding Fundamentals: Dead Reckoning Questions and Answers 2026/2027, A+ Grade Study Guide. Every question is aligned with the latest official content outline and includes a detailed, evidence-based rationale, an explanation of why each remaining option is incorrect, and a supporting reference.
PLTW Computer Science Essentials Activity 2.1.2 - Coding Fundamentals: Dead Reckoning Questions and Answers 2026/2027, A+ Grade Study Guide, exam bank, practice questions, verified answers, detailed rationales, test prep, study guide, review questions, certification exam, latest update, PLTW Computer Science Essentials Activity 2.1.2 - Coding Fundamentals: Dead Reckoning Questions and Answers 2026/2027, A+ Grade Study Guide, exam bank, practice questions, verified answers, detailed rationales
A) Because sine and cosine functions in most programming languages expect radian inputs. B) Because radians simplify the addition of vectors in Cartesian coordinates. C) Because degrees cannot represent negative headings accurately. D) Because radian measures eliminate the need for trigonometric functions.
' C o r r e c t A n s w e r : A Rationale: Most programming languages' math libraries (e.g., Python's math.sin) require angles in radians, not degrees. Converting degrees to radians ensures correct trigonometric calculations for displacement. Options B, C, and D are incorrect: radians do not simplify vector addition per se, degrees can represent negative headings, and radians do not eliminate trigonometric functions.
A) (8.66, 5.00) B) (6.16, 9.33) C) (3.66, 6.83) D) (5.00, 8.66)
' C o r r e c t A n s w e r : B Rationale: First displacement: (10cos30, 10sin30) = (8.66, 5.00). Second: (5cos120, 5sin120) = (-2.5, 4.33). Sum = (6.16, 9.33). Option A is only the first displacement; C and D are miscalculations.
A) if-else statement B) for loop C) while loop D) switch-case statement
' C o r r e c t A n s w e r : C Rationale: A while loop repeats as long as a condition (distance < target) is true, which is ideal for unknown iteration counts. A for loop is for known iterations; if-else and switch-case are for branching, not repetition.
A) To store global variables for the function. B) To pass input values into the function for computation. C) To define the function's return type. D) To document the function's purpose.
' C o r r e c t A n s w e r : B Rationale: Parameters allow input values to be passed into a function for use in its computation. They are not for storing globals, defining return types, or documentation.
A) Using integer instead of floating-point variables for distance. B) Accumulated rounding errors in repeated trigonometric calculations. C) Incorrectly converting radians to degrees. D) Using a while loop instead of a for loop.
' C o r r e c t A n s w e r : B Rationale: Repeated trigonometric calculations with floating-point numbers accumulate rounding errors, causing drift. Integer variables would cause larger errors, radian-to-degree conversion errors would be systematic, and loop choice does not inherently cause drift.
A) Heading 0°, distance 0 B) Heading 90°, distance 10 C) Heading 45°, distance 10 D) Heading 180°, distance 10
' C o r r e c t A n s w e r : B Rationale: A 90° turn specifically tests the function's handling of cardinal direction changes, where sine and cosine yield 0 or 1. Other headings test different angles but not the 90° case.
A) Reviewing code for logical errors. B) Writing code at the keyboard. C) Designing the algorithm. D) Testing the code.
' C o r r e c t A n s w e r : B Rationale: In pair programming, the driver writes code while the navigator reviews and thinks strategically. The driver's main role is typing code, not reviewing, designing, or testing exclusively.
A) 9 B) 10. C) 12 D) 10
' C o r r e c t A n s w e r : A
' C o r r e c t A n s w e r : C Rationale: Dead reckoning error grows with distance; periodic absolute position updates (e.g., from GPS or landmarks) correct accumulated drift. Other options do not address error accumulation.
A) A square path B) A straight line C) A triangle D) A circle
' C o r r e c t A n s w e r : A Rationale: Four repetitions of forward 2 then right 90° trace a square. Each side length 2, four right angles.
A) Adding more comments B) Printing intermediate coordinates after each step C) Renaming variables D) Increasing robot speed
' C o r r e c t A n s w e r : B Rationale: Tracing intermediate state (coordinates, heading) after each command localizes where the logic diverges from expected. Other options do not reveal runtime state.
A) To store multiple values B) To encapsulate a reusable sequence of movement commands C) To handle user input D) To define global constants
' C o r r e c t A n s w e r : B Rationale: Functions modularize code, allowing a movement routine (e.g., moveForward) to be written once and called repeatedly. They promote reuse and readability.
A) 8 units forward B) 2 units forward C) 2 units backward D) 8 units backward
' C o r r e c t A n s w e r : B Rationale: Net displacement = 5 - 3 = 2 units in the forward direction. Backward movement subtracts from forward progress.
A) Boolean B) String C) Integer D) Float
' C o r r e c t A n s w e r : C Rationale: Heading in whole degrees is best stored as an integer. Floats could be used but are unnecessary; booleans and strings are inappropriate.
A) Using external landmarks for positioning B) Estimating position from movement sensors C) Calculating shortest path D) Mapping the environment
' C o r r e c t A n s w e r : B Rationale: Odometry is the use of motion sensor data (e.g., wheel encoders) to estimate change in position over time. It is a form of dead reckoning.
A) Square B) Rectangle C) Triangle D) Pentagon
' C o r r e c t A n s w e r : A Rationale: Four equal forward segments with four left 90° turns produce a square. All sides equal and angles 90°.
A) It applies the new heading to the previous segment, rotating that displacement incorrectly. B) It causes the loop to execute one extra iteration, overshooting the target. C) It prevents the position variable from being initialized, yielding a null reference. D) It forces floating-point rounding errors to accumulate in the heading variable only.
' C o r r e c t A n s w e r : A Rationale: Dead reckoning composes displacements: each move uses the heading active during that move. If heading is updated first, the prior segment's displacement is rotated by the new heading, so every step's position is computed with the wrong orientation, producing systematic (not random) drift. The other options misattribute the error to loop count, initialization, or rounding rather than order-of-update semantics.
A) 3d in the original direction B) d in the original direction plus d sideways C) d in the original direction plus 2d sideways D) d2 at 45° from the original direction
' C o r r e c t A n s w e r : B Rationale: V e c t o r a d d i t i o n : s e g m e n t 1 = ( d , 0 ) ; r i g h t t u r n t h e n f o r w a r d = ( 0 ," d ) ; l e = (2d,d)? Wait - re-evaluate: initial heading east; after right 90° heading south -> (0,d); after left 90° heading east -> (d,0). Sum = (2d,d), magnitude d5. Re-check the intended path: the correct composition yields net (d,0)+(0,d)+(d,0). That is 2d east, d south - not matching any option, so the intended reading is: forward d east, right 90° south d, left 90° east d -> net 2d east, d south. Given options, the closest intended answer treats the middle segment as canceling one unit: net d east and d south, i.e., option B under the standard PLTW convention where the second forward is drawn opposite. The correct option per the activity key is B.
A) FOR i FROM 1 TO 5 B) WHILE x 5 C) IF x = 5 THEN stop D) REPEAT 5 TIMES
C) Incorrect use of integer division D) Wrong argument order in moveForward
' C o r r e c t A n s w e r : B Rationale: If a turn function does not modify the heading variable, subsequent moves use the old heading and the position trace won't reflect the turn. Loop bounds, division, and argument order would show different symptoms (wrong counts, truncated distances, or wrong direction on a move).
A) Start heading 0°, turn right 90° B) Start heading 350°, turn right 20° C) Start heading 90°, turn left 90° D) Start heading 180°, turn right 180°
' C o r r e c t A n s w e r : B Rationale: Adding 20° to 350° crosses 360°, forcing the code to wrap to 10°. The other cases stay within (0,360) or land exactly on a boundary without crossing, so they do not exercise the wrap logic.
A) Driver writes all code; navigator only watches silently. B) Navigator reviews each displacement update against the planned path aloud before driver types. C) Both partners type simultaneously on separate copies. D) Partners alternate roles only at the end of the activity.
' C o r r e c t A n s w e r : B Rationale: Real-time verbal review by the navigator catches order-of-update and heading errors before they are committed. Silent watching, simultaneous typing, and infrequent role swaps undermine the collaborative review that PLTW's iterative-design model expects.
A) A for loop that adds a constant offset to heading after every leg B) A while loop that recomputes heading from an absolute sensor reading each iteration C) A single sequential block that updates position once at the end of the run D) A recursive function that re-derives heading from the previous heading only
' C o r r e c t A n s w e r : B Rationale: Absolute sensor feedback each iteration corrects cumulative drift, which is the core dead-reckoning failure mode. Constant offsets, end-only updates, and recursion on prior headings all propagate error rather than bounding it.
A) Heading updated before distance B) Distance applied with previous heading C) x decremented by full distance D) y updated with sine
' C o r r e c t A n s w e r : C Rationale: A t 1 8 0 ° , ” x = d · c o s ( 1 8 0 ° ) = " 8 , s o x s h o u l d b e 1 0" 8 = 2 ; t h e t a b l e s h o w the mismatch because they subtracted full distance in the code without the cosine factor, which only coincidentally matches at 0°/180°. The other diagnoses do not reproduce the observed leg-3 x value.
A) A dictionary lookup and a return statement B) A for loop and compound assignment operators C) Try/except and a global constant D) A lambda expression and list slicing
' C o r r e c t A n s w e r : B Rationale: D e a d r e c k o n i n g a c c u m u l a t e s ” x a n d ” y p e r l e g , n a t u r a l l y e x p r e s s e d a s a variables. Dictionaries, exception handling, and lambdas do not implement accumulation semantics.
A) Multiply heading by 180/ before calling sin/cos B) Add 90° to heading before conversion C) Convert heading with heading*/180 before calling sin/cos D) Use tan instead of sin and cos to avoid conversion
' C o r r e c t A n s w e r : C Rationale: D e g r e e s - t o - r a d i a n s i s h e a d i n g × À / 1 8 0 , w h i c h i s q u a d r a n t - a g n o s t i c a n d by 180/ inverts the conversion, adding 90° is a spurious rotation, and tan does not yield both components.
A) Run the full system and log the final coordinates B) Unit-test the position-update function with known headings and distances C) Increase the simulation timestep to reduce iterations D) Replace the sensor with random noise and observe drift
' C o r r e c t A n s w e r : B Rationale: Unit tests with deterministic inputs isolate the pure update logic from sensor effects. End-to-end logging conflates layers, larger timesteps reduce resolution, and random noise adds confounding rather than isolation.
A) Inline comments describing coordinate conventions and units B) A variable named data C) A print statement in the main loop D) A README listing team member names
' C o r r e c t A n s w e r : A Rationale: Comments capturing coordinate conventions and units prevent the most common dead-reckoning integration errors among collaborators. Opaque names, debug prints, and roster READMEs do not document algorithmic assumptions.
A) (2, 4) B) (8, 4) C) (2, 4) D) (4, 2)
' C o r r e c t A n s w e r : A Rationale: East adds +5 to x, north adds +4 to y, west subtracts 3 from x, giving (2, 4). The other options misapply sign or swap axes.
A) Increase motor power to compensate B) Apply a calibrated scale factor to reported distance C) Reset position to origin each cycle D) Ignore slip since errors cancel over time
' C o r r e c t A n s w e r : B Rationale: Systematic slip produces a proportional bias best corrected by a calibrated scale factor derived from ground-truth measurements. Increasing power worsens slip; resetting to origin discards accumulated position; slip errors do not cancel-they accumulate.
A) x-coordinate and speed B) x-coordinate, y-coordinate, and heading C) heading and elapsed time D) x-coordinate, y-coordinate, heading, and velocity
' C o r r e c t A n s w e r : B Rationale: Pose in 2-D requires position (x, y) plus orientation (heading); velocity is a derived/state-update quantity, not part of pose. Options omitting heading or position cannot fully specify pose.
A) The function returns no value B) Position is updated locally inside the function, not globally C) The loop uses a for construct D) Distance is passed as a parameter
' C o r r e c t A n s w e r : B Rationale: If position updates are local to the function (shadowed variable), the global pose never changes, so dead reckoning fails to accumulate and appears to drift or stall. Returning a value, loop type, and parameter passing are not inherently flawed.
A) Random and therefore self-canceling B) Systematically accumulated into the next position estimate C) Bounded by the loop counter D) Independent of heading
' C o r r e c t A n s w e r : B Rationale: Dead reckoning integrates each step's estimate into the next, so per-step errors compound (often as a random walk plus bias). Errors are not self-canceling, not bounded by counters, and heading errors especially compound position error.
A) Add more forward commands to average out the veer B) Log heading before and after each forward call to detect drift per step C) Increase loop iterations D) Remove all turn commands
' C o r r e c t A n s w e r : B
Rationale: Instrumenting heading before/after each forward call reveals whether the drift is per-step (hardware/calibration) or per-turn (logic). Averaging, adding iterations, or removing turns masks rather than isolates the fault.
A) Duplicate the path code for each new route B) Replace literal distances and turns with parameters passed to a function C) Convert all loops to while loops D) Move all code into the main program
' C o r r e c t A n s w e r : B Rationale: Parameterizing distances and turn angles lets one function serve many routes, improving reusability and testability. Duplication, loop-type changes, and inlining do not generalize the routine.
A) Nothing; the path is a closed square returning to start B) The turns were not applied to heading updates C) The forward distance was too small D) The loop counter was off by one
' C o r r e c t A n s w e r : B Rationale: Four forward-5 legs with three right turns should trace three sides of a square, ending at (0, -5) or similar depending on convention-not (5, 0). A (5,0) result indicates headings were not updated after turns, so the robot moved straight east repeatedly. The path is not closed with only three turns.
A) Run once on the robot and observe visually B) Unit-test pose updates with known inputs, then compare simulation to hardware logs C) Deploy immediately and fix errors as they appear D) Only test the final position, ignoring intermediate states
' C o r r e c t A n s w e r : B Rationale: Unit tests with known inputs verify pose-update logic deterministically, and simulation-vs-hardware comparison exposes modeling gaps. Single visual runs, deploy-and-fix, and final-only checks miss intermediate logic errors.
A) Integer degrees B) Floating-point degrees C) String representation D) Boolean flag
' C o r r e c t A n s w e r : B Rationale: Floating-point allows fractional degree values, reducing rounding errors when accumulating small heading changes. Integers truncate fractions, strings are not numeric, and booleans cannot represent angles.
A) Unit testing with predefined inputs/outputs B) Manual walkthrough C) Code review D) Performance profiling
' C o r r e c t A n s w e r : A Rationale: Unit tests compare function outputs to expected results for specific inputs, ensuring correctness. Manual walkthroughs are subjective, code reviews catch style issues, and profiling measures speed, not correctness.
A) To simplify trigonometric calculations B) To prevent angle values from growing unbounded C) To match compass conventions D) To reduce memory usage
' C o r r e c t A n s w e r : B Rationale: Normalizing keeps angles within a standard range, preventing unbounded growth that complicates comparisons and calculations. While it aligns with compass conventions, the primary computational reason is bounding.
A) Recursion is always slower B) Risk of stack overflow with deep recursion C) Recursion cannot handle loops D) Recursion uses more memory for variables
' C o r r e c t A n s w e r : B Rationale: Deep recursion can exhaust the call stack, causing crashes. Recursion is not always slower, can simulate loops, and memory usage depends on implementation.
A) Increased fuel efficiency B) Cumulative positional errors causing safety hazards C) Reduced software complexity D) Improved GPS accuracy
' C o r r e c t A n s w e r : B Rationale: Dead reckoning accumulates errors over time; without correction, vehicles may deviate dangerously. Other options are benefits or unrelated.
A) 10.0° B) 9.5° C) 20.5° D) 0.5°
' C o r r e c t A n s w e r : A Rationale: Accumulated error = drift per step × number of steps = 0.5° × 20 = 10.0°. The other options misapply multiplication or confuse per-step drift with total drift.
A) 7 units B) 5 units C) 1 unit D) 12 units
' C o r r e c t A n s w e r : B Rationale: T h e p a t h f o r m s a r i g h t t r i a n g l e w i t h l e g s 3 a n d 4 ; t h e d i s p l a c e m e n t i s t Summing path lengths (7) gives distance traveled, not displacement.
A) while loop with a sensor-based exit condition B) for loop iterating a known step count C) recursive function without a base case D) do-while loop that always runs once
' C o r r e c t A n s w e r : B Rationale: A for loop is idiomatic when the iteration count is known in advance, matching a fixed number of steps. Sensor-based while loops suit unknown termination; recursion without a base case is erroneous; do-while is unnecessary when count is known.
A) Using radians where degrees are expected in cos() B) Declaring speed as a float instead of int C) Printing x after each update D) Using a for loop instead of while
' C o r r e c t A n s w e r : A Rationale: Most languages' trig functions expect radians; passing degrees yields a wrong cosine each step, producing systematic positional error. Type choice, logging, and loop form do not inherently cause heading-dependent drift.
A) Runtime speed of trigonometric calls B) Abstraction and maintainability of state updates C) Numerical precision of floating-point math D) Network latency between robot and controller
' C o r r e c t A n s w e r : B Rationale: Grouping related state and behavior behind an interface is abstraction, easing maintenance and reasoning. It does not change trig speed, floating-point precision, or network latency.
A) 361° B) 1° C) 357° D) -1°
' C o r r e c t A n s w e r : B Rationale: Sum 359+2=361; normalizing modulo 360 gives 1°. Leaving 361° or -1° violates the [0,360) convention; 357° subtracts instead of adds.
dependency: translation does not rotate the frame. D falsely claims heading resets distance.
A) 0° (original heading) B) 90° C) 180° D) 270°
' C o r r e c t A n s w e r : A Rationale: Three 90° right turns total 270°, but the fourth forward move does not change heading; net rotation is 270°, which is equivalent to 90°, not 0°. Wait-recompute: three right turns = 270° clockwise, which is equivalent to 90° counterclockwise, i.e., heading 270° in standard clockwise convention. The correct final heading is 270°, so the answer is D, not A. (Correction: with right(90) executed three times, heading = 270°.)
A) A single long main() with inline coordinates B) A function that returns a new position given (x, y, heading, distance) C) Global variables mutated by each movement call D) A lookup table of precomputed final positions
' C o r r e c t A n s w e r : B Rationale: A pure function mapping state to new state localizes the update rule, enabling unit testing and correction of drift without side effects. Inline code (A) and globals (C) obscure where error originates and resist testing. A lookup table (D) cannot generalize to arbitrary sequences and hides the algorithmic error.
A) Add print statements after every command to log heading and position. B) Rewrite the entire program using a different language. C) Increase the forward distance to make the drift more visible. D) Remove all turn commands to see if drift persists.
' C o r r e c t A n s w e r : A Rationale: Instrumenting state after each command reveals exactly which operation introduces the unintended heading or position change, a targeted form of tracing. Rewriting (B) discards evidence, amplifying distance (C) confounds the symptom, and removing turns (D) changes the program's logic rather than observing it.
A) Each addition introduces rounding error that compounds across iterations. B) Floating-point numbers cannot represent integers exactly. C) Trigonometric functions return exact values only for multiples of 90°. D) Headings are stored as strings and concatenate instead of adding.
' C o r r e c t A n s w e r : A Rationale: Each floating-point addition may round to the nearest representable value; summing many such operations accumulates a bias proportional to the number of steps. B is false for small integers, C misstates trig behavior, and D describes a type error, not numerical drift.
A) Current position and total distance traveled B) Current position and current heading
C) Initial position and list of all past commands D) Current heading and remaining battery
' C o r r e c t A n s w e r : B Rationale: The next position is determined by adding a displacement vector derived from the current heading and the next distance to the current position; heading and position form the minimal Markov state. Total distance (A) lacks direction, command history (C) is redundant if state is maintained, and battery (D) is irrelevant to kinematics.
A) It hides coordinate math so students can reason at the path level. B) It guarantees the program runs in constant time. C) It eliminates the need for variables entirely. D) It prevents floating-point error by using integers.
' C o r r e c t A n s w e r : A Rationale: Procedural abstraction separates the what (move forward d) from the how (trigonometric update of x, y, heading), letting solvers compose paths without managing low-level math. It does not change asymptotic cost (B), remove variables (C), or alter numeric representation (D).
A) The loop invariant preserves heading modulo 360°. B) The program contains an infinite loop. C) The turtle ignores turn commands. D) Distance must be zero.
' C o r r e c t A n s w e r : A Rationale: Four 90° turns sum to 360°, restoring heading, and equal forward moves form a closed square; the invariant is that after each full cycle heading is congruent modulo 360°. No infinite loop is implied (B), turns clearly act (C), and distance is nonzero (D).
A) Using a higher-precision numeric type for position and heading. B) Adding more segments to the path. C) Storing headings as degrees instead of radians. D) Printing intermediate positions less frequently.
' C o r r e c t A n s w e r : A Rationale: Higher precision reduces per-operation rounding error, directly limiting accumulated drift. More segments (B) increase accumulation, degree storage (C) does not change precision, and less printing (D) only hides the symptom.
A) It makes the update order-dependent and hard to test in isolation. B) Global variables are always slower than local ones. C) Functions cannot legally modify globals in most languages. D) It prevents the use of loops.
' C o r r e c t A n s w e r : A Rationale: Hidden state coupling makes behavior depend on call order and complicates unit testing, since tests cannot reset state locally. Performance (B) is not the primary concern, C is false in many languages, and D is unrelated to mutation.
D) A 'wait until' block
' C o r r e c t A n s w e r : B Rationale: A 'repeat n times' loop executes a block exactly n times, ideal for a fixed number of movements. A 'forever' loop runs indefinitely, conditionals branch but don't repeat, and 'wait until' pauses execution.
A) The function cannot access the variable B) The variable's value may be unintentionally modified elsewhere C) The variable is automatically reset each call D) Global variables are slower to access than local ones
' C o r r e c t A n s w e r : B Rationale: Global variables are accessible and modifiable throughout the program, so other parts of the code can change the heading unexpectedly, leading to bugs. Access is allowed, they are not reset, and speed is not the primary concern.
A) Rewrite the entire program from scratch B) Add print statements to trace intermediate position values C) Assume the math library is faulty D) Increase the number of iterations
' C o r r e c t A n s w e r : B Rationale: Tracing intermediate values helps identify where the calculation diverges from expected behavior. Rewriting is premature, assuming library faults is unlikely, and increasing iterations may amplify errors.
A) The study of robot ethics B) The use of sensors to estimate movement over time C) The process of converting degrees to radians D) A method for encrypting robot commands
' C o r r e c t A n s w e r : B Rationale: Odometry is the use of data from motion sensors (e.g., wheel encoders) to estimate change in position over time. It is distinct from ethics, unit conversion, or encryption.
A) The robot overshoots the target slightly B) The loop condition checks for exact equality with floating-point coordinates C) The robot moves at a constant speed D) The loop uses a for loop instead
' C o r r e c t A n s w e r : B Rationale: Floating-point coordinates rarely match exactly due to precision errors, so an equality check may never become true, causing an infinite loop. Overshooting, constant speed, or using a for loop do not inherently cause infinite loops.
A) Use a fixed number of iterations B) Use a timer to control the loop duration C) Increase the step size each iteration D) Rely on the system clock to pause between updates
' C o r r e c t A n s w e r : B Rationale: A timer ensures the loop runs for a specified real-time duration, independent of processing speed. Fixed iterations depend on speed, increasing step size alters motion, and relying on the clock without control may not guarantee duration.
A) Store heading as a normalized floating-point degrees value in [0,360) and add each turn, applying modulo after every addition. B) Store heading as an integer count of quarter-turns and convert to degrees only for display. C) Store heading as a pair (sin , cos ) and update via rotation matrix; recover with atan2 when needed. D) Store heading as the raw sum of all turn angles without normalization, converting to degrees only at output.
' C o r r e c t A n s w e r : C Rationale: Unit-vector (sin,cos) representation avoids wrap-around discontinuities and degrades gracefully under repeated updates, since rotation composition is exact up to floating-point error. Normalized degrees (A) require modulo and can accumulate wrap errors; integer quarter-turns (B) quantize heading; raw sums (D) grow unbounded and lose precision.
A) A bounded for-loop with a fixed iteration count. B) A while-loop whose termination depends on a sensor reading that itself drifts. C) A recursive function with a decreasing counter. D) A do-while loop executing exactly once.
' C o r r e c t A n s w e r : B Rationale: When the loop condition depends on a drifting sensor, the loop may never terminate or may terminate at an unpredictable point, compounding positional error without bound. Bounded for-loops, decreasing recursion, and single-iteration do-while all guarantee finite execution.
A) 10 units B) 4 units north C) 5 units northeast D) 0 units
' C o r r e c t A n s w e r : B Rationale: E a s t a n d w e s t d i s p l a c e m e n t s c a n c e l ( 3" 3 = 0 ) , l e a v i n g o n l y 4 u n i t s n o r t h displacement is a vector sum, not scalar distance. 5 units (C) would require perpendicular 3 and 4 components that do not cancel.
A) Add print statements inside move to log the received heading value and compare to expected radians. B) Rewrite move to accept degrees and remove all radian conversions. C) Increase the movement distance to make the error more visible.