This is a program that will calculate a person's age in Earth years, Mercury years, Venus years, Mars years, and Jupiter years. It will also determine how many years a person has left to live on each planet, based on the average life expectancy for that person's demographic. If a user has surpassed their life expectancy, it will return the number of bonus years they have lived!
- Open repo.
- Clone repo.
- In your terminal command line, run $npm install.
- Run $npm run build.
- Run $npm run start.
Behavior | Input | Output |
---|---|---|
Take in a user's birthday | June 5, 1992 | - |
Calculates their age in Earth years | June 5, 1992 | 27 Earth years |
Calculates their age in Mercury years | June 5, 1992 | 112 Mercurian years |
Calculates their age in Venus years | June 5, 1992 | 43 Venusian years |
Calculates their age in Mars years | June 5, 1992 | 14 Martian years |
Calculates their age in Jupiter years | June 5, 1992 | 2 Jovian years |
Calculates their years left or extra years lived on Earth | June 5, 1944 | 3.5 |
Calculates their years left or extra years lived on Mercury | June 5, 1944 | 14 |
Calculates their years left or extra years lived on Venus | June 5, 1992 | 72 |
Calculates their years left or extra years lived on Mars | June 5, 1992 | 24 |
Calculates their years left or extra years lived on Jupiter | June 5, 1992 | 4 |
- Does not take into account months. If a user's birthday has not yet happened for the year, it will return the age they will become, not their current age.
- For years left or bonus years lived on Jupiter, it will only return round numbers, so it is not highly accurate.
Should any problems occur, or any bugs discovered, please contact Reese at reese.lee.cy@gmail.com
This program was written in JavaScript and tested using Jasmine and Karma.
This software is licensed under MIT license.
Copyright (c) 2019 Reese Lee