In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.
Become a Premium Member and unlock a new, free course in leading technologies each month.
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
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.