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.
1 answer:
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
Answer:
Monitor size
Explanation:
Hope this helps
Answer:
They protect patient medical records im pretty sure
Explanation:
Khan Academy is a good website and also has an app
Answer:
C. It begins the program.
Explanation:
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.