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
Aleonysh [2.5K]
3 years ago
7

Write a C++ Programm in which inheritance is used

Computers and Technology
1 answer:
geniusboy [140]3 years ago
8 0

Answer:

// C++ program to demonstrate inheritance

#include <iostream>

using namespace std;

// base class

class Animal {

  public:

   void eat() {

       cout << "I can eat!" << endl;

   }

   void sleep() {

       cout << "I can sleep!" << endl;

   }

};

// derived class

class Dog : public Animal {

  public:

   void bark() {

       cout << "I can bark! Woof woof!!" << endl;

   }

};

int main() {

   // Create object of the Dog class

   Dog dog1;

   // Calling members of the base class

   dog1.eat();

   dog1.sleep();

   // Calling member of the derived class

   dog1.bark();

   return 0;

}

You might be interested in
Write the interface (.h file) of a class Counter containing: A data member counter of type int. A data member named counterID of
OlgaM077 [116]

Explanation:

See the attached image for The interface (.h file) of a class Counter

8 0
3 years ago
Which of the following is not a benefit of normalization?
mixer [17]

Answer:

The answer is option (4) Maximize redundancy as normalization minimizes redundancy of data.

Explanation:

Normalization of databases leads to minimization of data redundancy in databases. It doesn't maximize data redundancy. Data redundancy leads to wastage of resources. Normalization of databases minimizes insertion anomolies. Normalization of databases minimizes deletion anomolies. Normalization of databases minimizes updation anomolies.  So , the answer to the question is option (4) maximize redundancy.

8 0
3 years ago
Which of the descriptions listed below best describes the step in the reverse engineering process called functional analysis? A)
Zepler [3.9K]
If multiple choice then d and a if not then the best one would be a!


hope this helps!!
5 0
3 years ago
A citizen of any group both
erastovalidia [21]

Answer:

Rights and Responsibilities

Explanation:

4 0
2 years ago
Which command is located in the Action Settings dialog box that allows a user to set a linked or embedded object as a trigger to
aev [14]

Answer:

Object action was the answer.

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • The Polish mathematician Wacław Sierpiński described the pattern in 1915, but it has appeared in Italian art since the 13th cent
    8·1 answer
  • Can you list one property of each of the following?<br> Excel<br> Word<br> Powerpoint
    7·2 answers
  • PowerPoint provides a wide variety of predefined shapes that can add visual insert to a slide true or false
    10·2 answers
  • Persuasion is when Someone speaks to crowd about love <br>○True<br>○False​
    10·1 answer
  • Which of the following statement is correct? Select one: a. Base register holds the size of a process. b. Limit register holds t
    10·1 answer
  • Consider the following code snippet:
    13·1 answer
  • Write a program that takes a decimal number from the user and then prints the integer part and the decimal part separately. For
    13·1 answer
  • ________ is a group meeting-based process for requirements collection. a. Reverse engineering b. Joint application design c. Hum
    9·1 answer
  • A multiprocessor with 10 processors has 36 attached tape drives. A number of jobs have been submitted to the system where each j
    8·1 answer
  • Live footage refers to:
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!