i am newcomer to c++ forum and a student.
i have been assigned a task related to inheritance classes usage.
i'm copying that assignment below
if anyone of you ca help me in solving this exercise i will be really thankfull to him.
thanks in advance.
Problem Description:-
Following animals live in the zoo:
Animals
Dog
- Name: “Dog one”;
- Dog type: Hunting dog.
- Favorite food: “Meat”;
Parrot
- Can not speak.
- Name: “Parrot one”;
- Favorite food: “Grain”;
- Length of wings: 0,25;
Chicken
- Length of wings: 0,75;
- Is broiler.
- Favorite food: “Corn”;
- Name: “Chicken one”;
Dog
- Favorite food: “Fresh meat”;
- Dog type: Working dog.
- Name: “Dog two”;
Parrot
- Length of wings: 0,5;
- Name: “Parrot two”;
- Favorite food: “Corn”;
- Can speak.
Dog
- Dog type: Sport dog.
- Favorite food: “Pedigree”;
- Name: “Dog three”;
Chicken
- Favorite food: “Corn”;
- Name: “Chicken two”;
- Is not broiler.
- Length of wings: 0,75;
Each animal can have several friends among other animals from the zoo. Every day each animal looses randomly one friend (if there are any) and establishes friendship randomly with one animal (if it is not already friend of all other animals). If A is friend of B then B is friend of A. At the beginning nobody has friends.
Task Description
Write console application, which provides following options:
1. List all animals with their properties and friends’ names.
2. Live one day. (When this option is chosen each animal attempts to brake/establish friendship as described above. Print all changes to console. For example “Dog one has lost friendship with Chicken one; Dog one has established friendship with Parrot two.”)
3. Exit.
We are happy to help with problems you have but it is unlikely you will find somone to just do your homework for you - post what you have worked out (partialy working code, totaly broken code, ideas, etc) and the problems you have and someone will give you a helpign hand - in the long run you will learn much more this way:-)