Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.
int calculate_fee(int cost) {
int result;
if (cost <= 5000)
throw new NotInterestingGetAnotherArchitectError();
// or simply 'return 8*cost/100;'
// 8% of the first 5000.00$ of the cost of a building
result = 8*5000/100;
// remainder
cost = cost - 5000;
// 3% on the remainder if the remainder is less than or equal to 80000.00
if (cost <= 80000) {
result = result + 3*cost/100;
else // or 2 1/2 % on the remainder if the remainder is more than 80000.00$.
result = result + 2.5*cost/100;
return result;
}
int main () {
...
calculate_fee(...)
...
}
If you are experiencing a similar issue, please ask a related question
Join the community of 500,000 technology professionals and ask your questions.