Zebra0.com

cpp switchCalculate tip based on service: Y or N

Calculate tip based on service: Y or N

In this example, we calculate the tip as 20% if the service is 'Y' or 'y'. Otherwise, the tip is 15%. Compare this to the example using if/else.