Question: How to include an argument/parameter variable to this existing code? # Constant variables assignmentweight= 0.3 quizweight= 0.3 examweight= 0.4 def calculateGPA(): #Input the student's name

How to include an argument/parameter variable to this existing code?


# Constant variables assignmentweight= 0.3 quizweight= 0.3 examweight= 0.4 def calculateGPA(): #Input

# Constant variables assignmentweight= 0.3 quizweight= 0.3 examweight= 0.4 def calculateGPA(): #Input the student's name studentName= input("Please enter student's name: ") # Input grades fro assignments, quizzes, and exam a1= float(input("Please enter the grade for assignment 1: ")) A2= float(input("Please enter the grade for assignment 2: ")) a_3= float(input("Please enter the grade for assignment 3: ")) q1= float(input("Please enter the grade for quiz 1: ")) bird= float(input("Please enter the grade for quiz 2: ")) E1= float(input("Please enter the grade for Exam 1: ")) # Calculate the scores weight assignmentScore = (a1 + A2 + a 3) / 3 quizScore (q1 + bird) / 2 #Calculate the final GPA finalGPA = (assignmentScore * assignmentweight) #Output the student's name and GPA + print ("The GPA of", studentName, is finalGPA) calculateGPA() calculateGPA() calculateGPA() calculateGPA() calculateGPA() (quizScore * quizweight) + (E1 examweight)

Step by Step Solution

3.40 Rating (156 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Constant variables assignmentweight 03 quizweight 03 examweight 04 def calculateGPAstudentname assig... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!