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
According to the lecture, in communication, men tend to value ____________.
Andru [333]

Answer:

respect?

Explanation:

8 0
3 years ago
list all columns of the resource table with a rate between $10 and $15 including the end points 10 and 15. Sort the result by ra
egoroff_w [7]

Answer:

select * from resources

where rate between 10 and 15

order by rate (ASC|DESC)

Explanation:

On Chegg + SQL textbook

(Here we are using * keyword to fetch all the records from resource table and between operator is used to fetch values between two vaues(values included).

Order By clause is used to sort the values and ASC is used with order by clause to sort in ascending order and DESC is used to sort in Descending Order.

By default if we do not specify anything then it will take ASC.

5 0
3 years ago
View cache files google chrome
Blizzard [7]

save to folder on desctop and use when

need to

7 0
3 years ago
The most basic business database is comprised of: three tables: for suppliers, parts, and sales. five tables: for customers, emp
DaniilM [7]

Answer:

The answers is: five tables: for customers, employees, suppliers, parts (or products), and sales.

Explanation:

A business database is an organized collection of information related to a business's activities. It helps organize information about your customers, sales, human resources and production.

Depending on the size of the company, databases can include huge amounts of information including past prices, profits, profit margins, alternative vendors, customer buying patterns, etc.

The basic information that should be included even for small companies is: clients, human resources, vendors, production, and sales.

4 0
3 years ago
What percentage of successful cyberattacks were caused by someone falling for a phishing attack?
zaharov [31]

Answer:

please

Explanation:

i also need the answer of it

7 0
3 years ago
Other questions:
  • When selecting text in word, holding down the ctrl key while clicking the mouse button will select the?
    15·1 answer
  • Write a definition of the function printDottedLine, which has no parameters and doesn't return anything. The function prints to
    14·1 answer
  • Give a recursive implementation for the function: def is_sorted(lst, low, high) This function is given a list of numbers, lst, a
    10·1 answer
  • A Windows user contacted the help desk with a problem that requires the technician to connect to the remote computer using Remot
    13·1 answer
  • Upon looking out at the
    8·2 answers
  • NAT ________. allows a firm to have more internal IP addresses provides some security both allows a firm to have more internal I
    5·1 answer
  • For a direct-mapped cache design with a 64-bit address, the following bits of the address are used to access the cache
    7·1 answer
  • You are traveling throughout North America to many metropolitan and rural areas. Which single form of internet connectivity prov
    12·1 answer
  • Both IT professionals and governments must apply ethical principles to certify that emerging technologies are to society.
    13·1 answer
  • Record the issue of 4,000 shares of $5 par value common stock for $35000 cash
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!