1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Alex17521 [72]
3 years ago
5

write a java program using a do while loop to prompt the user to enter a password. The user should be prompted to enter the pass

word until the correct password "pals" is entered.
Computers and Technology
1 answer:
Alex787 [66]3 years ago
3 0
We can import Scanner from Java.utils.Scanner to pull in text entered in the console.

public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String password = "";
do {
System.out.print("Enter your password: ");
password = sc.nextLine();
if(!password.equals("pals") {
System.out.println(\nIncorrect Password. Try again.");
}
} while(!password.equals("pals");
You might be interested in
Read the following scenario, and then answer the question.
maxonik [38]

Answer:

Monitor size

Explanation:

Hope this helps

4 0
2 years ago
Read 2 more answers
What do HIPAA guidelines protect?
Kruka [31]

Answer:

They protect patient medical records im pretty sure

Explanation:

7 0
2 years ago
What are the best apps to learn coding
Soloha48 [4]
Khan Academy is a good website and also has an app
6 0
3 years ago
Read 2 more answers
What is the purpose of the green flag in the Scratch interface?
Len [333]

Answer:

C. It begins the program.

Explanation:

4 0
3 years ago
Read 2 more answers
An artificial satellite in which people can live and work for long periods is called a
morpeh [17]
A space station is an artificial satellite in which people can live and work for a long period of time. Space station is placed on the space for the astronaut in researching things on the space and universe.
8 0
3 years ago
Read 2 more answers
Other questions:
  • The best advice for setting a study session is
    10·1 answer
  • When you park facing downhill and there is a curb, turn your wheels _____ the curb. When you park facing uphill and there is a c
    13·2 answers
  • Can some one fix this <br> input ("Enter a number: ") <br> print (num * 8)
    9·1 answer
  • Which of these engine components forms a tight seal between the piston and the cylinder and is necessary for proper engine opera
    13·2 answers
  • If a fire should break out in your building, which of the following actions is NOT recommended?
    9·2 answers
  • Quick!!!!!
    13·2 answers
  • I connected to an external hard drive to transfer some photos from my vacation. When I try to drag the photo, it bounces right b
    14·1 answer
  • Which of the following statements tests if users walked 10,000 or more steps and ate fewer than 25 grams of sugar?
    9·1 answer
  • python Which data type is the best choice to store the number of wins associated with each basketball team in the NBA
    12·2 answers
  • Frequently used _____________ can be saved as _____________ for use in analysis, dashboards, reports, tickets, and alerts.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!