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
A set of rules that specify how each code statement must be written is called the ____ of the programming language.
Helga [31]

Answer:

syntax

Explanation:

7 0
2 years ago
Describe the 3 important segments of a presentation.<br> -Introduction<br> -Body<br> -Conclusion
Oxana [17]

The introduction states what the presentation is about/Talking about.

The body goes into detail and helps support the introduction.

The conclusion brings everything to an end/it wraps everything up

6 0
3 years ago
How will a packet tracer environment be affected if a heater is added to a container named branch office and turned on?
viktelen [127]
 <span>Packet Tracer introduced dynamic environent management (temperature, gas, pressure, light, ...) to make IoT device simulation more realistic.</span><span>
If a heater is added to a container named branch office and turned on this will affect the packet tracer environment ins the following way:
</span>The temperature inside Branch Office will increase along with any child containers that exist within Branch Office.
6 0
4 years ago
Write the discription of the following tags:
neonofarm [45]
The ‘u’ tag makes a text underlined.
The ‘sup’ tag defines superscript text.
The ‘a’ tag defines a hyperlink
The ‘table’ tag defines an HTML table.
3 0
3 years ago
Art directors win awards for their work, and awards can make their careers. Art directors win awards for work in fields like the
charle [14.2K]

Answer:

N/A

Explanation:

im sorry mate, but this sounds like its supposed to be a paper by you, i cant write a paper for you, but i can help you make one, ive got some methods and tricks i can share to make it easier

again not trying to be mean, just trying to help the best way i can :)

4 0
3 years ago
Other questions:
  • This is not an appropriate business use for a wiki. editing corporate documents getting customer feedback project management pub
    11·1 answer
  • The term that describes the connection of all kinds of devices; computers, phones, laptops, appliances, cars, etc. to the intern
    7·1 answer
  • Typically, the first item in defining a function is _____. (Points : 4)
    6·1 answer
  • What is the name of the time delay in a CPU caused by differences between the speed o CPU, the system bus, and memory circuits?
    10·1 answer
  • PLEASEEEE HELPP ILL MARK BRAINLIEST!! in a presentation outline, each slide must represent a main point in the outline. true or
    5·1 answer
  • Hey guys i need help again on coding
    7·1 answer
  • ______ lets people access their stored data from a device that can access the Internet.
    6·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • Computer hardware refers to: Group of answer choices the mechanism through which users interact with a computer. handheld comput
    13·1 answer
  • software that opens files and scans their code to look for certain types of malware is known as software.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!