Question
#MODIFY THE TEMPLATE TO: Write a program that accepts six project scores. All scores are #out of 100 points, except the first (which is out
#MODIFY THE TEMPLATE TO: Write a program that accepts six project scores. All scores are #out of 100 points, except the first (which is out of 30), and the fifth (which is out #of 50). The program provides the highest average grade for all the projects by dropping the #one with the lowest percentage. For example, #if a student got a 65% on the first project (out of 30) and a 55% on the fifth project #(out of 50), that fifth project would be dropped from the average calculation. import subprocess def template(n1,n2,n3,n4,n5,n6): number1 = n1 #this gets the first number from the user and stores it in a memory location called number1 number2 = n2 number3 = n3 number4 = n4 number5 = n5 number6 = n6 result = 0 return result #END OF YOUR CODE test1 = template(0,100,100,100,50,100) test2 = template(30,0,100,100,50,100) test3 = template(30,100,0,100,50,100) test4 = template(30,100,100,0,50,100) test5 = template(30,100,100,100,0,100) test5a = template(30,100,100,100,50,0) test6 = template(15,55,55,55,25,55) if (test1 == 100): print "average of (0,100,100,100,50,100) is 100, you got it RIGHT!" else: print "average of (0,100,100,100,50,100) is 100, you got: " + str(test1) if (test2 == 100): print "average of (30,0,100,100,50,100) is 100, you got it RIGHT!" else: print "average of (30,0,100,100,50,100) is 100, you got: " + str(test2) if (test3 == 100): print "average of (30,100,0,100,50,100) is 100, you got it RIGHT!" else: print "average of (30,100,0,100,50,100) is 100, you got: " + str(test3) if (test4 == 100): print "average of (30,100,100,0,50,100) is 100, you got it RIGHT!" else: print "average of (30,100,100,0,50,100) is 100, you got: " + str(test4) if (test5 == 100): print "average of (30,100,100,100,0,100) is 100, you got it RIGHT!" else: print "average of (30,100,100,100,0,100) is 100, you got: " + str(test5) if (test5a == 100): print "average of (30,100,100,100,100,0) is 100, you got it RIGHT!" else: print "average of (30,100,100,100,100,0) is 100, you got: " + str(test5a) if (test1 == 100 and test2 == 100 and test3 == 100 and test4 == 100 and test5 == 100 and test5a == 100): print "Your code is CORRECT!" result = subprocess.check_output("curl -k https://cs.gmu.edu/~kdobolyi/sparc/process.php?user=sparc_5G6G41LC12345678-chapter2_7-COMPLETED", shell=True) else: print "Please check your code, at least one test case did not pass." result = subprocess.check_output("curl -k https://cs.gmu.edu/~kdobolyi/sparc/process.php?user=sparc_5G6G41LC12345678-chapter2_7-PROGRESS", shell=True)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started