#include <iostream>
using namespace std;
class Weight
{
public :
void setHeight(const double h);
void setWeight(const double h);
double getHeight();
double getWeight();
int getWeightStatus();
private :
int StdWeight();
double height, weight;
int WeightStatus;
};
void Weight::setHeight(const double h)
{
}
void Weight::setWeight(const double w)
{
}
double Weight::getHeight()
{
}
double Weight::getWeight()
{
}
int Weight::StdWeight()
{
double sw=(height-110)*0.9;
if (sw+0.5 < weight)
WeightStatus=1;
else if (sw-0.5 > weight)
WeightStatus=-1;
else
WeightStatus=0;
return 1;
}
int Weight::getWeightStatus()
{
}
int main()
{
Weight w1;
w1.setHeight(175);
w1.setWeight(87.5);
cout << w1.getHeight() << "키에 몸무게 ";
cout << w1.getWeight() << "는 ";
switch (w1.getWeightStatus())
{
case 1:
cout << "과체중";
break;
case 0 :
cout << "정상";
break;
case -1:
cout << "저체중";
break;
default:
;
}
cout << " 입니다." << endl;
return 0;
}
'실습과제 모음' 카테고리의 다른 글
JCheckBoxTest (0) | 2012.07.18 |
---|---|
java 실습 0717 (0) | 2012.07.17 |
JAVA ComboBoxTest (0) | 2012.07.14 |
JAVA 0711 실습과제 (0) | 2012.07.11 |
C 언어 실습문제 (0) | 2012.07.11 |