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
Vikentia [17]
3 years ago
14

Write a loop that reads strings from standard input where the string is either "land", "air", or "water". The loop terminates wh

en "xxxxx" (five x characters) is read in. Other strings are ignored. After the loop, your code should print out 3 lines: the first consisting of the string "land:" followed by the number of "land" strings read in, the second consisting of the string "air:" followed by the number of "air" strings read in, and the third consisting of the string "water:" followed by the number of "water" strings read in. Each of these should be printed on a separate line. mathew m
Computers and Technology
1 answer:
Setler79 [48]3 years ago
5 0

The loop terminates when "xxxxx" is read in. If the word is land, the string followed by "land" get outputted. The same with air, and water.

Explanation:

int land = 0;

int air = 0;

int water = 0;

String word = "";

while(!(word.equals("xxxxx"))) {

word = stdin.next();

if(word.equals("land")) {

   land++;

}else if(word.equals("air")) {

   air++;

}else if(word.equals("water")) {

   water++;

}  

}

System.out.println("land:" + land);

System.out.println("air:" + air);

System.out.println("water:" + water);

You might be interested in
What is the Multiple Source Test
Goshia [24]
A source is where you can look to find info. Multiple means many or some. 

Therefore, a multiple source test is a test that you can find the answers in multiple sources, such as a book, article, journal, etc. 
7 0
3 years ago
Read 2 more answers
When we type there Is blue like thing blinking what's that called ​
taurus [48]

Answer:

a cursor? I think.

3 0
3 years ago
Read 2 more answers
What test must you pass to get you're operators licence
Alina [70]
Behind the wheel, the Florida driving test, turn about, shifting gears, parking, backing up, stop quickly, stop signs, signal & turns
5 0
3 years ago
Data that can be used to identity a single individual is known as
lys-0071 [83]

Answer:

Fingerprint Recognition

Explanation:

3 0
3 years ago
um I'm new and I just sign up like right now and brainly says I've reached my daily limit for my questions why?
Natalija [7]

Answer:

Im not sure why but maybe you can find a way to contact the people who own it and see if they know because that hasn't happened to me. How many questions have you asked

Explanation:

7 0
3 years ago
Other questions:
  • Write a program that tells what coins to give out for any amount of change from 1
    6·1 answer
  • Client/server awareness. Visit three local stores in your neighborhood or mall and notice the information technology in the stor
    9·2 answers
  • Define critical thinking, and list the mental activities involved in critical thinking.
    8·2 answers
  • Which of the following best describes the purpose of a design specification?
    14·2 answers
  • Which of the following is a valid HTML reference to a CSS file?
    13·1 answer
  • What are some examples of what can be changed through options available on the mini toolbar
    5·1 answer
  • (TCO B) The symbol shown as a three-sided box that is connected to the step it references by a dashed line is what?
    12·1 answer
  • Chantelle wants to change the color scheme for her company's web app, and she needs to get the logos updated. What kind of devel
    8·1 answer
  • How do you open an application on the macOS?
    11·2 answers
  • A laptop can be kept on palm to work. [true/false) ​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!