#Author: Maheen Hannan
#Date & Time: 13/10/2015 12:32PM
#Purpose: Mark to grade converter
# import time to control flow of time within the program.
import time
# print command to output text to the terminal.
print('Welcome to Marks-to-Grade Conversion program prowered by Python 3.4')
print ()
print ('Note:')
print ('Grades are U -> A')
print('Mark minimum is 0, maximum is 100')
print ()
# 'n' as a variable for name input, input to allows user input.
# 'input' is given so that the user is allowed to enter an input.
n = input('Enter your name: ')
# while True command used to define a correct input.
while True:
# If an error is expected it will stop tranfer.
try:
print ()
# 'm' is the variable for the amount of marks inputted by the user.
# 'int' is used so that the inputted number will be an interger.
m = int(input('Enter your mark: '))
print ()
# When a character is entered that it is not a number it will return with an
error.
except ValueError:
# '\' is gien so that the word 'not' is not given as a function.
print ('That\'s not a number!')
# If a character is entered that is a number it will flow into this string of
options.
else:
# 'if' is given so that when a number is entered a sepecific result will be
given.
# '? < 'int(m)' < ?' is given to create a range of numbers.
if -1 < int(m) < 101:
if -1 < int(m) < 40:
# '(?-(m))' is given so that it can calculate the difference
between a number and the given number by the user.
print ((n),'you have received Grade U.', 'You were', (40-(m)),
'away from Grade E.')
# 'time.sleep' is given to end the program after a given amount of
seconds.
time.sleep (3)
# Stop the script.
#Date & Time: 13/10/2015 12:32PM
#Purpose: Mark to grade converter
# import time to control flow of time within the program.
import time
# print command to output text to the terminal.
print('Welcome to Marks-to-Grade Conversion program prowered by Python 3.4')
print ()
print ('Note:')
print ('Grades are U -> A')
print('Mark minimum is 0, maximum is 100')
print ()
# 'n' as a variable for name input, input to allows user input.
# 'input' is given so that the user is allowed to enter an input.
n = input('Enter your name: ')
# while True command used to define a correct input.
while True:
# If an error is expected it will stop tranfer.
try:
print ()
# 'm' is the variable for the amount of marks inputted by the user.
# 'int' is used so that the inputted number will be an interger.
m = int(input('Enter your mark: '))
print ()
# When a character is entered that it is not a number it will return with an
error.
except ValueError:
# '\' is gien so that the word 'not' is not given as a function.
print ('That\'s not a number!')
# If a character is entered that is a number it will flow into this string of
options.
else:
# 'if' is given so that when a number is entered a sepecific result will be
given.
# '? < 'int(m)' < ?' is given to create a range of numbers.
if -1 < int(m) < 101:
if -1 < int(m) < 40:
# '(?-(m))' is given so that it can calculate the difference
between a number and the given number by the user.
print ((n),'you have received Grade U.', 'You were', (40-(m)),
'away from Grade E.')
# 'time.sleep' is given to end the program after a given amount of
seconds.
time.sleep (3)
# Stop the script.