aboutsummaryrefslogtreecommitdiff
path: root/week12/Exercise4/Company.cpp
blob: 9b172bdf1c7a12d83826ec0211ea1b8b4c03708c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "Company.h"
#include <iostream>

Company::~Company() {
	for (int i = 0; i < 128; i++) {
		delete employees[i];
	}
}

float Company::PaymentDifference() {
	float total = 0, performanced = 0;
	for (int i = 0; i < 128; i++) {
		if (employees[i] == nullptr) continue;

		total += employees[i]->paycheck;
		performanced += employees[i]->paycheck * employees[i]->efficiency;
	}
	return total - performanced;
}