I'm solving a problem and am near completion but am having one little problem. I'm about to show the coding that i have but i need to make name, age, and weight value returning functions as well. You'll see what i mean.
int main()
{
Class secretType
{
Public :
void print(string, int, int, double) const;
void setAge(int);
void setName(int);
void setWeight(int);
void setHeight(double);
Private:
string name;
int age, weight;
double height;
};
void print(string name, int age, int weight, double height)
{
cout << name;
cout << age;
cout << weight;
cout << double;
name = " ";
age = 0;
weight = 0;
height = 0;
}
void setName(string name)
{
cin >> name;
}
void setAge(int age)
{
cin >> age;
}
void setWeight(int weight)
{
cin >> weight;
}
Here it is i hope the coding doesn't look all stupid and colorful.