•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.

  1. 👍
  2. 👎
  3. 👁
  1. 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.

    1. 👍
    2. 👎
  2. 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....

    1. 👍
    2. 👎
  3. 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.

    1. 👍
    2. 👎
  4. 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??

    1. 👍
    2. 👎
  5. 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.

    1. 👍
    2. 👎
  6. 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

    1. 👍
    2. 👎

Respond to this Question

First Name

Your Response

Similar Questions

  1. English

    I don't really understand this question and, I know you said to other people go look at the other exact same question but they don't really help and I don't want to get a B in ELA. I don't want the answer, I just need help on the

  2. Global Studies

    Q: Which statement best illustrates how American Indians were affected by British colonization? A: A. Trading partnerships led to peaceful co-existence between American Indians and British B. American Indians converted to

  3. math, connexus, mathematics, algebra

    Yoo can someone help me out with Unit 4 Lesson 11 Rational Numbers Unit test for connexus?? I'm having trouble understanding and I don't have anyone to help me at the moment, thanks! Also for all you people that want to comment

  4. chemistry

    Calculate the theoretical yield of alum if 0.200g of Aluminum was reacted with excess KOH and H2SO4? I don't even know how to start it. Please help. Also I wanted to say thank you for the help I've gotten from this website it has

  1. art

    this image was created by using basic math concepts that include all of the following except A)knowing how to create a pattern B)using understanding the angles of the shapes C) a basic understanding of different geometric shapes.

  2. ela need help know i have fs

    Which of the following does a reader gain by understanding the relationship between words?(1 point)(1) better understanding of the words meanings the meaning of figures of speech information about an author's purpose knowledge

  3. tourism and hospitality

    The marketing process begins with ____________________. understanding why business is important understand what product consumers need or want understanding how to make money understanding how to make a product i think its a

  4. english

    I have to give the following feedback to this paragraph: (Evaluative, Interpretive, Supportive, Probing and Understanding). I don't know how to start or if I have to use all the 5 types of feedback. This is the paragraph I have to

  1. Social studies

    Lesson 13 Civics unit test social studies I'm having troubles I'm not understanding question 1 through 31. Someone please help each other emergency I don't understand this and I have to get an A or my mom is canceling Christmas

  2. Quality Management

    A quality manager asks why medical errors are increasing. By asking this type of question, you can deduce that she's most likely at which stage? A. Understanding how systemic structure isn't readily available B. Going below the

  3. Algebra

    6x²y³ + 9x²y³ 15x²y³ ------------- = ---------- 3x²y² 3x²y² = (15/3) (x²/x²) (y³/y²) = 5y Just want it to know if is correct, but don't y³ + y³ = 2y³? I'm confused now. Can someone please help? yes, the answer is

  4. psy210

    Q: Do you think that having an understanding of cultural differences and personality differences would be beneficial? Why or why not? A:I believe having an understanding of both cultural differnces and personality differnces can

You can view more similar questions or ask a new question.