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
Roman55 [17]
2 years ago
6

Write a loop that continually asks the user what pets the user has until the user enters rock in which case the loop ends. It sh

ould acknowledge the user in the following format. For the first pet, it should say You have a dog with a total of 1 pet(s) if they enter dog, and so on

Computers and Technology
1 answer:
mote1985 [20]2 years ago
6 0

Loops are program statements that are repeated as long as the loop condition is true.

The loop in Python, where comments are used to explain each line is as follows:

#This initializes the number of pets to 0

count = 0

#This gets input for the pet name

pet = input("Pet: ")

#This is repeated until the user enters "rock"

while pet.lower() != "rock":

   #This increases the number of pets by 1

   count+=1

   #This prints the pet and the number of pets

   print("You have a",pet,"with a total of",str(count),"pet(s)")

   #This gets input for the pet name

   pet = input("Pet: ")

Read more about loops at:

brainly.com/question/19344465

You might be interested in
How do you design and create video games for what console game That you want To have it in
Yakvenalex [24]

Answer

Making a video game is much less daunting than it might seem. While you likely aren’t going to go from having no experience to making the next Grand Theft Auto, it has actually never been easier to get started making games. Game development tools and resources have become increasingly accessible to the average person, even if they have no programming experience. Often these tools are also available for free.

To try to make things easier for those looking to get started making games, we’ve put together a list of 11 game engines / editors. Some are designed for a specific genre of game or to be incredibly easy for newcomers. Others are professional development tools for AAA games, but are effectively free to use for hobbyists and still offer a lot of learning tools to help those with limited programming experience get started.

There are, of course, a lot of things that go into game development — music, animation, sound, writing, texturing, modeling, etc. — however, the game engine / editor you choose is going to have the biggest effect on what kind of game you can make. If you have suggestions for other engines, software, or learning tools for the other aspects of development, post it in the comments.

7 0
2 years ago
Identify the flaws / limitations in the following ConvertToNumber method:
lions [1.4K]

Answer:

Flaws and limitations identified in this program includes;

1.There was a not necessary usage of variable retrieval. Would have made use of canConvert.

2. Looking at the program, one will notice numerous typos. One of which is the fact that in JAVA we make use of Boolean instead of bool.

3.We rather use Integer.parseInt in JAVA and not Int16, cant make use of Int16.

4. The exception cant be printed

5. JAVA makes use of checkConversion instead of convertNumber as used in the program.

6. It cant work for decimal numbers, 0 and big integers.

Explanation:

See Answer for the detailed explaination of the flaws and limitations identified in the program.

4 0
3 years ago
Tina reported a safety hazard at her workplace to OSHA. Representatives from OSHA
Anna11 [10]

Answer:

The correct answer is: <em>Protection from Workplace Retaliation</em>

Explanation:

Protection from Workplace Retaliation is one of the 20 Whistleblower Laws enforced by OSHA. According to the Protection from Workplace Retaliation (PFWR) law, employers cannot treat employees unfairly in retaliation to employees reporting  workplace safety hazards to OSHA. The PFWR states that employers cannot retaliate by: denying employees leave, demoting them, firing them, reducing work hours, or denying them promotions.

In this case, Tina's employer violated the Protection from Workplace Retaliation law by giving her menial and difficult jobs in response to her reporting a safety hazard to OSHA.

8 0
3 years ago
WHAT ARE THE RISK OF DUST​
Step2247 [10]

Answer:

over heating

Explanation:

in computers dust acts as a blanket which traps heat, excessive heat causes components to burn up and short out

3 0
3 years ago
Suggest me a website or any channel for learning coding.
gulaghasi [49]

Answer: Codeacademy. One of the most popular free places to learn coding is Codeacademy.

Explanation:

6 0
3 years ago
Other questions:
  • What is an embedded system. Give examples
    12·1 answer
  • After modifying a numbered list in her presentation, Su notices the numbers and the text are too close to each other. She knows
    9·1 answer
  • Consider the concept of cultural lag. Identify two American values that are “lagging.” What are three norms that are lagging? Ho
    11·1 answer
  • a. Show the output of the following program: 1: public class Test { 2: public static void main ( String [] args ) { 3: A a = new
    14·1 answer
  • Properly defined the primary part of a CPU​
    5·1 answer
  • Write a while statement that prints all even numbers between 1 and 100 to the screen.
    6·1 answer
  • #include &lt;iostream&gt;
    9·1 answer
  • help:(What are the uses of various lights? How are they all different? How do you decide on their usage? How can you use natural
    9·1 answer
  • At what layer in the TCP/IP protocol hierarchy could a firewall be placed to filter incoming traffic by means of:
    5·1 answer
  • How to create create a database in mysql using clv files
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!