Gallery
Solution Debug 6.1. Loop Control
Share
Explore
Solution Debug 6.1. Loop Control

icon picker
The Task

Activity: Debug 6.1 loop-control 🐞 🕯

Start Here

Scottish Scents is a small business which makes hand-crafted products with Scottish-themed frangrances.
Every day, they make a batch of candles or soap or diffusers. A batch is between 6 and 24 items. Each individual product is sold in its own box which has an information label.
A bug report has been has been submitted on this program which is for printing out box labels.
The program should ask the user to input the product name, the frangrance, a batch code-number and the number of products in the batch. But it isn’t working.
We have checked the program and it looks like there is a problem in the line that sets up the for loop and also the variables inside the loop body also look mixed up. Can you help fix it?
Run and explore the program to identify errors.
Refer to the code clips and the sample output below to help you fix the errors.
Right click on your code and add a comment explaining what was wrong and how you fixed it.
Scents of Scotland: Natural Fragrances
Scottish Rose
Caledonian Pine
Hebridean Whisky
Highland Heather
Scents of Scotland: Artisan Products
Candles
Soap
Diffusers
Good luck! 🍀

Sample output

Enter product for this batch: Candles
Enter fragrance for this batch: Highland Heather
Enter batch code number: 31126
Enter number of products in this batch: 6
Scents of Scotland 🏴󠁧󠁢󠁳󠁣󠁴󠁿
Enjoy our hand-crafted Candles
Fill your home with the beautiful scent of Highland Heather
Quality Control: Batch#31126 - Serial#1
...........................................................

Scents of Scotland 🏴󠁧󠁢󠁳󠁣󠁴󠁿
Enjoy our hand-crafted Candles
Fill your home with the beautiful scent of Highland Heather
Quality Control: Batch#31126 - Serial#2
...........................................................

Scents of Scotland 🏴󠁧󠁢󠁳󠁣󠁴󠁿
Enjoy our hand-crafted Candles
Fill your home with the beautiful scent of Highland Heather
Quality Control: Batch#31126 - Serial#3
...........................................................

Scents of Scotland 🏴󠁧󠁢󠁳󠁣󠁴󠁿
Enjoy our hand-crafted Candles
Fill your home with the beautiful scent of Highland Heather
Quality Control: Batch#31126 - Serial#4
...........................................................

Scents of Scotland 🏴󠁧󠁢󠁳󠁣󠁴󠁿
Enjoy our hand-crafted Candles
Fill your home with the beautiful scent of Highland Heather
Quality Control: Batch#31126 - Serial#5
...........................................................

Scents of Scotland 🏴󠁧󠁢󠁳󠁣󠁴󠁿
Enjoy our hand-crafted Candles
Fill your home with the beautiful scent of Highland Heather
Quality Control: Batch#31126 - Serial#6
...........................................................
Share
 
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.