Tip calculation app with HTML5, CSS3, JavaScript(Es6)
Design comparison
Solution retrospective
Fixed the calculation for third time.
I hope now the logic behind bill and tip calculation is appropriate.
Thank you so much. @EduardIonescu
Community feedback
- @EduardIonescuPosted almost 2 years ago
Hi, nice attempt at trying to solve the challenge!
The webpage works great when you only have 1 as the number of people.
The issues I'm seeing are:
totalAmount.innerHTML = $ ${parseFloat(num1*num2).toFixed(2)};
- You should try and divide the bill by the amount of people, that way you get how much each individual has to pay. Also try something like `( billValue + (billValue * tipPercentage) ) / numberOfPeople . This way the total bill includes the tip and is divided by how many people the user inputs. The same goes for the tip amount, you get it right but then you multiply it by the number of people instead of dividing.If you have any other questions, let me know and I hope this helps!
0@Das-DiptoPosted almost 2 years ago@EduardIonescu Okay thank you for the suggestion, I'm coding accordingly.
Fixed it, please check it on your leisure time and give me feedback.
Thanks again.
0@EduardIonescuPosted almost 2 years ago@Das-Dipto Hi, you did well for the total/person but you must do the same for the tip amount / person, because right now it doesn't get divided by the number of people.
After you solve that problem you should add the tip amount to the total amount, if that makes sense, since the total means the (bill+top) / people, right now you only show bill / people.
Btw about how it looks: try to give your buttons
cursor: pointer
in the css to make them feel more like buttons.I hope that helps and it's not too overwhelming haha
0@Das-DiptoPosted almost 2 years ago@EduardIonescu Hello, Finally I made it right, I hope now the calculation is appropriate.
Sorry for replying late, I was preparing and attending my undergrad final semester exam.
Thank you very much for suggesting briefly, couple of times about the proper solution.
1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord