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 redundancy? What problems are associated with redundancy?
Anarel [89]

Answer:

Redundancy is the mechanism that occurs in database's data as the same data is stores in the multiple location.It creates repeated data by accident or for backup purpose.

The issues that arise due to the redundancy of the data is the storage space in database gets consumed and thus wastes the space in storing information in multiple locations.When any update occurs in the stored data's field value , it also has to be changed in the multiples occurrences.

5 0
3 years ago
Which of formula contains an absolute cell reference?
svet-max [94.6K]
Which formula contains an absolute cell reference? =SUM($B$7:$B$9)
3 0
2 years ago
How can my computer catch a virus?
Lapatulllka [165]
By going on sites that are not secure or dowloding thigs 
4 0
3 years ago
A healthcare start-up is using Artificial Intelligence (AI) to test the way a person speaks in order to detect Alzheimer's disea
Pie

Answer:

Algorithmic bias.

Explanation:

An algorithm can be defined as a standard formula or procedures which comprises of set of finite steps or instructions for solving a problem on a computer. The time complexity is a measure of the amount of time required by an algorithm to run till its completion of the task with respect to the length of the input.

An algorithmic bias can be defined as a systematic error or prejudice in a computer algorithm which typically generate outcomes that are unfair or unfavorable and as such giving unparalleled privileges to a demography (users) over the rest users.

In this scenario, a healthcare start-up is using Artificial Intelligence (AI) to test the way a person speaks in order to detect Alzheimer's disease. The algorithm interprets pauses and differences in pronunciations as markers of the disease. The developers used a dataset that contains only speech samples from native English speakers. Thus, the type of bias that is present in this example is an algorithmic bias.

8 0
2 years ago
Which error produces incorrect results but does not prevent the program from running?
rusak2 [61]
The logic error produces incorrect results but does not prevent the program from running. The other name for the logic error i<span>n computer programming is bug. When present , this type of error does not terminate (crash) the program, but cause the program to operate incorrectly. Bugs are very hard to find in a program. </span>
4 0
3 years ago
Other questions:
  • It is a good idea to use more than one typeface in a document when _____.
    8·2 answers
  • A ________ -tier design includes a middle layer between the client and server that processes the client requests and translates
    11·1 answer
  • Jennifer recently bought a new computer to type a new manuscript she’s been working on. She also stored a lot of movies on it to
    10·1 answer
  • 1. Actuators apply mechanical force in the form of pressure to overcome
    10·1 answer
  • How many generations of computer languages have there been since the middle of the 20th century?
    10·1 answer
  • Keyboards that are widely used on various smartphones and other small portable devices, and which are designed primarily for com
    15·1 answer
  • Double[][] vals =
    8·1 answer
  • Rutherford concluded from his calculations that the volume of an atom is filled with protons, neutrons and electrons. is mostly
    14·1 answer
  • Which tab of the ribbon includes the links group for creating hyperlinks or internal references?
    13·2 answers
  • Draw truth table for the following logic circuit:<br><br> (Please I really need help with this)
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!