Start Main module
Declare Length,Distance as float
Display “Enter the length of the worm”
Input Length
Display “Enter the distance of worm from the apple”
Input Distance
Call MoveWorm Module
End main module
MoveWorm module
While Distance >= 0
Distance = Distance – WormLength
End While
Display “The worm has reached the apple!.”
End MoveWorm module
Read more: Design a program that models the worm's behavior... - JustAnswer www.justanswer.com
Declare Length,Distance as float
Display “Enter the length of the worm”
Input Length
Display “Enter the distance of worm from the apple”
Input Distance
Call MoveWorm Module
End main module
MoveWorm module
While Distance >= 0
Distance = Distance – WormLength
End While
Display “The worm has reached the apple!.”
End MoveWorm module
Read more: Design a program that models the worm's behavior... - JustAnswer www.justanswer.com