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
Hey! I was recommended a site “9anime” the other day. All’s been going well but I accidentally taped on a new dub settingZ somet
Studentka2010 [4]

Answer:

yep defiantly virus

Explanation:

8 0
2 years ago
Read 2 more answers
A ____ is a synonym for a virtualization application.
forsale [732]

hypervisor is the answer

3 0
4 years ago
Using the C language, write a function that accepts two parameters: a string of characters and a single character. The function
Sav [38]

Answer:

#include <stdio.h>

void interchangeCase(char phrase[],char c){

  for(int i=0;phrase[i]!='\0';i++){

      if(phrase[i]==c){

          if(phrase[i]>='A' && phrase[i]<='Z')

              phrase[i]+=32;

          else

              phrase[i]-=32;      

      }

  }

}

int main(){

  char c1[]="Eevee";

  interchangeCase(c1,'e');

  printf("%s\n",c1);

  char c2[]="Eevee";

  interchangeCase(c2,'E');

  printf("%s\n",c2);    

}

Explanation:

  • Create a function called interchangeCase that takes the phrase and c as parameters.
  • Run a for loop that runs until the end of phrase and check whether the selected character is found or not using an if statement.
  • If the character is upper-case alphabet, change it to lower-case alphabet and otherwise do the vice versa.
  • Inside the main function, test the program and display the results.
8 0
3 years ago
A user reports that nothing happens when he or she attempts to print from the computer at his desk. This points to a possible pr
Mandarinka [93]

The Problem is either File Management or Disk access but the most common issue is due to File management

5 0
3 years ago
Features of Python are *
Nonamiya [84]

Answer:

a

Explanation:

Python is platform independent, it can be ran on any operating system.

4 0
3 years ago
Other questions:
  • Makes it possible to distribute both power and data using ethernet cabling. select one:
    12·1 answer
  • How do i end my current plan that i never signed up for, the basic one it charged me $24
    11·2 answers
  • What is Livvyo? Livvyo review
    8·1 answer
  • How many fields can be sorted when sorting data in Word tables? up to 3 fields 1 field at a time up to 4 fields 2 fields at a ti
    7·2 answers
  • Hi Alaza, when you submit this form, the owner will be able to see
    12·1 answer
  • A _______ is a website specially designed to allow visitors to use their browser to add, edit, or delete the site's content.
    9·2 answers
  • Which graphic file format is used for commercial purposes.
    10·1 answer
  • What is the best resource to learn python?
    14·2 answers
  • Rudy accidentally sent a sensitive work report to a personal friend named James instead one of his co-workers, who is also named
    6·1 answer
  • What type of attack uses many systems to flood the resources of a target, thus making the target unavailable?.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!