Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Constant variables assignmentweight 03 quizweight 03 examweight 04 def calculateGPAstudentname assig...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