#include <iostream>
#include "sample1.h"

int main() {
  std::cout << "Enterキーでオブジェクトを生成します" << std::endl;
  std::cout << "Spaceキー→Enterキーで終了します" << std::endl;

  // キー入力を受け取る
  char key = std::cin.get();

  // Spaceキーなら終了
  if (key == ' ') {
    std::cout << "プログラムを終了します" << std::endl;
    return 0;
  }

  // Enterキーならオブジェクトを動的に生成
  if (key == '\n') {
    // 動的オブジェクトを生成する
    Employee *yamada = new Employee(1200, 100);

    // メンバー関数を呼び出す
    std::cout << "yamadaの給与 = " << yamada->salary() << std::endl;

    // 動的オブジェクトを破棄する
    delete yamada;
  }

  return 0;
}