Gallery
Debug 5.2. Worst Password
Share
Explore
Debug 5.2. Worst Password

icon picker
The Task

Activity: Debug 5.2 If else 🐞

Start Here

A bug report has been has been submitted on this program. This program should quiz the user about the most common (worst) password. The program does not always process the answer correctly, sometimes it displays both replies instead of only one. Can you work out what is going wrong and fix it?
The worst password is 123456 but all the examples in the program are truly awful!
Run and explore the program to identify errors. You will need to enter each option to discover the error.
Refer to 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

What is the most common password ?
enter 1 for : password
enter 2 for : 123456
enter 3 for : qwerty
enter 4 for : 12345

Please enter the number for answer: 3

It's pretty poor, but not the worst!
What is the most common password ?
enter 1 for : password
enter 2 for : 123456
enter 3 for : qwerty
enter 4 for : 12345

Please enter the number for answer: 2

Yes! Can you believe that?
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.