// 9.4Exercise.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include using namespace std; void GetInput(float& salary, int& years_service); void CalcRaise(float& salary, int years_service); int CalcBonus(int years_service); void PrintCalculations(int years_service, float salary, int bonus); int main() { float salary; int bonus, years_service; GetInput(salary, years_service); CalcRaise(salary, years_service); bonus = CalcBonus(years_service); PrintCalculations(years_service, salary, bonus); } void GetInput(float& salary, int& years_service) { cout << "Input the employee salary: "; cin >> salary; cout << "\nInput the years the employee has worked: "; cin >> years_service; cout << "\n\n"; } void CalcRaise(float& salary, int years_service) { if (years_service >= 10) { salary *= 1.1; } else if (years_service >= 5) { salary *= 1.05; } else { salary *= 1.02; } } int CalcBonus(int years_service) { int bonus; bonus = (years_service / 2) * 500; return bonus; } void PrintCalculations(int years_service, float salary, int bonus) { cout << "The employee has worked for " << years_service << " and as a result their new salary will be: $" << salary << ", and they will recive a bonus of: $" << bonus << "."; }