#Name: Mandy Brown
#Program purpose: To calculate a student's total marks and determine whether he/she has passed. The program takes in four inputs (student name and three subject scores).
#Completion Date: 11/6/2020
#Course:CMIS 102
print('Enter your Marks. N/B You cannot score more than 100:\n')
name = input('Enter your name: ')#takes in the student's name
exam_one = int(input('Enter exam one score: '))#exam one score
exam_two = int(input('Enter exam two score: '))#exam 2 score
exam_three = int(input('Enter exam three score: '))#exam 3 score
if(exam_one>100 or exam_two>100 or exam_three>100):# ensures that all the entered scores are not above 100%
    print('Check your entries and try again\n') #statement is executed if any of the scores is above 100
else:#the program executes the following scores if no scores are above 100
    print('#Calculating score .................')
    total=exam_one+exam_two+exam_three # calculates student total marks
    average_mark=total/3#average is equal to total divide no. of subjects
    passmark=225 #predetermined passmark
    if(total>=passmark):#student has passed is total is greater or equal to passmark
        print('Congrats ',name, 'you passed.')
        print('Your total marks are ',total,'%')
        print('Your average is ', average_mark)
    else: # the statement is executed if the student has failed.
        print('You Failed. Your total marks are',total,'%. The passmark was ',passmark,'%\n')
        print('Your average is ', average_mark)
