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
The colors of the pixels in a digital image are often represented by red, green, and blue values
maw [93]

Answer:

Lossless Transformation

Explanation:

3 0
3 years ago
The incandescent test lamp is used to check for the presence of A. AC current. B. DC voltage. C. DC current.
andriy [413]
Incandescent test lamps are used to check for Alternating Current Voltage and Direct Current Voltage. 

The answer is AC Voltage and DC Voltage. 
5 0
3 years ago
Read 2 more answers
When does personal information often need to be entered online?
soldi70 [24.7K]

Answer:

Like when your doing an application for a job or anything important lol

Explanation:

3 0
3 years ago
What are the lines of communication on a motherboard?
mixas84 [53]

Answer:

buslines

Explanation:

hybfndndndjdkd

3 0
3 years ago
Write the following arithmetic expression as a valid C arithmetic expression: C = (F - 32) / 1.8
Advocard [28]

Answer:

C = (F - 32)/1.8

Explanation:

Given

C = (F - 32)/1.8

Required

Write an equivalent expression in C

The given expression uses

brackets ();

Subtraction -

and

Division /

In C,

Bracket is represented using ()

Subtraction is represented using -

Division is represented using /

Hence

The equivalent of C = (F - 32)/1.8 in C is

C = (F - 32)/1.8

4 0
3 years ago
Other questions:
  • After earning a learners license what test must be successfully passed to earn an operators license in Florida
    14·1 answer
  • The Campus Housing Service helps students find apartments. Owners of apartments fill in information forms about the rental units
    14·1 answer
  • (Game Design) Which of the following is NOT a name of a popular digital sculpting application?
    13·1 answer
  • What is Boolean algebra
    14·2 answers
  • What can be designed to create annoying glitches or destroy data
    15·2 answers
  • A website that sells high-end ties notices that its ads are showing up for searches that include "cheap". Because its ties are e
    14·1 answer
  • To reload a picture taken with a digital camera means to copy the digital picture from the camera to your computer.
    5·2 answers
  • . Write the advantages and disadvantages of CLI?
    14·2 answers
  • Consider the following method.
    14·1 answer
  • Language is Python
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!