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
1. Discuss the pros and cons of human-computer interaction technology?
Lana71 [14]

!

gcoo!!Exykgvyukhhytocfplanationufvhyg:

3 0
3 years ago
You have a host device with an assigned IP address of 192.168.15.100 and a subnet mask of 255.255.255.192. To what network does
aalyn [17]

The options are missing from the question.

Below are the options.

A) 192.168.15.0

B) 192.168.15.16

C) 192.168.15.32

D) 192.168.15.64

Answer: The correct option to the question is option D

192.168.15.64

Explanation:

The Network is: 192.168.15.64/26 11000000.10101000.00001111.01000000

Then the Broadcast is: 192.168.15.127 11000000.10101000.00001111.01111111

We see the HostMin as: 192.168.15.65 11000000.10101000.00001111.01000001

And the HostMax as: 192.168.15.126 11000000.10101000.00001111.01111110

3 0
2 years ago
40 points!!! Which of the following is a disadvantage of outsourcing?
mr Goodwill [35]

Answer:

c

Explanation:

I need 20 characters in my answer so tvcogct7zr7zuruzxicfficx7t8txr8zz8rz8rxt8c8tvyovoyb9h

8 0
3 years ago
Read 2 more answers
Using bearings will cause more friction. Group of answer choices True False
Olegator [25]

Answer:

False

Explanation:

6 0
3 years ago
Read the scenarios below, then use the drop-down menus to decide if you should use a database.
Romashka [77]

Answer:

A. The parent-teacher orginization keeps a log of cookies sales to raise money for the elementary school.

Explanation:

5 0
3 years ago
Other questions:
  • Which term collectively describes hard disks, CDs, and flash drives?
    11·2 answers
  • You created a vm and installed windows server 2008 r2 over the network, using pxe boot. when you start the vm, it doesn't attemp
    7·1 answer
  • What document type would be best to communicate sales items from a business to potential customer?
    12·1 answer
  • A researcher develops a new instrument to measure coping skills and conducts a pilot study to compare the new tool with an exist
    5·1 answer
  • The words that follow a code number in the cpt manual are called the
    12·1 answer
  • Write a program that reads a string from the user containing a date in the form mm/dd/ yyyy. It should print the date in the for
    10·1 answer
  • The graphic shows a cause and effect organizational aid.
    6·1 answer
  • Drag each tile to the correct box.
    8·1 answer
  • Question 1 of 10 Which type of information systems personnel are involved in organizing information so that users can access it
    7·1 answer
  • Type of Factor Beginning Frog Count Simulation 1 (Low) Simulation 2 (High)
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!