Production: N/A Staging: N/A
This project focuses on practice building a tip calculator in JavaScript-based programming. It serves to solve a real-world issue where parties question how much they should tip their waiter/waitress when dining out in public.
- Incorporate state of input
- Factor in dynamic values to return a calculated tip
- This will be the first project I have worked on which requires the ability to pass a
<select>
<option>
into React state. I solved this problem by researching methods to accomplish this. What I was missing is something so simple... assigning a value to each option and passing that value into state viaonChange={}
. This made me feel silly to forget, but I'm happy the solution was so simple. - Applying a calculation on what it otherwise a string can be troublesome. I certainly did not want to be the fool who tried, so I had to do some conversions to display tip information in a hundredths format after being calculated in this.setState({}). Luckily, I remembered some important information I found online while practicing technical interview questions. Specifically, how the + works in front of a string. It converts numerical strings to integers. This was a very clean way to represent the logic in my application.
- A calculator that processes the tip owed to a waiter/waitress based on bill total, service rating and party count
- React.js
- Node.js
- JavaScript
- CSS
- HTML
Dependency | URL |
---|---|
None | N/A |
There is currently no back-end associated with this project.
To get the site running locally:
- Clone this repo
- Run
npm install
to ensure the default dependencies are installed - Run
npm start
to run the application in a production environment
npm run dev
- Runs the development environment on your systemnpm start
- Runs the production environment on your system
There is currently no testing on this application.
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
If you are having an issue with the existing project code, please submit a bug report under the following guidelines: -Check first to see if your issue has already been reported. -Check to see if the issue has recently been fixed by attempting to reproduce the issue using the latest master branch in the repository. -Create a live example of the problem. -Submit a detailed bug report including your environment & browser, steps to reproduce the issue, actual and expected outcomes, where you believe the issue is originating from, and any potential solutions you have considered.
I would love to hear from you about new features which would improve this app and further the aims of my project. Please provide as much detail and information as possible to show me why you think your new feature should be implemented.
If you have developed a patch, bug fix, or new feature that would improve this app, please submit a pull request. It is best to communicate your ideas with the developers first before investing a great deal of time into a pull request to ensure that it will mesh smoothly with the project.
Pull Request Guidelines
- Ensure any install or build dependencies are removed before the end of the layer when doing a build.
- Ensure that your code conforms to our existing code conventions and test coverage.
- Include the relevant issue number, if applicable.
- You may merge the Pull Request in once you have the sign-off of the developer(s).