This is a simple cash register application that allows users to calculate change based on the price of an item and the amount of cash provided by the customer. The application provides different messages based on whether the customer's cash is sufficient, exact, or insufficient to cover the price of the item.
The application performs the following tasks:
- Calculates the change due to the customer.
- Checks if the cash provided is sufficient to cover the price.
- Handles different scenarios like exact payment, insufficient funds, and closed cash drawer.
- Outputs messages and the breakdown of change in different currency units.
- JavaScript
- HTML
- CSS (Required for styling the application)
The project consists of the following files:
index.html: Contains the structure and input elements of the application.styles.css: Provides styling for the HTML elements (CSS is essential for enhancing visual presentation).purchase.js: Manages the purchase logic and event handling.change.js: Calculates the change due based on the price and cash provided.format.js: Formats the output of the change due into a readable format.
To run the project locally:
- Clone the repository:
git clone <repo_url> - Open
index.htmlin your preferred web browser.
Contributions are welcome! If you find any issues or want to add new features, please feel free to fork the repository and submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.