•Hi I really need help with with this I don't think I'm understanding how to do it maybe because i have never done this

Design a program (you can use pseudocode to write your 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.

cut and paste rarely works at this site. Most of the time you will have to type your question. If you have code to show, you can try to make a link.

Typing up the question in your own words will actually help you understand what you are asked to do, so time is not lost.

Thanks for the info...

here is the problem that im having trouble with....
Design a program ( I can use a pseudocode to write the program) That models the worms behavior in the following scenario. a worm is moving toward an apple. Each time it moves the worm cuts the distance between itseld and the apple by its own body length until the work is close enough to enter the apple. The worm can enter the apple when it is within a body length of the apple.

I have had a hard time with this class maybe because i have never done this before i want to learn i just don't know how to do this....

It's OK if you don't have much to go on, that's what classes are for.

I believe you have not written programs before, so writing in pseudocode is perfect.

IBM used to recruit people who were asked to do similar problems for a qualifying test.

To help you understand how this works, I suggest you put yourself in the worms shoes, and make yourself a table with three columns.

The first column is "step", i.e. number of times you, the worm, have inched towards the apple.

The second column is the distance from the apple in worm units.

The third column is the question: am I there yet?

On the first row, write 1 in column 1, 5 worm units in column 2, and say no in column three.

Now proceed to complete the second, third, ... until you get to the apple.

Get the idea? Need more details? Don't hesitate to post.

would that be process then input then output I for one have never done this before and its been hard trying to put it together i have read and read examples but its not clicking in my head for some reason not sure why??

Input and output in your example are trivial, and consists of entering the initial distance from the apple, and when the worm got hold of the apple, it would say "Yum, yum!" or something like that.

It's the processing that takes a little more thinking.

The concept that is being introduced in this exercise is looping, or decision making, i.e. when to stop.

If you had completed the table I suggested, you would have gone through the complete step of processing and simple decision making. Don't forget to reduce the distance after every step.

Okay i did the input output now i have to do design which is Main Module puEnd Main Module, Input Data Module,End input data Module, perform Caclulations Module, Output results Module, And End Output Results Module... Please if you can help me Thanks

To design a program that models the worm's behavior in the given scenario, you can use a loop to repeatedly move the worm towards the apple.

Here's an example pseudocode implementation:

1. Initialize a variable "wormPosition" to represent the worm's current distance from the apple.
2. Initialize a constant variable "bodyLength" to represent the worm's body length.
3. Initialize a variable "appleDistance" to represent the distance between the worm and the apple.
4. While "appleDistance" is greater than or equal to "bodyLength":
a. Move the worm "bodyLength" units closer to the apple.
b. Update the "appleDistance" by subtracting "bodyLength" from it.
5. Output a message indicating that the worm is close enough to enter the apple.

The pseudocode implementation above assumes that the worm's movement can only be in one direction (straight), and the worm cannot move backwards or sideways.

To convert this pseudocode into a specific programming language like Python or Java, you would need to use the syntax and constructs of that particular language. The logic, however, remains the same.