Question: Lab 4.1-Repetition Structures Pseudocode Critical Review A repetition structure causes a statement or set of statements to execute repeatedly Repetition structures are used to perform



Lab 4.1-Repetition Structures Pseudocode Critical Review A repetition structure causes a statement or set of statements to execute repeatedly Repetition structures are used to perform the same task over and over Repetition structures are commonly called loops A condition-controlled loop uses a true/false condition to control the number of times that t repeats A count-controlled loop repeats a specific number of times. The loop keeps a count of the number of times that it iterates, and when the count reaches a specified amount the loop stops. A variable, known as a counter variable, is used to store the number of iterations that it has performed. The three actions that take place are initialization, tes, and increment. Initialization: Before the loop begins, the counter variable is initialized to a starting value Test: The loop tests the counter variable by comparing it to a maximum value Increment: To increment a variable means to increase its value. This is done by adding one to the loop control variable Any loop can be used with a count-controlled loop A running total is a sum of numbers that accumulates with each iteration of a loop. The variable used to keep the running total is called an accumulator Help Video: lab4-1.wmv This lab requires you to write a complete program using a condition controlled loop, a counter controlled loop, and an accumulator. The program is as follows Write a program that will allow a grocery store to keep track of the total number of bottles collected for seven days The program should allow the user to enter the total number of bottles returned for seven days. The program will calculate the total number of bottles returned f r the week and the amount paid out (the total returned times .10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
