What is the problem?
The question as posted contains the step-by-step instructions to do exactly what you need.
Look at it, and read each bit at a time:
1) For this assignment, fill out the following class:
class person {
private:
string firstName;
string lastName;
int weight;
public:
. . .
};
You should provide constructors, access functions, and the operator>>.
Your course notes will tell you the mechanics of what to do!
Because this is your homework, I won't give you any useful source code. But, in C# the task would be:
public class person
{
private string firstName;
private string lastName;
public string FirstName
{
get { return firstName; }
set { firstName = value; }
}
public string LastName
{
get { return lastName; }
set { lastName = value; }
}
public person()
{
firstName = "unknown";
lastName = "unknown";
}
public person(string first, string last)
{
firstName = first;
lastName = last;
}
public override string ToString()
{
return firstName + " " + lastName;
}
}
Look at it stage by stage, and try to work out what is being asked of you. If you can't do even this simple stuff with your notes, books, Google and tutor available, then change course. Now. Before you waste any more of your (and everybody else's) time!