Why is the looping logic important in programming? What is the difference between event-controlled loops and counting loops?

6.12 Programming Activity 2: Using for Loops

In this activity, you will write a for loop:
For this Programming Activity, again calculate the total cost of the items in a grocery cart.

Write the program for the Express Lane.

Your job is to write a for loop to calculate the total cost of the items in the cart.

Listed below are topic(s) to be discussed throughout the week.

Refer to the textbook, weekly materials, and/or the GMC library when researching the topics for this Discussion Forum. Put your writing into your own words, do not copy directly from the source.

If you incorporate external resources (http://gmcga.libguides.com/periodicals) in your posts be sure to cite (https://gmcga.libguides.com/citationmanagement/APA7th) them properly.

Lastly, review how to paraphrase and quote resources before you begin posting (http://gmcga.libguides.com/c.php?g=458&p=996448).

Complete Chapter 6, Section 6.12 “Programming Activity 2: Using for Loops” from the textbook. Once you have completed it, answer the following questions:

1) Why is the looping logic important in programming?

2) What is the difference between event-controlled loops and counting loops? Provide examples.

3) What advice or code can you provide to help other students with this activity?

4) Can we replace a while loop with a for loop?

Why is the looping logic important in programming? What is the difference between event-controlled loops and counting loops?
Scroll to top