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
musickatia [10]
3 years ago
14

Write a class for a Cat that is a subclass of Pet. In addition to a name and owner, a cat will have a breed and will say "meow"

when it speaks. Additionally, a Cat is able to purr (print out "Purring..." to the console).
Computers and Technology
1 answer:
Nonamiya [84]3 years ago
4 0

Answer:

The Java class is given below with appropriate tags for better understanding

Explanation:

public class Cat extends Pet{

  private String breed;

 public Cat(String name, String owner, String breed){

      /* implementation not shown */

      super(name, owner);

      this.breed = breed;

  }

  public String getBreed() {

      return breed;

  }

  public void setBreed(String breed) {

      this.breed = breed;

  }

  public String speak(){ /* implementation not shown */  

      return "Purring…";

  }

}

You might be interested in
A _________ is a series of commands and instructions that you group together as a single command to accomplish a task automatica
melamori03 [73]
A macro is a series of commands and instructions that you group together as a single command to accomplish a task automatically.
8 0
3 years ago
Which of these is an example of gathering secondary data?
Soloha48 [4]

Answer:

searching for a chart

Explanation:

:)

7 0
3 years ago
Write a program that creates a dictionary containing the U.S. states as keys and their abbreviations as values. The program shou
AleksandrR [38]

Answer:

Explanation:

The following program is written in Python. It creates a loop that keeps creating a random number to randomly choose a State abbreviation from the dictionary. Then it asks the user what the state is. If the user gets the answer correct it prints out "Correct" and adds 1 point to the correct variables. Otherwise it prints "Incorrect" and adds 1 point to the incorrect variable. Finally, printing out the final amount of correct and incorrect responses. The program was tested and the output can be seen below.

import random

states = {"AL":"Alabama","AK":"Alaska","AZ":"Arizona","AR":"Arkansas","CA":"California","CO":"Colorado","CT":"Connecticut","DE":"Delaware","FL":"Florida","GA":"Georgia","HI":"Hawaii","ID":"Idaho","IL":"Illinois","IN":"Indiana","IA":"Iowa","KS":"Kansas","KY":"Kentucky","LA":"Louisiana","ME":"Maine","MD":"Maryland","MA":"Massachusetts","MI":"Michigan","MN":"Minnesota","MS":"Mississippi","MO":"Missouri","MT":"Montana","NE":"Nebraska","NV":"Nevada","NH":"New Hampshire","NJ":"New Jersey","NM":"New Mexico","NY":"New York","NC":"North Carolina","ND":"North Dakota","OH":"Ohio","OK":"Oklahoma","OR":"Oregon","PA":"Pennsylvania","RI":"Rhode Island","SC":"South Carolina","SD":"South Dakota","TN":"Tennessee","TX":"Texas","UT":"Utah","VT":"Vermont","VA":"Virginia","WA":"Washington","WV":"West Virginia","WI":"Wisconsin","WY":"Wyoming"}

keys_list = list(states)

correct = 0

incorrect = 0

while True:

   randNum = random.randint(0, 49)

   abbr = keys_list[randNum]

   answer = input("Enter The State name of " + abbr + ": ")

   if answer.lower() == states[abbr].lower():

       print("Correct")

       correct += 1

   else:

       print("Incorrect")

       incorrect += 1

   again = input("Play again? y/n ")

   if again.lower() == 'n':

       break

print("Correct: " + str(correct))

print("Incorrect: " + str(incorrect))

6 0
2 years ago
What term describes the process of transferring information from one computer to another
Flauer [41]

Syncing or maybe FTP or connection

5 0
3 years ago
If a car's is malfunctioning, people in the car will become ill when driving long distances, especially if the windows are close
galben [10]
The Carbon Monoxide will build up in the inside of the car by venting through, causing the passengers to breathe it. It will first make them ill, then kill them. They cannot detect this gas
5 0
3 years ago
Read 2 more answers
Other questions:
  • In a program called Nature's Notebook, citizen volunteers make and report observations about seasonal changes in plants and anim
    15·1 answer
  • What systemctl command configures a unit to start the next time the computer boots?
    10·1 answer
  • Which of the following commands contains an error?
    8·1 answer
  • What would happen if you clicked on the Show Desktop icon on your computer screen? The system tray would appear. All open window
    9·2 answers
  • Gabriel needs to create a formula that does not change when it is copied to cell b2. which formula should he create?
    14·1 answer
  • 1. select the correct answer from the given options.
    5·1 answer
  • Jill is configuring the AutoArchive feature in Outlook 2016. What is the default setting in relation to when AutoArchive
    8·1 answer
  • Suppose that a particular algorithm has time complexity T(n) = 3 \times 2^nT(n)=3×2 ​n ​​ and that executing an implementation o
    14·1 answer
  • From the time users first visit a new website, or view a new media piece, how much time will they spend on the site before they
    10·1 answer
  • In NumPy, the_______
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!