Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user to pass in passing grades #124

Open
haydenfree opened this issue Sep 29, 2021 · 1 comment
Open

Allow user to pass in passing grades #124

haydenfree opened this issue Sep 29, 2021 · 1 comment
Assignees
Labels
simulation related to simulation capabilities

Comments

@haydenfree
Copy link
Member

passing_grades = ["A", "B", "C", "D", "P"]

Passing grades are currently hardcoded as a string value, but users should be able to pass these in.

Additionally, we should leverage the Grade type defined in DegreeRequirements

Grade = UInt64
# function for converting a letter grade into a integer, divide by 3 to convert to 4-point GPA scale
function grade(letter_grade::AbstractString)
if letter_grade == "A➕"
return convert(Grade, 13)
elseif letter_grade == "A"
return convert(Grade, 12)
elseif letter_grade == "A➖"
return convert(Grade, 11)
elseif letter_grade == "B➕"
return convert(Grade, 10)
elseif letter_grade == "B"
return convert(Grade, 9)
elseif letter_grade == "B➖"
return convert(Grade, 8)
elseif letter_grade == "C➕"
return convert(Grade, 7)
elseif letter_grade == "C"
return convert(Grade, 6)
elseif letter_grade == "C➖"
return convert(Grade, 5)
elseif letter_grade == "D➕"
return convert(Grade, 4)
elseif letter_grade == "D"
return convert(Grade, 3)
elseif letter_grade == "D➖"
return convert(Grade, 2)
elseif letter_grade == "P"
return convert(Grade, 0)
elseif letter_grade == "F"
return convert(Grade, 0)
elseif letter_grade == "I"
return convert(Grade, 0)
elseif letter_grade == "WP"
return convert(Grade, 0)
elseif letter_grade == "W"
return convert(Grade, 0)
elseif letter_grade == "WF"
return convert(Grade, 0)
else
error("letter grade $letter_grade is not supported")
end
end

@haydenfree haydenfree added the simulation related to simulation capabilities label Sep 29, 2021
@haydenfree
Copy link
Member Author

This is related to #116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
simulation related to simulation capabilities
Projects
None yet
Development

No branches or pull requests

2 participants