// 24_24-5.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include <iostream>
#include <windows.h>
#include <string>

using namespace std;

class Kakakutyp {
public:
	int teika;
	int waribiki;
	int yuutai;
	Kakakutyp(int t = 0, int w = 0, int y = 0) {
		teika = t;
		waribiki = w;
		yuutai = y;
	}
};

class Syohin {
public:
	string name;
	int zaiko;
	Kakakutyp kakaku;	// Kakakutypクラスを入れ子にする
	Syohin(string s, int z, int t, int w, int y) {
		name = s;
		zaiko = z;
		kakaku = Kakakutyp(t, w, y);	// Kakakutypのコンストラクタを呼ぶ
	}
	void disp() {
		cout << "品名=" << name;
		cout << " 在庫個数=" << zaiko;
		cout << " 定価価格=" << kakaku.teika;
		cout << " 割引価格=" << kakaku.waribiki;
		cout << " 優待価格=" << kakaku.yuutai << '\n';
	}
};

int _tmain(int argc, _TCHAR* argv[])
{
	Syohin s("手帳B38", 12, 800, 750, 700);
	s.disp();

	MessageBox(NULL, _T("Check Console Window"), L"MessageBox", MB_OK);

	return 0;
}

