Question: Write a program that works according to the following selection structure: 1 . Ask if the user wants to stop running the program or not.

Write a program that works according to the following selection structure:
1. Ask if the user wants to stop running the program or not. If the user enters the letter 'Y',
stop the program execution with the output "Bye!" (see Example run 1). If the user
enters the letter N, then move to the next steps.
2. Ask the user for name and password.
3. If the name is "Pekka" and the password is "somerandomthing", print the text: "User
recognized!" and end the program execution (see Example run 2)
4. Otherwise, print the length of the name and the information that the name or the
password was not correct: "You entered an invalid login name or password."

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!