This is my second day of learning programming. I wanted a real world problem that could be solved with some simple lines of code.
Scenario
Sometimes, I may have to price match a product with an online competitor. However, that competitor may not charge sales tax when I have to. Essentially, I want to make my final product price (after taxes) the same as the online competitor.
My solution:
If I was to do this without programming, I usually state it in an equation like:
x + (x*salesTax) = competitors price
I then input the two variables I know (comp price and sales tax)and solve for x. After thinking about that, this became my code:
My question is, with this only being my second day of learning, how would you guys handle this differently? Right now, I don't know how to stop a decimal after two places (or round up). Is there anything you would do differently?