From 178f7f76f050d949bdcb2ed7df06b55700d644d8 Mon Sep 17 00:00:00 2001 From: Tom Singleton Date: Fri, 24 Mar 2017 21:50:46 +0000 Subject: [PATCH] added readme --- README.md | 24 ++++++++++++++++++++++++ grades.json | 24 ++++++++++++------------ index.js | 6 ++++-- 3 files changed, 40 insertions(+), 14 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..1fea0e3 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# Grade Calculator + +**Warning: While this program is designed to calculate your grade, it may not be 100% accurate. Please take that in to consideration when using it. Also it is provided as is, no support is guarenteed.** + + + +## Updates + +If you find any issues with the calculator please feel free to open an issue, or if you are brave enough, open a pull request. + + + +## How To + +1. First make sure Node is installed https://nodejs.org/en/ +2. Clone this repo +3. Go to the repos directory in terminal/command prompt +4. Run `npm install` to install the node modules +5. Edit the `grades.json` file to contain your grades +6. Run `node index.js` and it will show you the results 😄 + + + +If you want multiple json grade files 🐷 you can run specific json files with `node index.js path/to/file.json` which will use the grades in the provided file. **The file must end with `.json`**. \ No newline at end of file diff --git a/grades.json b/grades.json index 819d2e5..a9e690d 100644 --- a/grades.json +++ b/grades.json @@ -1,21 +1,21 @@ { "second_year": [ - {"name": "203CR - Usability 2", "credits": 20, "grade": 40}, - {"name": "205CDE - Modern Web", "credits": 20, "grade": 40}, - {"name": "206CDE - Real-Word", "credits": 20, "grade": 40}, - {"name": "210CT - Data Structures", "credits": 20, "grade": 40}, - {"name": "220CT - Data information", "credits": 20, "grade": 40}, - {"name": "290COM - Ethics", "credits": 10, "grade": 40}, - {"name": "AdVantage", "credits": 10, "grade": 50}, + {"name": "203CR - Usability 2", "credits": 20, "grade": 61.5}, + {"name": "205CDE - Modern Web", "credits": 20, "grade": 60}, + {"name": "206CDE - Real-Word", "credits": 20, "grade": 79.3}, + {"name": "210CT - Data Structures", "credits": 20, "grade": 81.25}, + {"name": "220CT - Data information", "credits": 20, "grade": 67.20 }, + {"name": "290COM - Ethics", "credits": 10, "grade": 0}, + {"name": "AdVantage", "credits": 10, "grade": 82}, - {"name": "Placement", "credits": 40, "grade":40} + {"name": "Placement", "credits": 40, "grade":74} ], "third_year": [ - {"name": "301CEM - iOS Development", "credits": 20, "grade": 40}, + {"name": "301CEM - iOS Development", "credits": 20, "grade": 92}, {"name": "302CEM - Agile", "credits": 20, "grade": 40}, {"name": "303COM - Individual Project", "credits": 30, "grade": 40}, - {"name": "304CEM - Web API", "credits": 20, "grade": 40}, - {"name": "307CR - Pervasive Computing", "credits": 20, "grade": 35}, - {"name": "AdVantage", "credits": 10, "grade":49} + {"name": "304CEM - Web API", "credits": 20, "grade": 96}, + {"name": "307CR - Pervasive Computing", "credits": 20, "grade": 80}, + {"name": "AdVantage", "credits": 10, "grade":70} ] } \ No newline at end of file diff --git a/index.js b/index.js index 98bc7d5..96eef63 100644 --- a/index.js +++ b/index.js @@ -60,7 +60,9 @@ function createTable(modules) { return table.toString() } -const gradefile = require('./grades.json') +const gradeFileLocation = process.argv[2] !== undefined ? process.argv[2] : './grades.json' + +const gradefile = require(gradeFileLocation) const colors = require('colors') const Table = require('cli-table') @@ -336,7 +338,7 @@ const t100 = best100ThirdYear.avgGrade console.log(`100 from third: ${t100}%`) console.log("✅ Grade combinations complete".green) -console.log('n') +console.log('\n') console.log("Final Results") console.log("=============")