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
How Extreme Programming addresses Software Testing andevolution ?
kumpel [21]

Answer:

Extreme programming is a software development technique which is used to enhance software quality and it's response to ever changing customer requirements.

Testing

Testing is main focus in extreme programming.Extreme programming addresses testing in a way that if a minute testing can eliminate a bit of flaws, extensive testing can terminate a lot of flaws.

Evolution in Extreme programming is like this:-

Coding:-First programmers will code the problem.

Testing :- Testing is done to remove flaws.

Listening:- Programmers must listen to the customers to what they need.

Designing:-Then design according to the customer needs.

6 0
3 years ago
For each problem listed below, use the drop-down menu to select the field of the professional who can help solve the issue.
Lapatulllka [165]

Answer:

An employee is having trouble opening a file on a computer.

  • → ✔ <u>information services and support</u>

The president of a company wants to give the company website a fresh new look.

  • → ✔ <u>interactive media</u>

An employee wants to work from home but can’t connect to the network from there.

  • → ✔ <u>network systems administration</u>

The vice president of sales would like help designing a new software program to keep track of sales.

  • → ✔<u> programming and software development</u>

<u>OAmalOHopeO</u>

5 0
2 years ago
Read 2 more answers
Which software is used to play, create, and modify audio and video files?
igor_vitrenko [27]
Video Editing software is used to play, create, and modify audio and video files. 
7 0
3 years ago
Read 2 more answers
What is your perception of what a safe classroom looks like
Andreyy89

Answer:

6 feet apart

Explanation:

6 0
3 years ago
What are the differences between packet and circuit switching? Which is more prevalent today?
Juliette [100K]

Answer: The difference present between the packet switching and circuit switching are as follows:-

  • Packet switching i the switching in which the data packet travels through the connectionless path whereas connection oriented routes are present for circuit switching
  • Network layer uses the feature of packet switching while physical layer uses circuit switching technique
  • Data transferring is mostly preferred through packet switching and voice communication takes place through the circuit switching.
  • Packet switching is considered flexible as no already established connection is present for switching but the connection in circuit switching are already defined which makes it less flexible.

Among the packet switching and circuit switching , packet switching is preferred for the communication through the data packets because they have  flexibility and affordability.It can establish numerous connection for switching and this make it efficient.

4 0
3 years ago
Other questions:
  • HELP NOW PLZZ/ Question: Complete the sentence with the correct response.
    11·1 answer
  • Difference between implicit and explicit type casting
    7·2 answers
  • True or false: when considering data backups, it is most important to verify that the integrity of the backup file or data is va
    9·1 answer
  • Where do you go to create a workbook?​
    8·1 answer
  • When it comes to collecting and organizing prospect and account​ information, salespeople have a large variety of computer syste
    15·1 answer
  • How do I type over Images (photo posted ​
    12·2 answers
  • What is the cpu used for
    6·1 answer
  • Which statements are true? Select 4 options.
    9·1 answer
  • Arrange these steps of creating a presentation in the correct order. (notice that the given order is incorrect other than the ba
    13·1 answer
  • Short notes on primary key​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!