Let’s take a look below at the end results of the project to see what we’re looking at and what sort of functionality we need.
Side note, for the sake of this article let’s assume we already have the HTML and CSS written out before we begin the pseudocode.
We need to be able to enter a bill amount, the percentage of tip, the tip value, and the total of the bill plus the tip value. We also need to know how many people to split the bill amongst, the bill total for each, and the tip amount for each.
The beauty, or ugliness depending on how you want to look at it, of using pseudocode is that there is no right or wrong way to write it.
- INPUT bill amount
- STORE bill amount in BILL variable
- OUTPUT BILL
- INPUT tip percent
- STORE tip percent in TIP PERCENT variable
- OUTPUT TIP PERCENT
- OUTPUT tip value in dollars
- OUTPUT total (bill + tip) in dollars
- INPUT number of people to split the bill
- STORE number of people to split the bill in SPLIT variable
- OUTPUT SPLIT
- OUTPUT bill total for each person
- OUTPUT tip for each person