Skip to content

Commit

Permalink
added readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Singleton committed Mar 24, 2017
1 parent 9d5c06c commit 178f7f7
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 14 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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`**.
24 changes: 12 additions & 12 deletions grades.json
Original file line number Diff line number Diff line change
@@ -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}
]
}
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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("=============")
Expand Down

0 comments on commit 178f7f7

Please sign in to comment.