Share your repls and programming experiences

← Back to all posts
Tip calculator
StevenMatiz (4)

A simple calculator to help with tipping your waiter or waitress.

Asks the user for the bill, then prompts the user to pick any of the most common tip percentage options (15%, 18%, or 20%), and finally provides the user the original bill, tip, and the final bill. Also features a return option to rerun the program.

Commentshotnewtop
Andi_Chin (11)

it's nice seeing people using C++ on here. Python and JS are kinda overrated

AdCharity (598)

@Andi_Chin well I mean all languages are important but C++ is like foundational stuff

StevenMatiz (4)

@Andi_Chin
Hi, thanks for the comment! C++ is the only language I know as of now haha. I do plan on learning Python and especially more of HTML during the summer or else time in the future.

AdCharity (598)

have respect to all C programmers (I understand it and suck at it). Nice work.

StevenMatiz (4)

@AdCharity Thanks! Just started out, means a lot to get a compliment from a pro.

AdCharity (598)

@StevenMatiz please I'm not a pro - I'm just a self learner :D I started out with higher level languages (meaning they are more readable to the user; it has nothing to do with difficulty) so I've always thought as people who start off in lower level languages like C to be pretty amazing.

Edit: happy programming

mamamia5x (55)

@AdCharity C++ *puts on nerd glasses*

AsaM (0)

This is super cool! Also am I reading this wrong or is "The bill after the tip is" supposed to subtract the tip from the bill?
Here is what I got. I thought it would add the bill and the tip but I'm kind of simple some times...

Please pick a tip option for $20.00.

Press 1 for 12% (minimum tip).
Press 2 for 15% (medium tip).
Press 3 for 20% (high tip).

Enter option here: 3

The bill is $20.00
The tip is $4.00
The bill after the tip is $16.00
StevenMatiz (4)

@AsaM
Hey! So believe it or not, I went out to a restaurant (Buffalo Wild Wings) and I used this and ran into the exact same problem. As it turns out, I made a little comprehension mistake when I typed the code! In the code, I programmed final bill as "bill"-"tip" instead of "bill" +"tip". It was a good laugh when I saw that my "final bill" was less than my original bill! Anyways, if I hadn't gone out tonight, I bet I wouldn't have found this. Thank you for catching this and bringing it to my attention!