-4

Using the code from the second and third videos, change them to prompt the user for information. On the password video (2nd one), once you write the code to prompt the user for a 4 character password, see if you can also print a “Wrong, try again” message if it is entered incorrectly. (Hint, use an if else).

Video 2: AP Computer Science If Statements (comparing Strings)
Video 3: AP Computer Science if statements with "multiple" boolean expressions

I need help finding a way to prompt the user for a password and then saying if it is right or wrong (can use Jscanner).

karel
  • 3,880
  • 31
  • 37
  • 42

1 Answers1

0

Asking people to watch the videos is not a good idea and you should try to upload a basic code so we can guide you. I did a basic skim and I believe you will need to import this

import java.util.Scanner

Look up the documentation for the Scanner to learn how to use it. To check if the password is correct, the basic loop goes like this ( which you could have easily looked up)

if (password is correct){
    do something
}
else{
    the message you wanted to print
}
amay20
  • 97
  • 1
  • 1
  • 8