Wrapup which is the document write that says the end.
This loop has three requirements to control processing This loop has three requirements to control processing. I iniitialize ct at 1, inside the loop I increment ct by 1 so it will change and the processing is controlled with a test or condition that compares ct to data_input. Since ct is constantly incrementing, eventually it will not be <= to data_input and the loop will stop.
This time I entered 1 for data_input so it processed once while the ct of 1 was = data_input of 1.
This time I entered 0 as the data_input so no processing was done in the while loop. The comparison compared ct which was 1 to data_input which was 0 and ct was not less than or equal to data_input.
This is the do loop with the condition at the end This is the do loop with the condition at the end. Therefore it is always executed once. I take in data_input, I set ct = 1 and then I enter the loop and write out a line and increment ct. Then I compare to see if I should do the loop again. At this point ct is 2 and data_input is the 6 that I entered, so the loop is done again.
Note that If I entered a 0 I would get the same result because it would process once and then ct would be 2 and data_input would be 0 so it would not process again.
Processing does the loop multiple times. Wrapup is executed once when processing is complete. I check the total_Points and determine the message.
This prints out the total for each player as long as the user enters Y to continue. Any other entry would end the loop.
In class work was to add an if statement to tell which player won or if it was a tie.
example for sample if.