Gallery
Solution Debug 6.2. Counted Out
Share
Explore
Solution Debug 6.2. Counted Out

icon picker
The Task

Activity: Debug 6.2 Counted out 🐞

Start Here

A bug report has been has been submitted on this program. This program should print out Happy Birthday for each year of a person’s age. We have checked the proram and spotted that the head of the for loop looks a bit mixed up. Can you help fix it?
Run and explore the program to identify errors. Compare the output to the sample below.
Refer to the code clips 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.
Good luck! 🍀

Sample output

Enter your name: Abe
Enter your age: 14


Abe, here are 14 birthday wishes for you!


Happy Birthday to you!
Happy Birthday to you!
Happy Birthday to you!
Happy Birthday to you!
Happy Birthday to you!
Happy Birthday to you!
Happy Birthday to you!
Happy Birthday to you!
Happy Birthday to you!
Happy Birthday to you!
Happy Birthday to you!
Happy Birthday to you!
Happy Birthday to you!
Happy Birthday to you!
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.