An algorithm is a step-by-step procedure to achieve a certain result. Examples are how to look up a word in a dictionary, or how to sort a list of words in alphabetical order.
Sometimes the method/strategy is not obvious, and the challenge is to find a strategy that does what is needed. At other times, a method or strategy is known, but we need a more efficient algorithm (to get it done faster, or in less steps).
In the case of dictionary, you have already looked up words before, so you know the strategy, so the challenge is to write down EVERY step you need to do, and what to do in EVERY possible outcome.
The same applies to tax calculation (sales tax or personal income tax?).
Detail every step and express it in words. The key is that you have to test your algorithm at the end by doing it ACCORDING TO the steps you listed. If it doesn't achieve the desired goal, you will need to revise the steps.
I need to do this but I don't know how to start! I'm so bad a this class, and I'm just taking it because is a required! Please help!
Write an algorithm that solves tax calculation problem.
2 answers
Thanks!