Iteration Control Structure

Iteration Control Structure - Set Starting_Distance =...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Process 1. Get distance from apple 2. Get worm length 3. Calculate movement distance 4. Output result Input Processes Output Worm Length (user input) Get Worm Length Worm Length Distance from apple (user input) Get Apple Distance Distance from apple Distance, Length Output Result Worm ate apple (to display) Main Module Declare Worm_Length as real Declare Inches as real Declare Starting_Distance as real Declare Remaining_Distance as real Declare Distance_Moved as real Call Movement Module Call Output Module End Main Module Movement Module Set Worm_Length = Inches
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Set Starting_Distance = Inches Set Distance_Moved = Worm_Length * 1 Set Remaining_Distance = Starting_Distance Distance_Moved While Remaining_Distance => 0 Repeat Distance_Moved = + 1 Until Remaining_Distance =< 0 End if End Movement Module Output Module Write Worm ate apple End Output Module Yes No Yes No Yes Is there any tutoring for this course because I am still having trouble? I do not want to fail this course. Is there way I could call you to get some things clarified?...
View Full Document

Page1 / 2

Iteration Control Structure - Set Starting_Distance =...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online