I believe this is it:
Code:
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
class secretType
{
public:
void print() const;
void setName();
void setAge();
void setWeight();
void setHeight();
string getName() const;
int getAge() const;
int getWeight() const;
double getHeight() const;
secretType(string = " ", int = 0, int = 0, double = 0);
private:
string name;
int age;
int weight;
double height;
};
int main(int argc, char *argv[])
{
secretType yourName;
yourName.setName();
yourName.setAge();
yourName.setWeight();
yourName.setHeight();
yourName.getName();
yourName.print();
system("PAUSE");
return EXIT_SUCCESS;
}
// FUNCTION DEFINITIONS
secretType::secretType(string name, int age, int weight, double height)
{
name = " ";
age = 0;
weight = 0;
height = 0;
}
// function to set name.
void secretType:: setName()
{
cout << "enter your name: "; cin >> name;
}
// function to set age.
void secretType::setAge()
{
cout << "enter your age: "; cin >> age;
}
// function to set weight.
void secretType:: setWeight()
{
cout << "enter your weight: "; cin >> weight;
}
// function to set height.
void secretType::setHeight()
{
cout << "enter your height in decimal format(0ft.0in): "; cin >> height;
}
// function to return name.
string secretType:: getName()const
{
return name;
}
// function to return age.
int secretType:: getAge() const
{
return age;
}
// function to return weight.
int secretType:: getWeight() const
{
return weight;
}
// function to return height.
double secretType:: getHeight() const
{
return height;
}
// function to print name.
void secretType:: print() const
{
cout << "name: " << name << " age: " << age << " weight: " << weight << " height: " << height << endl;
}