Base class: Wolf Constructor Variable: gender (public, string), age (public, int) Functions: void eat(), hunt() *...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Base class: Wolf Constructor Variable: gender (public, string), age (public, int) Functions: void eat(), hunt() * Each function displays the behavior of the wolf (eating, hunting). * Functions are implemented inside the class. Derived class: Dog Constructor Variable: breed (public, string), owner (private, string) Functions: void like_humans(), set, get methods (for private variable, owner) * Each function displays the behavior of the wolf (like humans...). * The like_humans() is implemented outside of the class. Objects & Display Two object: wolf, puppy setOwner() for puppy => John Display: all of variables & functions TFCTBTOH=22982222 5 6 7 11 10 public: 12 13 14 15 16 17 18 19 20 21 23 24 #include "pch.h" #include <iostream> #include <string> using namespace std; 25 26 27 Eclass Wolf { Wolf (string Gender, int Age) { gender Gender; age = Age; public: string gender; int age; public: void eat() { D}; } void hunt() { cout <<"Eating..." << end1 << endl; Eclass Dog : public Wolf { public: public: cout << "Hunting..." << endl << endl; Dog(string Gender, int Age, string Breed): Wolf (Gender, Age) { breed - Breed; private: string breed; void like_humans(); void setowner(string Owner) { owner Owner; string getOwner() { return owner; string owner; Add the code below: Void Dog :: like human () { Cart << " like human" <<endl; Base class: Wolf Constructor Variable: gender (public, string), age (public, int) Functions: void eat(), hunt() * Each function displays the behavior of the wolf (eating, hunting). * Functions are implemented inside the class. Derived class: Dog Constructor Variable: breed (public, string), owner (private, string) Functions: void like_humans(), set, get methods (for private variable, owner) * Each function displays the behavior of the wolf (like humans...). * The like_humans() is implemented outside of the class. Objects & Display Two object: wolf, puppy setOwner() for puppy => John Display: all of variables & functions TFCTBTOH=22982222 5 6 7 11 10 public: 12 13 14 15 16 17 18 19 20 21 23 24 #include "pch.h" #include <iostream> #include <string> using namespace std; 25 26 27 Eclass Wolf { Wolf (string Gender, int Age) { gender Gender; age = Age; public: string gender; int age; public: void eat() { D}; } void hunt() { cout <<"Eating..." << end1 << endl; Eclass Dog : public Wolf { public: public: cout << "Hunting..." << endl << endl; Dog(string Gender, int Age, string Breed): Wolf (Gender, Age) { breed - Breed; private: string breed; void like_humans(); void setowner(string Owner) { owner Owner; string getOwner() { return owner; string owner; Add the code below: Void Dog :: like human () { Cart << " like human" <<endl;
Expert Answer:
Answer rating: 100% (QA)
It seems you have a class diagram and a task to implement a simple objectoriented program in C The program describes a base class Wolf and a derived c... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
What is a data warehouse? What are the primary similarities and differences between a data warehouse and a transactional database? When should an organization consider developing a data warehouse?...
-
Q1. i. Define a base class with following member data and member function: int i, j accessible in base class. void set(int a, int b) to initialize i .j. void show() to display the values of i, j. ii....
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
The FBI Standard Survey of Crimes shows that for about 80% of all property crimes (burglary, larceny, car theft, etc.), the criminals are never found and the case is never solved (Source: True Odds,...
-
What is the explanation for feather beds being warm?
-
Why is the amount of debt in a companys capital structure important to the financial analyst? (a) Debt implies risk. (b) Debt is less costly than equity. (c) Equity is riskier than debt. (d) Debt is...
-
Develop a reality T.V. show involving accountants (e.g., forensic accountants).
-
M. Cotteleer Electronics supplies microcomputer circuitry to a company that incorporates microprocessors into refrigerators and other home appliances. One of the components has an annual demand of...
-
Finance Question 8. Is the following situation a violation of the no-arbitrage condition? Show and explain. + 6-month discount bond $99.25 1-year zero $97.50 1-year 4% coupon bond (paid semi- $100...
-
Pistol Corporation acquired 70 percent of Scope Corporations voting stock on May 18, 20X1. The companies reported the following data with respect to intercompany sales in 20X4 and 20X5: Pistol...
-
Discuss how class consciousness can explain wage polarization and current market distresses.?
-
Anika Manufacturing makes toys and uses the average process costing system. On May 1, 2017, the company had 400 units in process that were 70% complete as to materials and 85% complete as to...
-
A clutch manufacturer has called you to consult on a new design being considered. The system essentially consists of two rotating disks as shown. The axial loading will be about 2000 N, and the...
-
1.A retailer receives an invoice dated 8 July 2015 with trade discounts of 12% and 10% and cash discount terms of 6/10, 3/20, n/30. The net price after trade discount including transportation cost of...
-
1. You expect to receive the following future cash flows at the end of the years indicated: $500 in year 2, $1200 in year 4, $800 in year 5 and $1500 in year 6. If the discount rate is 7% per year:...
-
Communicate an idea effectively , not to tell a story or evoke emotions. Those are tools, not an end in themselves. Also, your 'structure' should be invisible to your audience. Don't talk about how...
-
A $1,000-face-value bond has a current market price of $935, an 8 percent coupon rate, and 10 years remaining until maturity. Interest payments are made semiannually. Before you anyy calculations,...
-
A 20-cm-square vertical plate is heated to a temperature of 30oC and submerged in glycerin at 10oC. Calculate the heat lost from both sides of the plate.
-
Why does typing a number such as 121 as input require a program to make a conversion?
-
How does a class accomplish abstraction, encapsulation, and data hiding?
-
Write a program that asks you to enter an automobile gasoline consumption figure in the European style (liters per 100 kilometers) and converts to the U.S. style of miles per gallon. Note that in...
-
You are valuing the equity in a firm with \($800\) million (face value) in debt with an average duration of six years and assets with an estimated value of \($400\) million. The standard deviation in...
-
Marion Manufacturing, a steel company, announces that it will be taking a major restructuring charge that will lower earnings this year by $500 million. Assume that the charge is not tax deductible...
-
General Systems is a firm that manufactures personal computers. As a top manager in the firm, you are considering changes in the way the firm is run. Currently, the firm has after-tax operating...
Study smarter with the SolutionInn App