我正在尝试制作这样的表格......(只是没有我用来分隔每个项目的点)
每周工资:
名称............标题............总......税收......净
Ebenezer Scrooge 合伙人 250.00 ..62.25 .187.75
Bob Cratchit ....文员 ....15.00 ....2.00 ..13.00
这就是我的代码在这部分的样子......
for (int count=0; count < numberOfEmployees; count++)
{
cout << "Employee: \n";
cout << "\t Name: ";
cin.getline (employees[count].name, EMPLOYEESIZE);
cout << "\t Title: ";
cin.getline (employees[count].title, EMPLOYEESIZE);
cout << "\t SSNum: ";
cin >> employees[count].SSNum;
cout << "\t Salary: ";
cin >> employees[count].Salary;
cout << "\t Withholding Exemptions: ";
cin >> employees[count].Withholding_Exemptions;
cin.ignore();
cout << "\n";
}
double gross;
double tax;
double net;
double adjusted_income;
cout << "\n";
cout << "Weekly Payroll: \nName \t \t Title \t Gross \t Tax \t Net \n";
for (int count=0; count < numberOfEmployees; count++)
{
gross = employees[count].Salary;
adjusted_income = subtraction_times (employees[count].Salary, employees[count].Withholding_Exemptions);
tax = adjusted_income * .25;
net = subtraction (gross, tax);
printf ("\n%s", employees[count].name);
}
我有表格的第一部分(名称部分),但之后我不知道现在要完成表格的其余部分。谁能帮我?
谢谢