#ifndef MYPAPER_H_INCLUDED
#define MYPAPER_H_INCLUDED
#include <iostream>
#include <algorithm>
using namespace std;
class Box
{
int height, width, depth; //높이, 넓이, 깊이
int volume_content; //상자의 체적
public:
Box(); //생성자
~Box(); //소멸자
void volume(int _height, int _width, int _depth); //체적구하는 함수
void print(); //출력함수
};
Box::Box()
{
}
Box::~Box()
{
}
void
Box::volume(int _height, int _width, int _depth)
{
volume_content =_height * _width * _depth;
}
void
Box::print()
{
cout << "volume_content :" << volume_content << endl;
}
#endif
// Mypaper.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include "Mypaper.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
Box a1; //객체 선언
a1.volume(10,20,30); //객체 사용
a1.print(); //출력
return 0;
}
'컴퓨터과학[1-2] > knou_C++' 카테고리의 다른 글
C++ - 이 페이자의 스크립트에서 오류가 발생하였읍니다. (0) | 2019.02.15 |
---|---|
BankingSystem _v_2.1 (0) | 2014.10.28 |
C ++ Structure & Destructure (0) | 2014.10.11 |
배열 포인터 활용 (0) | 2014.09.23 |
C ++연습문제 2-1 풀이 (0) | 2014.08.17 |
댓글