Looking For Cumulative Average - Python Program Assignment Help - Find Perfect Assessment Solutions at Expertsmids!!

Home   Course  
Previous << || >> Next

Python Program Assignment -

Question - Write a program that asks the user to enter a student's name and 8 numeric assignment scores. The program should output the students name, a letter grade for each assignment score, and cumulative average for all the assignments. Please note, there are 12 students in the class so your program will need to be able to either accept data for 12 students or loop 12 times in order to process all the students in the class.

EXPERTSMINDS.COM GIVES ACCOUNTABILITY OF YOUR TIME AND MONEY - AVAIL TOP RESULTS ORIGINATED CUMULATIVE AVERAGE - PYTHON PROGRAM ASSIGNMENT HELP SERVICES AT BEST RATES!

Answer - PROJECT REPORT

Python Source code of the program:

def calc_average(mrk1, mrk2, mrk3, mrk4, mrk5, mrk6, mrk7, mrk8): # function to calculate average marks

avgmrk = (mrk1 + mrk2 + mrk3 + mrk4 + mrk5 + mrk6 + mrk7 + mrk8)/8;

return avgmrk

def determine_grade(mrk): # function to find the letter grade of marks

if int(mrk) >= 90 and int(mrk) <= 100 :

grd = "A"

elif int(mrk) >= 80 and int(mrk) <= 89:

grd = "B"

elif int(mrk) >= 70 and int(mrk) <= 79:

grd = "C"

elif int(mrk) >= 60 and int(mrk) <= 69:

grd = "D"

else:

grd = "F"

return grd

def main():

# list to store student names and marks in 8 subjects

sname = []

mark1 = []

mark2 = []

mark3 = []

mark4 = []

mark5 = []

mark6 = []

mark7 = []

mark8 = []

for i in range(0,12): # for loop to enter student name and marks in 8 subjects into lists

nam = input("Enter Student Name : ")

sname.append(nam)

m1 = int(input("Enter marks 1 : "))

mark1.append(m1)

m2 = int(input("Enter marks 2 : "))

mark2.append(m2)

m3 = int(input("Enter marks 3 : "))

mark3.append(m3)

m4 = int(input("Enter marks 4 : "))

mark4.append(m4)

m5 = int(input("Enter marks 5 : "))

mark5.append(m5)

m6 = int(input("Enter marks 6 : "))

mark6.append(m6)

m7 = int(input("Enter marks 7 : "))

mark7.append(m7)

m8 = int(input("Enter marks 8 : "))

mark8.append(m8)

for i in range(0, 12): # for loop to calculate average marks and find the letter grade for each marks and print the student record

# call the calc_average function to calcuate the average marks

avgpc = calc_average(mark1[i], mark2[i], mark3[i], mark4[i], mark5[i], mark6[i], mark7[i], mark8[i])

# call the determine_grade function to find the letter grade for each subject marks

ltrgrd1 = determine_grade(mark1[i])

ltrgrd2 = determine_grade(mark2[i])

ltrgrd3 = determine_grade(mark3[i])

ltrgrd4 = determine_grade(mark4[i])

ltrgrd5 = determine_grade(mark5[i])

ltrgrd6 = determine_grade(mark6[i])

ltrgrd7 = determine_grade(mark7[i])

ltrgrd8 = determine_grade(mark8[i])

print()

#print the student records

print("%s \t %s %s %s %s %s %s %s %s %.2f" % (sname[i], ltrgrd1, ltrgrd2, ltrgrd3, ltrgrd4, ltrgrd5, ltrgrd6, ltrgrd7, ltrgrd8, avgpc))

print()

main()

ENROL WITH CUMULATIVE AVERAGE - PYTHON PROGRAM ASSIGNMENT HELP AND HOMEWORK WRITING SERVICES OF EXPERTSMINDS.COM AND GET BETTER RESULTS IN CUMULATIVE AVERAGE - PYTHON PROGRAM ASSIGNMENTS!

Tag This :- TG20COS39PYT Cumulative Average - Python Program Assignment Help

get assignment Quote

Assignment Samples

Get Academic Excellence with Best Skilled Tutor! Order Assignment Now! Submit Assignment