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
jonny [76]
3 years ago
10

For this exercise, you are going to create a part of an Animal hierarchy. Unlike some of our examples and the previous exercises

, this exercise is going to have 3 levels in the hierachry.
At the top is the Animal class. Below that, we are going to have a subclass for Pets. Under pets, we are going to have 2 subclasses, Dogs and Fish.
You will need to create your class hierarchy and add instance variables, getters, and setter methods to accommodate the following information:
I need to save what type of animal I have (String variable)
I want to be able to save a name for my fish and dog (String variable)
I want to know which fish need salt water v. fresh water (String variable)
I want to know if my dog has been trained (boolean variable)
I want to know the size of my dog and fish (String variable)
Make sure you use common sense names for your variables!
public class Animal
{
}
public class Fish extends Pet public class Pet extends Animal public class Dog extends Pet
{ { {
} } }
Computers and Technology
1 answer:
kati45 [8]3 years ago
5 0

Answer:

vehicle super class 9.1.4

Explanation:

So you need to create a super class containig all the animals use the class above for referance

You might be interested in
What is MARC? Discuss structure of MARC
nordsb [41]
What do you mean? I don't understand.
7 0
3 years ago
Write one line of code to print animals, an array of Animal objects.
oksian1 [2.3K]

Answer:

console.log(Animal);

Explanation:

The statement written above prints the array Animal which contains objects.There are two to three ways to print the array Animal in javascript. One of the method is written in the answer it prints the arrays in the console of the browser.

You can go to the console by pressing F12 and then clicking on the console.

Other methods to print are

  1. Simple write Animal after defining the array.
  2. Use alert.
  3. document.write()
7 0
3 years ago
TIME REMAINING 01:48:57 What is the purpose of the website directory provided by the website host? to look up user account infor
muminat

Answer:

Cookie

Explanation:

its just because and also the answer is right on e 2020.

8 0
3 years ago
Read 2 more answers
Please post detailed answers to the following questions. Please use complete sentences.
Aloiza [94]

Please post detailed answers to the following questions. Please use complete sentences t two artists from the following list: Phil Borges,Lee Jeffries.

<h3>What are photography opportunities?</h3>

The taking of constant or nevertheless snap shots furnished a brand new medium with which to seize reality, and modified the manner humans in general, and artists in particular, noticed the arena and created new inventive opportunities. Learning from the technological know-how of photography, artists evolved a selection of the latest portrayal techniques.

Photography modified our imaginative and prescient of the arena with the aid of using presenting greater get entry to to greater snap shots drawn from greater locations and instances withinside the global than ever before. Photography enabled snap shots to be copied and mass-distributed. The media-sphere became burgeoning.

Read more about the internet :

brainly.com/question/2780939

#SPJ1

4 0
2 years ago
A painting company has determined that for every 115 square feet of wall space, one gallon of paint and eight hours of labor wil
Reptile [31]

Answer:

Follows are the code to the given question:

Wallsize = int(input("Enter the size of wall space for painting(in sq ft): "))#defining variable Wallsize for input value  

rate = int(input("Enter the price of the paint(per gallon): $"))#defining variable rate for input value

per_Gallon = Wallsize/115#defining a variable per_Gallon that calculate its value

print("Number of Gallons of paint: ",per_Gallon)#print value with message

total_Hours = per_Gallon * 8#defining a variable total_Hours that calculate its value

print("Hours of labor required: ",total_Hours)#print value with message

paint_Cost = rate * per_Gallon#defining a variable paint_Cost that calculate its value

print("Cost of the paint: $",paint_Cost)#print value with message

labor_Charge = total_Hours * 20#defining a variable labor_Charge that calculate its value

print("Labor charges: $",labor_Charge)#print value with message

total_Cost = paint_Cost + labor_Charge#defining a variable total_Cost that calculate its value

print("Total cost of paint job: $",total_Cost)#print value with message

Output:

Enter the size of wall space for painting(in sq ft): 800

Enter the price of the paint(per gallon): $33

Number of Gallons of paint:  6.956521739130435

Hours of labor required:  55.65217391304348

Cost of the paint: $ 229.56521739130434

Labor charges: $ 1113.0434782608695

Total cost of paint job: $ 1342.6086956521738

Explanation:

Please find the complete question in the attached file.

In this code, the "Wallsize and rate" two variable is defined that is used for input the value from the user-end, after input the value multiple variables"

per_Gallon, total_Hours,paint_Cost, labor_Charge, and total_Cost" is declared, in which it calculates its respective value and prints the value with the message value.

3 0
3 years ago
Other questions:
  • HELP ASAP!!!!!!!!! ITS A UNIT TEST: WILL MARK AS BRAINLIEST&gt;
    13·1 answer
  • Explain the steps users can take to maintain an operating system
    15·1 answer
  • A typeface in which each character has the same width and is often used to display programming code is _
    8·1 answer
  • Universal Container sales reps can modify fields on an opportunity until it is closed. Only the sales operations team can modify
    13·1 answer
  • What arw two reasons for maintaning your privacy on the internet
    11·2 answers
  • A digital designer might do computer animation or video games true or false
    13·2 answers
  • Quinton is having trouble learning Spanish because he keeps reverting back to the grammatical structures of his native English l
    6·1 answer
  • List of rules for expert systems​
    6·1 answer
  • Which of the following is NOT an example of soft skill?
    10·2 answers
  • Colorful bead bracelet in codehs
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!