TerriTown is a fictitious town populated by a race that looked like aerolanes. You are to develop a program to allow users to keep track on the inhabitants in TerriTown. An inhabitant should contain the below data:
• IIP : 10 characters
• Name : 30 characters
• DateOfBirth :date format
• Height :float type
• Weight :float type
Create a class called Inhabitant that contain the above attributes. The class should contain also constructor, mutator(set) and accessor(get) methods.
Somebody solve this visual c++problem for me.. thankyou very much!!?
class Inhabitant
{
public:
char IIP[10] ;
char Name[30];
int DateOfBith;
float Height;
float Weight;
}
Inhabitant::Inhabitant()
{
// Initialize variables (This is constructor)
}
float Inhabitant::GetHeight(void)
{
return Height; //Accessor
}
void Inhabitant::SetHeight(float NewHeight)
{
Height = NewHeight; // Mutator
}
// Then just add accessors and mutators for all the other variiables.
Reply:Start it with your class, and show us. Maybe we can help, rather than do your homework for you.
Reply:If you are still stuck may be you can contact a C++ expert live at website like http://askexpert.info/ to help you code your project assignment.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment