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]
2 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]2 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
Why is a Quality assurance tester needed on a software development team?
arsen [322]

Answer:

Quality assurance testing plays a very crucial role in the process of software development. It saves money and time by spotting bugs and errors early in the software development life-cycle. Software that is newly developed may have inconsistencies, redundancies, and flaws; therefore, proper QA testing is mandatory.

Explanation:

3 0
2 years ago
Assuming dataFile is an ofstream object associated with a disk file named payroll.dat, which of the following statements would w
svet-max [94.6K]

Answer:

dataFile << salary;

Explanation:

To write salary to a file (payroll.dat) using ofstream, you make use of the following instruction:

<em>ofstream dataFile; </em>

<em>myfile.open ("payroll.dat"); </em>

<em>myfile <<salary; </em>

<em>myfile.close();</em>

<em />

This line creates an instance of ofstream

<em>ofstream dataFile; </em>

This line opens the file payroll.dat

<em>myfile.open ("payroll.dat"); </em>

This is where the exact instruction in the question is done. This writes the value of salary to payroll.dat

<em>myfile <<salary; </em>

This closes the opened file

<em>myfile.close();</em>

<em />

<em />

8 0
2 years ago
write a C++ program that ask the user for the number of cookies eaten and display the calorie consumption
Artyom0805 [142]

Answer:

#include <iostream>

using namespace std;

int main()

{

   int cookies;

   cin >> cookies;

   cout << "The calorie consumption is: " << cookies * 142 << endl;

   return 0;

}

Explanation:

First line: include basic library of C++(input and output).

using namespace std;

Says to compiler we are using std.

int main() Main function

int cookies, cookies variable, of int type

cin >> cookies

get the number of the cookies from user

cout Print the text and calories(one cookie have 142 calories)

Have a nice day ;)

4 0
2 years ago
Question 9. which describes an str?
Nadya [2.5K]
<span><span>STR stands for Short Term repeat. It is </span>a region of a DNA molecule that contains short segments of three to seven repeating base pairs</span>
<span>Hundreds of different types of STR's are found in the human genomes.</span>
3 0
2 years ago
In terms of system thinking, what is process?
Talja [164]

Answer:b) The computer program that processes the data.

Explanation: In the computer system , process is the part of computer program which are responsible for performing of the processing of the data and other functions .The working of the process is associated with the program code and related activities/functions.

Other options that are mentioned in the question are incorrect because they don't describe the process correctly .Thus , the correct answer is option (b).

5 0
2 years ago
Read 2 more answers
Other questions:
  • The file extensions .webm, .m4v, and .ogv are used for:
    15·1 answer
  • Unemployment can be viewed as
    14·1 answer
  • Mac or PC (need opinions please)<br><br> Why did you choose Mac/PC?
    10·2 answers
  • How are computers 35 years ago and how are they presently and how are they going to be in the next 35 years
    9·1 answer
  • Of all excavation hazards, _______ poses the greatest risk
    8·1 answer
  • In Python what are the values passed into functions as input called?
    13·1 answer
  • You are hired by a game design company and one of their most popular games is The Journey. The game has a ton of quests, and for
    12·2 answers
  • Write a statement that slices a substring out of the string quote and puts it into a variable named selection. If given the stri
    8·1 answer
  • Describe a NIC card and can you have more than one?
    13·1 answer
  • Define foreign employment​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!