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
elixir [45]
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. Use the up or down arrow keys to change the height.
Computers and Technology
1 answer:
____ [38]3 years ago
4 0

Answer:

count_land = count_air = count_water = 0

while True:

   s = input("Enter a string: ")

   if s == "xxxxx":

       break

   else:

       if s == "land":

           count_land += 1

       elif s == "air":

           count_air += 1

       elif s == "water":

           count_water += 1

print("land: " + str(count_land))

print("air: " + str(count_air))

print("water: " + str(count_water))

Explanation:

*The code is in Python

Initialize the variables

Create a while loop that iterates until a specific condition is met. Inside the loop, ask the user to enter the string. If it is "xxxxx", stop the loop. Otherwise, check if it is "land", "air", or "water". If it is one of the given strings, increment its counter by 1

When the loop is done, print the number of strings entered in the required format

You might be interested in
Which is the highest level of the hierarchy of needs model?
galben [10]

Answer:

A

Explanation:

3 0
3 years ago
What do you click to create a new presentation in Normal view? A. Section B. Blank Presentation C. Layout D. New Slide
Kazeer [188]
B. Blank presentation, this way you have a normal view presentation but you can also add your own features.
3 0
2 years ago
Read 2 more answers
What facilitates the automation and management of business processes and controls the movement of work through the business proc
zhenek [66]

Answer:

D. Workflow management systems

Explanation:

Workflow management systems can be defined as a strategic software application or program designed to avail companies the infrastructure to setup, define, create and manage the performance or execution of series of sequential tasks, as well as respond to workflow participants.

Some of the international bodies that establish standards used in workflow management are;

1. World Wide Web Consortium.

2. Workflow Management Coalition.

3. Organization for the Advancement of Structured Information Standards (OASIS).

Workflow management systems facilitates the automation and management of business processes and controls the movement of work through the business process.

<em>The following are various types of workflow management systems used around the world; YAWL, Windows Workflow Foundation, Apache ODE, Collective Knowledge, Workflow Gen, PRPC, Salesforce.com, jBPM, Bonita BPM etc.</em>

3 0
3 years ago
Convert the following binary to decimal number . <br>a). 101101 ​
KonstantinChe [14]
First things first you have to do write it down which you did
step 2: then you multiply each digit of the binary number by the corresponding power of 2: 1x25 + 0x24 + 1x23 + 1x22 + 0x21 + 1x2 0
step 3: solve the powers: 1x32 + 0x16 + 1x8 + 1x4 + 0x2 + 1x1 = 32 + 0 + 8 + 4 + 0 + 1
step 4: add the numbers written above

32 + 0 + 8 + 4 + 0 + 1 = 45.
So, 45 is the decimal equivalent of the binary number 101101.
5 0
2 years ago
Read 2 more answers
Quick!!!!!
Vlad [161]

Answer:

B. the current affairs page

Explanation:

it's a simple question

8 0
3 years ago
Read 2 more answers
Other questions:
  • I NEED HELP NOW PLEASE!!!!!!
    6·2 answers
  • When does state law require drivers to use their headlights (6)
    11·2 answers
  • What is the Matlab command to create a vector of the even whole numbers between 29 and 73?
    11·1 answer
  • Which of the following actions might contribute to recommendations you see online?
    6·1 answer
  • A group of computers that are interconnected in order to share information or documents is called a _____.
    7·1 answer
  • Technician A says that S-cams can be left or right handed. Technician B says that S-cam foundation brakes can have one or two an
    15·1 answer
  • What language must be used to display a bare-minimum webpage?
    8·2 answers
  • What functions do these WLAN applications and tools perform on WLANs: airmonng, airodump-ng, aircrack-ng, and aireplay-ng
    10·1 answer
  • When Creating a FPS game what basic rules would you add?
    12·1 answer
  • PowerPoint is best described as:
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!