You may assume all numbers entered are legal (you don't need to check for negative input, for example).
You may design your program in any way you see fit, though you should follow the guidelines for good programming that we've discussed in class: using comments, choosing appropriate variable names, making use of functions where appropriate, etc.
How many bottles should we start with? 10 How many do we take off the wall each time? 1 10 bottles of pop on the wall, 10 bottles of pop. Take 1 down, pass them around, 9 bottles of pop on the wall. 9 bottles of pop on the wall, 9 bottles of pop. Take 1 down, pass them around, 8 bottles of pop on the wall. 8 bottles of pop on the wall, 8 bottles of pop. Take 1 down, pass them around, 7 bottles of pop on the wall. 7 bottles of pop on the wall, 7 bottles of pop. Take 1 down, pass them around, 6 bottles of pop on the wall. 6 bottles of pop on the wall, 6 bottles of pop. Take 1 down, pass them around, 5 bottles of pop on the wall. 5 bottles of pop on the wall, 5 bottles of pop. Take 1 down, pass them around, 4 bottles of pop on the wall. 4 bottles of pop on the wall, 4 bottles of pop. Take 1 down, pass them around, 3 bottles of pop on the wall. 3 bottles of pop on the wall, 3 bottles of pop. Take 1 down, pass them around, 2 bottles of pop on the wall. 2 bottles of pop on the wall, 2 bottles of pop. Take 1 down, pass them around, 1 bottles of pop on the wall. 1 bottles of pop on the wall, 1 bottles of pop. Take 1 down, pass them around, 0 bottles of pop on the wall.Another run:
How many bottles should we start with? 10 How many do we take off the wall each time? 2 10 bottles of pop on the wall, 10 bottles of pop. Take 2 down, pass them around, 8 bottles of pop on the wall. 8 bottles of pop on the wall, 8 bottles of pop. Take 2 down, pass them around, 6 bottles of pop on the wall. 6 bottles of pop on the wall, 6 bottles of pop. Take 2 down, pass them around, 4 bottles of pop on the wall. 4 bottles of pop on the wall, 4 bottles of pop. Take 2 down, pass them around, 2 bottles of pop on the wall. 2 bottles of pop on the wall, 2 bottles of pop. Take 2 down, pass them around, 0 bottles of pop on the wall.Another run:
How many bottles should we start with? 10 How many do we take off the wall each time? 3 10 bottles of pop on the wall, 10 bottles of pop. Take 3 down, pass them around, 7 bottles of pop on the wall. 7 bottles of pop on the wall, 7 bottles of pop. Take 3 down, pass them around, 4 bottles of pop on the wall. 4 bottles of pop on the wall, 4 bottles of pop. Take 3 down, pass them around, 1 bottles of pop on the wall.Notice how the last run stops at 1 bottle on the wall, because with taking three down each time, we have to stop there.
Your code does not have to follow this exact script verbatim, but all the mentioned functionality should be there: asking the user for number of bottles and how many to remove each time, and printing each verse in turn, stopping before hitting a negative number.