What’s To Be Done?
The very first step is to understand what is to be done
Generally, this entails specifying the inputs, the outputs and the processing that gets from in to out
The price is determined by three quantities:
- Base price, given by the cup size
- Number of shots of espresso
- State sales tax
Of these the coffee drinker specifies the first two, making them program inputs: size, shots
The output is the price: price
Task: Compute the price of a latte