Note: This question was posted a year ago, but in Python 3.4.3 there is a syntax
ID: 667258 • Letter: N
Question
Note: This question was posted a year ago, but in Python 3.4.3 there is a syntax error and it will not run it. It has to be written in Python and I appreciate any help.
In this assignment, we will develop an algorithm to calculate the final grade for a class of 25 students. There are 10 assignments (20 points each) as well a midterm and a final (100 points each). Another 20 points are for in-class participation.
All the assignments and tests contribute to the final grade equally. Additionally, the in-class participation (either thru Discussions or in real-time) is also a part of the final grade.
Next, we code the algorithm in Python along with comments and documentation, and make sure it runs successfully. For the code, we define a MAIN program (or driver) as well as a few functions and methods (e.g. get_grades, cumulate_total_points, determine_final_grade, ....) These should be invoked by the driver via function calls and with arguments passed back and forth.
In the end we display all the students net-ID and their final grade in a table format.
Since this is an interactive program, make sure we display meaningful headings and instructions/prompts to the end-user.
Please let me know if you have further questions.
Explanation / Answer
__author__ = 'Ekta' def main(): '''business logic for when running this module as the primary one!''' for count in range(1, 25): a1=input ("Please enter marks in assignment 1") a2=input ("Please enter marks in assignment 2") a3=input ("Please enter marks in assignment 3") a4=input ("Please enter marks in assignment 4") a5=input ("Please enter marks in assignment 5") a6=input ("Please enter marks in assignment 6") a7=input ("Please enter marks in assignment 7") a8=input ("Please enter marks in assignment 8") a9=input ("Please enter marks in assignment 9") a10=input("Please enter marks in assignment 10") m1=input ("Please enter marks in Midterm") final_m=input ("Please enter marks in Final Exam") class_p=input ("Please enter marks in Class Participation") total=(a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+m1+final_m+class_p)/420 print(getGrades(total)) cumulate_total_points() determine_final_grade() print_final_grade() # Here's our payoff idiom! if __name__ == '__main__': main() def cumulate_total_points(): print("In cumulateTotalPoints") def determine_final_grade(): print("In determineFinalGrade") def print_final_grade(): print("In printFinalGrade") def getGrades(score): if score >= 90.0: return 'A' elif score >= 80.0: return 'B' elif score >= 70.0: return 'C' elif score >= 60.0: return 'D' else: return 'F'
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.