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]
2 years ago
7

Write a C++ Programm in which inheritance is used

Computers and Technology
1 answer:
geniusboy [140]2 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
One advantage of a resource like the World Wide Web is that it connects people with problems to people who have__
Nezavi [6.7K]

Answer:

Answers

Explanation:

5 0
2 years ago
This graph shows both a reflection and a
Tpy6a [65]

Answer:

y=-3x-×-1 I think it's answer is it

6 0
3 years ago
Read 2 more answers
Which of the following statements best represents the impact vaudeville had on the film industry? Early silent films were more r
maria [59]

Answer:

Answer is B: Early silent film producers used many of the same acting techniques popularized in vaudeville performances, even using popular vaudeville stars as actors in their productions.

Explanation:

7 0
2 years ago
ASAP
grin007 [14]
I would recommend A. Quickly on the left and move ahead of it because you should always pass on the left and seeing as it is a large truck, you would want to get ahead of it ASAP.
4 0
3 years ago
Read 2 more answers
Fill in the blank to complete the sentence. -------------------- is used to store and process data over the Internet using compu
Trava [24]

Answer:cloud computing

Explanation:

6 0
2 years ago
Other questions:
  • A student is helping a friend with a home computer that can no longer access the Internet. Upon investigation, the student disco
    9·1 answer
  • Changing the position of the wing will
    9·1 answer
  • Multiple users report that the network printer, which is connected through the print server, is not printing. Which of the follo
    12·1 answer
  • 1. row a statement you submit to get paid for a product or service 2. spreadsheet software used by many business professionals t
    5·1 answer
  • What differentiates physical design from logical design?
    7·1 answer
  • List safety conditions when downloading shareware, free free where, or public domain software
    14·1 answer
  • ¿que significa “TTAQMMQMPDATLSPLNDTMGCCLFEQMMPQTEIUMDR” ?
    5·2 answers
  • Calculator and clocks are examples of -------------- in windows 7
    14·1 answer
  • HELP ME ⚠️‼️⚠️‼️ DUE IN EXACTLY 27 MINUTES
    6·1 answer
  • It's generally best to use what types of sites for factual internet research? Select all that apply from the choices below.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!