game racters using the concept of inheritance. Complete the program class Person { public: ( string profession; int age; Person (): profession("unemployed"), age(16) { } void display () { cout << "My profession is: " << profession << endl; cout << "My age is: " << age << endl; walk(); talk(); void walk() { cout << "I can walk." << endl; } COU void talk() { cout << "I can talk." << endl; } }; class Maths Teacher }; class Footballer

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 2RQ
icon
Related questions
Question
game acters using the concept of inheritance.
Complete the program
class Person
{
public:
string profession;
int age;
Person (): profession("unemployed"), age(16) { }
void display ()
{
cout << "My profession is:
cout << "My age is: " << age << endl;
walk();
talk();
};
class Maths Teacher
(
*
void walk() { cout << "I can walk." << endl; }
Cout
void talk() { cout << "I can talk." << endl; }
class Footballer
<< profession << endl;
Transcribed Image Text:game acters using the concept of inheritance. Complete the program class Person { public: string profession; int age; Person (): profession("unemployed"), age(16) { } void display () { cout << "My profession is: cout << "My age is: " << age << endl; walk(); talk(); }; class Maths Teacher ( * void walk() { cout << "I can walk." << endl; } Cout void talk() { cout << "I can talk." << endl; } class Footballer << profession << endl;
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,