Skip to content

trhgquan/GPA-OOP

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPA-OOP

C/C++ CI

Calculating my GPA, in an OOP way.

screenshot.png

Installation

Prerequisites

  • Make sure your C++ version >= C++17.

How-to:

  1. git clone the project.
  2. Compile:
  • using Makefile:

    make
    
  • On Windows:

    g++ src/main.cpp main -std=c++17
    

So simple, right?

Running

1. Input format

  • The input .csv file should looks like this:

    course code course credit course grade
    CSC10001 4 10
    CSC10002 4 8.5
    ... ... ...

2. Command-line arguments

Given that the program has been compiled successfully to <PROGRAM>.exe, then:

  • To calculate overall GPA:

    ./<PROGRAM> --input <GRADE_FILE.csv> --gpa
  • To calculate GPA of courses start with a prefix:

    ./<PROGRAM> --input <GRADE_FILE.csv> --specific <SPECIFIC_COURSES.txt>

    <SPECIFIC_COURSES.txt> content should looks like this:

    course1prefix
    course2prefix
    course3prefix
    
    (notice that if you use full course code, then only one course added,
    using a prefix would choose every course have `courseprefix` as a prefix).
    
  • To calculate GPA but ignore some courses defines inside <IGNORED_COURSES.txt>:

    ./<PROGRAM> --input <GRADE_FILE.csv> --ignore <IGNORED_COURSES.txt>

    IGNORED_COURSES.txt content should looks like this:

    course1code
    course2code
    course3code
    
    (notice that this command using course code, not prefix. To ignore courses
    with a same prefix, using --specific without a prefix).
    
  • Export to .csv format:

    ./<PROGRAM> --input <GRADE_FILE.csv>
      [--specific <SPECIFIC_COURSES.txt> /
       --ignore <IGNORED_COURSES.txt>] --csv
  • Ignore parsing errors

    With .csv files created by Microsoft Excel, sometimes there will be blank lines marked by two commas between data blocks:

    CSC10001,4,10
    ,,
    CSC10002,4,8.5
    

    And eventually this will cause an error message logging to the screen.

    To ignore this: simply adding --ignore-parsing-error option:

    ./<PROGRAM> --input <GRADE_FILE.csv>
    [--specific <SPECIFIC_COURSES.txt> /
    --ignore <IGNORED_COURSES.txt>] [ --csv ]
    --ignore-parsing-error

3. Shell scripts

Example commands for running are in example/run.sh.example, for compiling are in example/compile.sh.example.

4. Custom textart

  • data/textart.txt stores the textart file. Modify it with your own textart.

Attention!

  1. Default grade scale is 10.
  2. 4-scale and A-scale are based on VNUHCM - University of Science Student Guide 2020-21

About

Calculate GPA, in an OOP way.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 90.0%
  • Shell 8.6%
  • Other 1.4%