Task: Write the following program:
1) Define the strucutre that describes an animal.
2) Create 2 objects of the strucutre.
3) Set values to the object parameters.
4) Display the object parameters on the scree.
Hello my dear programmers, my issue here is that I'm not sure what to put inside the 'int main()' function and also if I didn't miss anything for my void
functions.
// 1) Define the strucutre that describes an animal.
struct Animal {
int numlegs;
};
/// more code
int main {
// 2) Create 2 objects of the strucutre.
Animal cougar;
Animal spider;
// more code
}
Sorry but you're focusing not on the right thing, the body of the program is fine for now, I will change the details related to the description later. For now I really need help in the area I pointed out under the question.
I agree with salem c, consider it might be you that is misinterpreting the instructions. I say this based on experience of what teachers usually ask for, and my knowledge of OOP.
To remove any doubt post the assignment verbatim.
To your question, I would start with salem c Code, then initialize each object with some data via a constructor, then display that data, just as the instructions say.