Stock: Profit or Loss?
Webapp based on VanillaJS. Helps the user to find the amount of profit or loss made on a particular stock.
Working
- The user enters the cost price, quantity of stock and the current price of the stock and then clicks on the CHECK button.
- The app first checks if all the input fields are filled or not. If not an alert is thrown to the user.
- Then all input values are stored in respective variables.
- If the current price is greater than the cost price it is a profit for the user. Profit amount and percentage is calculated and displayed in the output section ofr the user.
- If the current price is less than the cost price it is a loss for the user. Loss amount and percentage is calculated and displayed in the output section for the user.