$20 Bonus + 25% OFF
Securing Higher Grades Costing Your Pocket?
Book Your Assignment at The Lowest Price
Now!
Students Who Viewed This Also Studied
CST 210 Object Oriented Programming Lecture and Lab
Task
- Use inheritance in an object-oriented programming solution.
- Use composition in an object-oriented programming solution.
- Develop an object-oriented software solution with C++
For this assignment, you will use inheritance and composition to design an object-oriented solution that provides feeding information for animals on a farm. The program will recognize the type of animal then place it into that object, which will run through the timer program and if it passes feeding time it will add weight to the animal permanently and add the weight to the Animal * vector.
Begin coding your solution by writing the Animal class. Once you are satisfied with your Animal class, write the three derived classes: Chicken, Cow, and Horse. The eat() method should produce the output shown in the sample. To achieve this, you must override the method in all three subclasses.
After the Animal class hierarchy has been implemented and tested, write the Barn class. The Barn class constructor should fill the stalls, coop, and pen with Horses, Chickens, and Cows.
Classes:
Barn ‘has- a’ animal.
Horse ‘is — a’ animal
Method:
feedingTime( — conditional to bring out the proper animal and call the animals eat()
method.
The three animals are:
Horse
Chicken
Cow
They must all be derived from the animal class.
The animal class has three instance variables:
Name
Weight
Type
Methods: eat() “Toby the cow is eating” Getters and setters to change the weight of the animal. 5++ anumalWeightO — “Toby the cow now weighs 2005 Jbs”
The Barn class uses polymorphic variables. To do this, you will place the current instance variables with a single vector of type Animal *. This array will hold many Animal * variables. Next, update the constructor so that it populates the Animal * array with new Chickens, Cows, and Horses. Place the three separate feed methods with a method called feedAnimals.
The feedAnimals method should feed all of the animals in the Barn.
Add a pure virtual method to the Animal class called speak(). Implement the speak() method for each Animal subclass: Horse(“Neigh”), Cow(“Moo”), Chicken(“Cluck”).
Add a pure virtual method to the Animal class called getTopWeight(). Implement this method in each Animal class as follows: Horse::getTopWeight() returns 2200, Chicken::getTopWeight() returns 12, Cow::getTopWeight() returns 1500.
When the Barn feeds the animals, it must check to see if the animal is at or above the top weight. If the animal meets or exceeds the top weight, then they are put out to pasture.
Create an outToPasture() method in the Barn class and have it output ” the is output pasture.” The outToPasture method should replace all animals that are put out to pasture.
CST 210 Object Oriented Programming Lecture and Lab
Answer in Detail
Solved by qualified expert
Get Access to This Answer
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.
Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.
Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.
Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.
16 More Pages to Come in This Document. Get access to the complete answer.
MyAssignmenthelp.com has a team of more than 3000 expert writers that make future of million students from UK, US and Australia. Be it your online assignment help, custom essay help or dissertation writing services, MyAssignmenthelp.com is the one-stop solution for all. Our competent authors, editors and proofreaders make the most difficult task of assignment easy. We guarantee best price and quality all at the same place. MyAssignmenthelp.com promise assured delivery of assignments before the deadline. We protect our customers and ensure privacy implementing strict policies of data prevention. Connect with us via telephone, direct email or chat live with our customer service executives.Online assignment help from MyAssignmenthelp.com is better than ever with facilities like live online chat, 24*7 assistance, money refund guarantee and Free Turnitin Reports.
More CST 210 CST 210 Object Oriented Programming Lecture and Lab: Questions & Answers
ICT707-Data Science Practice
Following Data Analysis Tasks:
1. Exploratory data analysis
2. Recommendation engine
3. Classification
4. Clustering
You need to choose a dataset from Kaggle to complete these tasks. Remember to include the data set file in you source code submission.
Note: In your notebook, please use Heading …
View Answer
Fundamentals of Operating Systems and Java Programming
Your report should provide detailed answers for the following questions.Q1. Specify Use cases (minimum of six) for the design of Country Kitchen Classics Web User Interface specifying the actors. Provide possible scenarios (minimum of two) for each Use case. (Use UML notation)Q2.& …
View Answer
6122COMP Virtualised Computer Architecture
Question:
This assignment is an individual piece of work, where you will design a hybrid cloud solution and perform an evaluation of virtualisation performance for various benchmarks.
Learning Outcomes to be assessed
LO1 – Evaluate various forms of CPU virtualisation (language and OS leve …
View Answer
MAFD 4202 Mainframe Development
1) Use a structure chart to help with the process of designing your program.
2) Break your solution down into at least 5 tasks (paragraphs) – one for each classification to process the requirements for that classification.
3) Within the main IF statement structure …
View Answer
Content Removal Request
If you are the original writer of this content and no longer wish to have your work published on Myassignmenthelp.com then please raise the
content removal request.
Choose Our Best Expert to Help You
Asa Prince
I was a professor of engineering associated with the University of Warwick
460 – Completed Orders
Hire Me
Still in Two Minds? The Proof is in Numbers!
33845 Genuine Reviews With a Rating of 4.9/5.
Accounting
Assignment: 1400 Pages, Deadline:
8 days
It was very accurate. The research was done very well and I got nice marks . They really helped me with my work as I was struggling
User ID: 5***57 Sydney, Australia
Business Law
Assignment: 8 Pages, Deadline:
9 days
it was great assignment according to what was important, without mistakes, great
User ID: 8***11 Lincoln, Great Britain
Business Law
Assignment: 6.4 Pages, Deadline:
10 days
The assignment done by professional way and I got more than 85 marks for this subject. Thanks for the whole Nerddz team.
User ID: 2***65 Deepdene, Australia
Psychology
Assignment: 6.8 Pages, Deadline:
10 days
Great work done by the Team Nerddz. I got marks more than 85 for the subject. Thank you…
User ID: 2***65 Deepdene, Australia
Management
Assignment: 6 Pages, Deadline:
4 days
It was nice work and written in a good way. It helped me to increase my final grades for the same course and instructor praised me. Got good grades ov …
User ID: 5***29 Calgary, Canada
Economics
Assignment: 3.5 Pages, Deadline:
2 days
It was nice work and written in a good way. It helped me to increase my final grades for the same course and instructor praised me. 1 star less for im …
User ID: 5***29 Calgary, Canada
Management
Home Work: 3 Pages, Deadline:
1 day
This instructor was really very strict but still gave good marks. Abcdefghijklmno
User ID: 5***29 Calgary, Canada
Management
Thesis: 3 Pages, Deadline:
1 day
Amazing work on this! Got good marks excellent work by the writer. I did not expect so much marks
User ID: 5***29 Calgary, Canada
English
Essay: 1.6 Pages, Deadline:
10 hours
Awesome service. I live it and I will continue to work with them I recommend it. Please do consider
User ID: 8***35 United States
Psychology
Assignment: 6.8 Pages, Deadline:
7 hours
i really appriciate your work. thank you so much. you do your best. and you are very hard worker. thank you so much again again.
User ID: 8***33 Australia
Accounting
Assignment: 1400 Pages, Deadline:
8 days
It was very accurate. The research was done very well and I got nice marks . They really helped me with my work as I was struggling
User ID: 5***57 Sydney, Australia
Business Law
Assignment: 8 Pages, Deadline:
9 days
it was great assignment according to what was important, without mistakes, great
User ID: 8***11 Lincoln, Great Britain
Business Law
Assignment: 6.4 Pages, Deadline:
10 days
The assignment done by professional way and I got more than 85 marks for this subject. Thanks for the whole Nerddz team.
User ID: 2***65 Deepdene, Australia
Psychology
Assignment: 6.8 Pages, Deadline:
10 days
Great work done by the Team Nerddz. I got marks more than 85 for the subject. Thank you…
User ID: 2***65 Deepdene, Australia
Management
Assignment: 6 Pages, Deadline:
4 days
It was nice work and written in a good way. It helped me to increase my final grades for the same course and instructor praised me. Got good grades ov …
User ID: 5***29 Calgary, Canada
Economics
Assignment: 3.5 Pages, Deadline:
2 days
It was nice work and written in a good way. It helped me to increase my final grades for the same course and instructor praised me. 1 star less for im …
User ID: 5***29 Calgary, Canada
Management
Home Work: 3 Pages, Deadline:
1 day
This instructor was really very strict but still gave good marks. Abcdefghijklmno
User ID: 5***29 Calgary, Canada
Management
Thesis: 3 Pages, Deadline:
1 day
Amazing work on this! Got good marks excellent work by the writer. I did not expect so much marks
User ID: 5***29 Calgary, Canada
English
Essay: 1.6 Pages, Deadline:
10 hours
Awesome service. I live it and I will continue to work with them I recommend it. Please do consider
User ID: 8***35 United States
Psychology
Assignment: 6.8 Pages, Deadline:
7 hours
i really appriciate your work. thank you so much. you do your best. and you are very hard worker. thank you so much again again.
User ID: 8***33 Australia