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 of the Arts, A/V Technology, and Communication career cluster pathways are involved with producing a product for an audien
PIT_PIT [208]

I believe the pathways are Audio/Visual Technology and Film, Journalism and Broadcasting and Printing Technology .


5 0
3 years ago
Read 2 more answers
You can display content variations to mobile, tablet or desktop users.
umka21 [38]

Answer:

The following statement is true.

Explanation:

Because the user easily monitors the content variations by using some applications or software for the mobile or desktops without facing any difficulties in displaying the several content. If they facing some issues then, there is the problem of their mobile or computer or maybe any issues occurs in their application according to the configuration of their system.

7 0
3 years ago
The question is inside the screenshot
Natalija [7]

Answer:

second choice

4 0
3 years ago
What is the equivalent of film speed in digital cameras?
elena55 [62]
The equivalent of film speed in a digital camera is going to be sensitivity. This will make the correct answer B. 
3 0
3 years ago
Read 2 more answers
The amount of money you can charge to a credit card is called
Novosadov [1.4K]
Transfer fee or just fee.
8 0
3 years ago
Other questions:
  • How can you find Web pages that contain news published during the past week?
    8·1 answer
  • 2. Fabulously Fit offers memberships for
    9·1 answer
  • The following code processes a file containing five positive numbers. What will the variable $result contain after the code is e
    10·1 answer
  • An optical fibre has an attenuation of 0.3 dB/km. If a laser launches an optical power level of PIN (mW) into 35 km length of th
    8·1 answer
  • Why do certain words change color in Python?
    6·1 answer
  • Name any four areas where computers are used​
    15·1 answer
  • In design and implementation of any _____ reasoning application, there are 4 Rs involved: retrieve, reuse, revise, and retain.
    7·1 answer
  • Busco a talcotalco38
    14·2 answers
  • Imagine that you need to prepare for three end-of-term tests. What steps will you take to make sure your study time is well spen
    5·1 answer
  • Write a program that takes a string as an input. If the string entered is equal to
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!