Why loops are needed
📖 Scenario: Imagine you run a small shop and want to print a thank you message for each customer who bought something today.
🎯 Goal: You will create a program that stores customer names, sets a message, uses a loop to print the message for each customer, and finally shows all messages.
📋 What You'll Learn
Create an array of customer names with exact values
Create a string variable for the thank you message
Use a for loop with variable
i to go through the arrayPrint the thank you message with the customer's name inside the loop
💡 Why This Matters
🌍 Real World
Loops help automate repetitive tasks like sending messages to many customers without writing the same code again and again.
💼 Career
Understanding loops is essential for programming jobs because they make code efficient and easier to maintain when working with lists or collections of data.
Progress0 / 4 steps