Construct a Read, Evaluate, Print, Loop (REPL) which performs the following on each iteration of the loop:
-
Increment a
counter
variable to keep track of the number of loops. -
Ask the user if they would like to loop again.
-
If the user enters 'yes', repeat the loop
-
If the user enters 'no', end the loop and display the number of loops performed.
Output:
Again? yes/no: yes Again? yes/no: yes Again? yes/no: yes Again? yes/no: no The loop ran 4 times.