December 2021
Intermediate to advanced
352 pages
9h 32m
English
Here’s a function declaration:
double salary(PayGrade grade, int location_id);
It’s nice to see “double salary” at the start of a line of code; sadly, the purpose of this function is not to double your salary, but to report a salary for a particular pay grade at a particular location. Also, as remarked earlier, you should use integral types for money, so we shall redeclare this function, thus:
int salary(PayGrade grade, int location_id);
You might see this sort of thing in a government contract: civil servant salaries are often pegged to a pay grade but will vary by location. In the UK, for example, ...
Read now
Unlock full access