diff --git a/.idea/CNA340.iml b/.idea/CNA340.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/CNA340.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d56657a --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..3ed0976 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..9e485bd --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + 1683683291220 + + + + \ No newline at end of file diff --git a/README.md b/README.md index f6a26f4..a03c3be 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,29 @@ -# Project Title +# Number to Letter Grade -One Paragraph of project description goes here. +This code takes a number between 0-100 and determines a letter grade for a student. ## Getting Started -These instructions will [do something] on your local machine for [development/experimentation/demo]. +These instructions will run this code for translating number grades to letter grades with the letterGrade.py script. ### Prerequisites -[Project] requires [software and version] to run, with [additional packages, libaries, or mods]. The commands below will [upgrade OS and install the prerequisites, or do something else] +letterGrade.py requires Python 3 to run. You can install Python 3 by following the link below. ``` -sudo apt update -sudo apt upgrade -sudo apt install package1 package2 +https://www.python.org/downloads/ ``` ## Running + Once installed you can run the program with the following command ``` -python cna_demo.py +python3 letterGrade.py ``` -Add any additional ways to run the program below - -``` -python cna_demo.py test.txt -``` +The program will prompt you to enter a number between 0 and 100, if you enter a number below 0 or above 100 you will be prompted again to enter a number between 0 and 100. ## Thanks -Provide thank yous and attributions here. If someone helped you, you looked at another repository, or another article, provide it here. + +Thank you for checking out my code! I hope you enjoy it! I couldn't have done it without the wonderful instructors in the CNE program at Renton Technical College. diff --git a/letterGrade.py b/letterGrade.py new file mode 100644 index 0000000..416d182 --- /dev/null +++ b/letterGrade.py @@ -0,0 +1,37 @@ +def letter_grade(number): + +#Makes sure the the input is between 0 and 100. + while number < 0 or number > 100: + number = int(input("Enter your grade here (overall percent between 0 and 100), do not include the % symbol")) + +#Takes number and returns letter grade. + if number <= 100 and number >= 90: + print('A') + return + elif number <90 and number >= 87: + print('B+') + return + elif number < 87 and number >= 80: + print('B') + return + elif number < 80 and number >= 77: + print('C+') + return + elif number < 77 and number >= 70: + print('C') + return + elif number < 70 and number >= 67: + print('D+') + return + elif number < 67 and number >= 60: + print('D') + return + else: + print('F') + return + +def main(): + number_grade = int(input("Enter your grade here (overall percent between 0 and 100), do not include the % symbol")) + letter_grade(number_grade) + +main() \ No newline at end of file