View the step-by-step solution to:

Question

Wondering if someone could show me?


As a child did you ever play the game "One potato, two

potato..." to determine who would be "it"? The complete rhyme is given below.

 

One potato, two potato, three potato, four;

Five potato, six potato, seven potato, more.

O U T spells "out you go."


A child is pointed to during each phrase. There are four phrases each in lines 1 and 2 and seven phrases in line 3, so the last child pointed to is the fifteenth child. If there are fewer than 15 children, you go around the circle again. The child pointed to when the word "go" is said is "out". The game begins again with the remaining children, starting again with the first child. The last child remaining is "it". 

Simulate this game in a computer program. The input is the number of children; the output is which child is it. 

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Let our 24/7 C++ Programming tutors help you get unstuck! Ask your first question.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors