Answered step by step
Verified Expert Solution
Link Copied!

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?


image

# 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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

=+What is the expected value of purchasing a Thursday ticket?

Answered: 1 week ago