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
Which type of operating system is usually used in personal computers
velikii [3]

The most common operating system for personal computers is Windows.

7 0
3 years ago
Please choose the correct citation for the case which established the "minimum contacts" test for a court’s jurisdiction in a ca
IRINA_888 [86]
Beep boop celery fart
6 0
3 years ago
which option of the AutoCorrect tool enables you to add and delete words that do not follow abbreviation rules?
quester [9]

The replace text as you type is an option in the AutoCorrect tool that enables the user to add or delete words that do not follow abbreviation rules. Moreover, this is a convenient way to use especially if you are dealing with long string of words that only needs abbreviation.

3 0
3 years ago
Read 2 more answers
The New option is found in the ...............tab.​
morpeh [17]

in your notes books and in your vopy

3 0
3 years ago
Read 2 more answers
If you’re presenting in a darkened room, what text and background should you use to provide maximum readability?1) Light text on
ludmilkaskok [199]

Answer:

1

Explanation:

1 because it would be difficult for people to read on the other ones that you put.

3 0
3 years ago
Other questions:
  • The illustrations group contains all but a _______​
    9·1 answer
  • How to remove a channel from favorite list on suddenlink?
    15·1 answer
  • When enter a function or formula in a cell, which is the character you must type?
    14·1 answer
  • Each tab is divided into groups of related commands or buttons. T or F
    10·1 answer
  • You are tasked with accumulating survey data on a web page and are responsible for it being free from dirty data once you close
    11·1 answer
  • Suppose that the instruction format for a modified Little Man Computer requires two consecutive locations for each instruction.
    5·1 answer
  • Who plays xbox one offline and knows some multiplayer games that can be played offline.
    15·2 answers
  • How does technology affect our daily lives essay
    9·2 answers
  • Complete the sentence.
    12·2 answers
  • An operating system with _____ capabilities allows a user to run more than one program concurrently.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!