Skip to content

Algorithm Outline

Zachary Wimer edited this page Dec 25, 2016 · 3 revisions

##Main flow:

  1. Parse the requirements file for the major and distribute them between the major and hass requirement vector's
  2. Call the compareCourses() function for hass and then major
  3. Iterates through each requirement checking if it is satisfied
  4. Calls corresponding functions to handle non-singular requirements such as free electives, ranges(ex CSCI-4000+), and concentration requirements.
  5. Adds unsatisfied requirements to a "needed" vector.
  6. Once both hass and major finish, add the missing requirements to the output pair of maps.

##Data structure for Classes Required:

std::vector< std::vector<std::string> >
  • Each element in the vector will be a requirement vector
  • Each requirement vector will contain a list of OR sub requirements
  • This means that if there is a required class the size of that element vector will be 1
  • Something such as CSCI-4000+ will be stored as such and any 4000 level CSCI course will satisfy it

##Data structure for Courses Taken:

std::map<string, int>
  • Each key is a course name (ex CSCI-4020)
  • Each value is the number of credits the course is
  • As requirements are satisfied, the courses are removed from this data structure

##Data structure for Comments:

std::vector<string>
  • Contains the most recent comment for each requirement
  • Is attached to the return maps and displayed to the user for easier readability

##Data structure for Return value:

std::pair<std::map<std::string, std::string>, std::map<std::string, std::string> >
  • Pair of maps, one for hass and one for major
  • Each contains keys of unsatisfied requirements
  • Each contains values of a comment for that requirement

Clone this wiki locally