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
Heather writes an essay for language arts and receives a poor grade. To figure out why she gets a poor grade, Heather looks at t
Kazeer [188]

Answer:

Glows and grows strat

Explanation:

4 0
3 years ago
Read 2 more answers
A CPU has just been powered on and it immediately executes a machine code instruction. What is the most likely type of instructi
adell [148]

The most likely type of instruction that was executed by the CPU is: a jump instruction.

<h3>What is a CPU?</h3>

A central processing unit (CPU) can be defined as the main components of a computer because it acts as the brain of a computer and does all the processing and logical control.

This ultimately implies that, a central processing unit (CPU) is typically used by a computer to execute an instruction or set of instructions when powered on.

<h3>What is a jump instruction?</h3>

In Computer technology, a jump instruction specifies an offset to a new place in the program sequence when processing an instruction or set of instructions in a computer.

Read more on CPU here: brainly.com/question/5430107

3 0
2 years ago
A SOHO's connection to the internet is through an antenna that sends and receives a microwave signal to the ISP's antenna. There
aksik [14]

Answer:

Line of sight wireless

Explanation:

Line of sight wireless are wireless which enable antenna to sends and receives a microwave signal to the ISP's antenna

By standing between the mounted antenna at client building so that the other side of the wireless connection you intend to create can be visible.

Line of Sight wireless also provide electro-magnetic radio waves that tends to be less affected by external forces leading to better connection reliability because all wireless networks excel only with true line of sight that is why it is always advisable that the antennas are mounted above the tree line, to ensure proper connections without obstacles between them since

Line of sight depend on having a clear line of sight between the antenna and the hotspot .

3 0
3 years ago
Linux is: Select one: a. primarily concerned with the tasks of end users. b. designed for specific machines and specific micropr
ivann1987 [24]

Answer:

C. an example of open-source software.

Explanation:

open-source software is the type of software in which anyone can access, it can also be shared And modified by anyone simply because ita accessible to the public.

Hence and open source software's source code can be

inspected, enhanced and modified by anyone. A typical example is Linux.

7 0
3 years ago
Which of the following is an example of data an Earth-observing satellite would collect?
Natalka [10]

Answer:

A

Explanation:

Hopefully this helps

4 0
2 years ago
Other questions:
  • A technician wants to create a new partition on a new additional hard drive. what tool should be used?
    15·1 answer
  • Which of the following means to find and fix errors in code?Which of the following means to find and fix errors in code?
    5·1 answer
  • The Coins class was created to hold all your loose change, kind of like a piggy bank! For this exercise, you are going to simula
    15·1 answer
  • Edhesive 3.2 Lesson Practice question 1
    5·1 answer
  • What are two types of crust on the earths surface
    15·2 answers
  • 3. Choose the statement that best describes a ray. A ray extends forever in both directions. B ray is a part of a line with two
    10·1 answer
  • Define artificial intelligence?​
    15·2 answers
  • Which tab is the "page break" command found on? (there are two!) *
    5·1 answer
  • Think of some local businesses that have websites. Look online and identify two different websites for businesses or services in
    14·1 answer
  • I have a problem. I can't cycle between game packs on my strike pack, I've watched so many vids I'm on Xböx and I'm holding the
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!