In order to get into your secret club, someone needs to know the password! Write a program that asks the user for the password, if they get it wrong, tell them they are wrong, if they get it right, tell them they got it right. Use a loop to keep asking them until they get it right! The Password is: MA122

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 15E
icon
Related questions
Question

In order to get into your secret club, someone needs to know the password! Write a program that asks the user for the password, if they get it wrong, tell them they are wrong, if they get it right, tell them they got it right. Use a loop to keep asking them until they get it right!
The Password is: MA122

This is an example of interaction with the user. You are prompting the user with "What's the password? " and they are entering "cream", then they are told they are "Wrong!"… and this keeps looping.

What's the password? cream

Wrong!

What's the password? dog

Wrong!

What's the password? MA122

Correct!

 

 

 

JAVA

Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Basics of loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,