Week 4 CheckPoint Answer Key

Week 4 CheckPoint Answer Key - Week 4 CheckPoint Assignment...

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

View Full Document Right Arrow Icon
Week 4 CheckPoint Assignment Answer Key for Iteration Control Structure This week’s CheckPoint requires students to design a program to emulate the repetitive movement of a worm inching toward an apple. Design a program that models the worm’s behavior in the following scenario: A worm is moving toward an apple. Each time it moves, the worm cuts the distance between itself and the apple by its own body length until the worm is close enough to enter the apple. The worm can enter the apple when it is within a body length of the apple. Post as an attachment to Assignment Section. (Microsoft Word format) Input-Process-Output Chart: Input Processes Output Initial_Distance (real) Worm_Length (real) Get_Input Initial_Distance (real) Worm_Length (real) Initial_Distance (real) Worm_Length (real) Calculate_Distance Distance (real) Distance (real) Output Distance (real) Pseudocode Design: Main Module Declare Initial_Distance as real Declare Worm_Length as real Declare Distance as real Call Get_Input Module Call Calculate_Distance Module Call Output Module End Main Module Get_Input Module Display "Enter initial distance between worm and the apple:" Input Initial_Distance Display "Enter the worm's length"
Background image of page 1

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

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

Page1 / 7

Week 4 CheckPoint Answer Key - Week 4 CheckPoint Assignment...

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