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
DaniilM [7]
1 year ago
13

Write a loop that continually asks the user what pets the user has until the user enters stop, in which case the loop ends. It s

hould acknowledge the user in the following format. For the first pet, it should say You have one cat. Total # of Pets: 1 if they enter cat, and so on.
Sample Run
What pet do you have? lemur
What pet do you have? parrot
What pet do you have? cat
What pet do you have? stop
Sample Output
What pet do you have? lemur
You have one lemur. Total # of Pets: 1
What pet do you have? parrot
You have one parrot. Total # of Pets: 2
What pet do you have? cat
You have one cat. Total # of Pets: 3
What pet do you have? stop
Computers and Technology
1 answer:
Nataliya [291]1 year ago
6 0

Answer:

int counter = 0;
String userInput = "";
while (userInput != "stop") {
print "What pet do you have? ";
userInput = readInputLine();
if (userInput != "stop" ){
counter = counter + 1;
print "\nYou have one ";
print userInput;
print ". Total # of Pets: ";
print counter;
}
}

Explanation:

not sure what programming language you use, therefore the answer is pseudocode but it should give you an idea how to implement a piece of code for this problem.
Also, from the way you described the exercise I'm not sure if you always are supposed to reply with "you have one" + the pet or if you should count how often the same pet was entered.

You might be interested in
_______ integrates all departments and functions throughout an organization into a single IT system (or integrated set of IT sys
aleksklad [387]

Answer:

ERP ( Enterprise Resource Planning )

Explanation:

ERP mainly stands for enterprise resource planning. ERP is system software which is a combination of many application which works together to automate a business process.  

It is a business management software which reduces the wastage of time by making tasks simpler like when we talk about accounting and stock in a company, it takes very much time when maintaining by humans but when it comes to ERP software, it only takes a while to give you detailed information about everything. It automates the manual process of a company and gives speed to the growth of the company.

3 0
2 years ago
The following code processes a file containing five positive numbers. What will the variable $result contain after the code is e
Tanzania [10]

Answer:

highest of five numbers in the file

Explanation:

  • This code reads the file "some-file.txt" and saves the result in variable "somefile"
  • The runs a for loop for a count of 5.
  • In each loop it compares the current value of the file with the value of the variable result and if the result is true it updates the value of the variable result.
  • At the end of this code the variable result will contain the highest value in the file "some-file.txt" and print it.

3 0
3 years ago
Which type of cause and effect organizer would be best for alisha to understand how crude oil becomes gasoline?
sukhopar [10]
The answer is 100% B. Flow chart.
5 0
3 years ago
Read 2 more answers
Write an application that prompts a user for a month, day, and year. Display a message that specifies whether the entered date i
gizmo_the_mogwai [7]

Answer:

Following is given the code with all necessary description given as comments in it. I hope it will help you!

Explanation:

4 0
2 years ago
Sort the following everyday examples of sedimentary processes into the bins labeled with the sedimentary processes they most clo
Firlakuza [10]

The Sorting of the  examples of sedimentary processes are:

  • Sediment Erosion/transport - The dirt going down the drain after you give your dog a bath and drain the tub Dirt being blown off a patio
  • Deposition of sediment - Dust collecting on furniture
  • Weathering of rock - Tree roots extending into a rock layer and breaking it down Ice expanding in a crack in the road creating a pothole
  • Compaction/lithification - A dump truck dumps a load of gravel on your lawn. The dirt below it becomes more consolidated

<h3>What is the sedimentary process known as?</h3>

Sedimentary rocks are said to be the outcome of

1) The weathering of preexisting rocks,

2) The transport of the weathering products,

3) The  deposition of the material.

4) The  compaction process.

5) The cementation of the sediment to form a rock.

This is known to be the most vital geological processes that has lead to the making of sedimentary rocks such as due to erosion, weathering, dissolution, and others

Therefore, The Sorting of the  examples of sedimentary processes are:

  • Sediment Erosion/transport - The dirt going down the drain after you give your dog a bath and drain the tub Dirt being blown off a patio
  • Deposition of sediment - Dust collecting on furniture
  • Weathering of rock - Tree roots extending into a rock layer and breaking it down Ice expanding in a crack in the road creating a pothole
  • Compaction/lithification - A dump truck dumps a load of gravel on your lawn. The dirt below it becomes more consolidated

See full question below

Sort the following everyday examples of sedimentary processes into the bins labeled with the sedimentary processes they most closely represent. Drag the appropriate items into their respective bins View Available Hint(s) Reset Heip A dump truck dumps a load of gravel on your lawn. The dirt below it becomes more consolidated Dirt being blown off a patio Ice expanding in a crack in the road Dust collecting on furniture creating a pothole Tree roots extending into a rock layer you give your dog The dirt going down the drain after a bath and drain the tub and breaking it down Sediment Erosion/transport Deposition of sediment Weathering of rock Compaction/lithification

Learn more about sedimentary processes from

brainly.com/question/13291293

#SPJ1

4 0
1 year ago
Other questions:
  • The inside color of text or of an object is called the:
    12·1 answer
  • In this website/app what are the points for?
    7·1 answer
  • How do you create a logo on Adobe illustrator
    8·1 answer
  • Help please brainliest
    8·1 answer
  • The M:N relationship between STUDENT and CLASS must be divided into two 1:M relationships through the use of the ENROLL entity;
    10·2 answers
  • A(n) ____ uses the communication interface to request resources, and the server responds to these requests.
    15·1 answer
  • which of the following statements about matter is true a.matter is anything that occupies space and possesses mass b.matter can
    5·2 answers
  • For anyone who plays warzone, do you think the hdr has earned its spot back after the spr nerf? Be completely honest plz.​
    8·1 answer
  • Krya needs help deciding which colors she should use on her web page. What can she use to help her decide.
    11·1 answer
  • How can random numbers in a range be generated in Java?.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!