-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathGradeConverter.py
More file actions
83 lines (61 loc) · 1.34 KB
/
GradeConverter.py
File metadata and controls
83 lines (61 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Grade Converter
# Created by Nathan R (Mosrod) https://github.com/Mosrod
# Grading based on http://cs.smith.edu/~jorourke/Grading.html
# Imports
from time import sleep
import sys
# Variables
ask = 1
# Definitions
# Checker
def checker():
if Score >= 97.5:
print("A+")
elif Score >= 92.5:
print("A")
elif Score >= 90.0:
print("A-")
elif Score >= 87.5:
print("B+")
elif Score >= 82.5:
print("B")
elif Score >= 80.0:
print("B-")
elif Score >= 77.5:
print("C+")
elif Score >= 72.5:
print("C")
elif Score >= 70.0:
print("C-")
elif Score >= 67.5:
print("D+")
elif Score >= 62.5:
print("D")
elif Score >= 60.0:
print("D-")
elif Score < 60.0:
print("F")
# Code
text = "Welcome to Grade Converter"
for character in text:
sys.stdout.write(character)
sleep(0.1)
print("\n")
text = "Created by Nathan R (Mosrod)"
for character in text:
sys.stdout.write(character)
sleep(0.05)
print("\n")
while ask == 1:
Choice = input("Fraction/Percent [F/P]:")
ask = 0
if Choice == "F" or Choice == "f":
Numerator = float(input("Points: "))
Denominator = float(input("Total: "))
Score = Numerator/Denominator * 100
checker()
if Choice == "P" or Choice == "p":
Score = float(input("Percent: "))
checker()
else:
ask = 1