⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch11cemployee.cpp

📁 此例子是学习C++的好东西
💻 CPP
字号:
//Program 11-3  CEmployee        CEmployee class and file organization

//File:  Ch11CEmployee.cpp

#include "Ch11CEmployee.h"
#include <iostream.h>
#include <string.h>

CEmployee::CEmployee()
{
	name[0] = '\0';
	SSN[0] = '\0';
	salary = 0;
	dept = 0;
}

void CEmployee::GetEmpInfo()
{
	char extra_enter;
	cout << "\n Enter the employee's name    ";
	cin.getline(name,50);
	cout << "\n Enter the employee's SSN   ";
	cin.getline(SSN,15);
	cout << "\n Enter the dept code and salary   ";
	cin >> dept >> salary;
	cin.get(extra_enter);
}

void CEmployee::WriteEmpInfo()
{
	cout << "\n Employee: " << name <<  "\n      SSN: " << SSN;
	cout << "\n     Dept:  " << dept << "\n   Salary:  $" << salary;

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -