/share-the-cost

A simple app that allows a user to calculate who owes money and who is owed money after a trip away.

Primary LanguageJavaScript

share-the-cost

This app allows a user to calculate who owes money and who is owed money at the end of an event or trip. The user can enter the name of a person and how much they have paid for food, drinks, taxis, accommodation, travel etc. The annoying part at the end of a trip away where people have spent more than others on things here and there inspired the app to make it easier for friends to sit down and quickly see where they stand.

The app calucaltes and displays:

  • The total spent on the event or trip.
  • The ammount each person spent out of their own budget.
  • Who owes money.
  • Who is owed money.

The app allows friends to easily see how much extra they need to throw into the 'pot' or how much they can take back from the 'pot' after everyone has paid in.

NOTE: As it's a simple app for friends who won't argue over loose change, all numbers are treated as integers instead of floats and are therefore rounded down. It can be adapted for decimals for more accurate calculations in business situations.

SKILLS COVERED:

  • JS classes, methods and properties
  • DOM manipulation
  • Data validation
  • Regular expressions
  • Basic JS - loops, arrays, functions