You are expected to create a file that contains 2 classes named "car" and "human". Class car: •The class should have a constructor. • Getcarbrand member function should return the brand of the car. ⚫Displaymessage member function should print the brand of the car. Class human: The class should have a constructor. • Gethumanname member function should return the name of human. • Displaymessage member function should print the name of human. The main function should create objects for the car and human class.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter11: Introduction To Classes
Section11.2: Basic Class Functions
Problem 5E
icon
Related questions
Question
You are expected to create a file that contains 2 classes named
"car" and "human".
Class car:
⚫The class should have a constructor.
⚫ Getcarbrand member function should return the brand of the
car.
• Displaymessage member function should print the brand of
the car.
Class human:
The class should have a constructor.
• Gethumanname member function should return the name of
human.
•Displaymessage member function should print the name of
human.
The main function should create objects for the car and human
class.
Transcribed Image Text:You are expected to create a file that contains 2 classes named "car" and "human". Class car: ⚫The class should have a constructor. ⚫ Getcarbrand member function should return the brand of the car. • Displaymessage member function should print the brand of the car. Class human: The class should have a constructor. • Gethumanname member function should return the name of human. •Displaymessage member function should print the name of human. The main function should create objects for the car and human class.
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
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,