How to include an argument/parameter variable to this existing code? # Constant variables assignmentweight= 0.3 quizweight= 0.3
Fantastic news! We've Found the answer you've been seeking!
Question:
How to include an argument/parameter variable to this existing code?
Transcribed Image Text:
# 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) # 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)
Expert Answer:
Answer rating: 100% (QA)
Constant variables assignmentweight 03 quizweight 03 examweight 04 def calculateGPAstudentname assig... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Suppose that the revenue ( in dollars ) from the sale of a product is given by R = 4 0 x + 0 . 8 x 2 0 . 0 0 1 x 3 , where x is the number of units sold. Find each indicated derivative. R ' = R ' ' =...
-
The new line character is utilized solely as the last person in each message. On association with the server, a client can possibly (I) question the situation with a client by sending the client's...
-
PLEASE GIVE CORRECT ANSWERS Prove that the number of comparators in any sorting network is (n log n). [4 marks] (ii) What does Part (d)(i) imply in terms of the depth of any sorting network? [1 mark]...
-
Carl contributes equipment with a $50,000 adjusted basis and an $80,000 FMV to Cook Corporation for 50 of its 100 shares of stock. His son, Carl Jr., contributes $20,000 cash for the remaining 50...
-
Sketch cis and trans structures for (a) butadiene, and (b) chloroprene. Use two-dimensional schematics per footnote 11 of this chapter.
-
T-Mobile has a current market value of $35 million and is considering the acquisition of Sprint, whose current market value is $20 million. Both firms are all-equity. A market research study by the...
-
How do you draw the line between what is too detailed for the bylaws and what processes should be explained in that document? Why is this an issue?
-
Gary's Parts Shop recorded the following purchases and sales during the past year: Assume that Gary's Parts Shop sold all of the June 15 purchase and 100 cases each from the January 1 beginning...
-
Suppose x has a distribution with a mean of 90 and a standard deviation of 28. Random samples of size n = 64 are drawn. USE SALT (a) Describe the x distribution and compute the mean and standard...
-
Exercise 13-8 (Algo) Volume Trade-Off Decisions [LO13-5, LO13-6] Barlow Company manufactures three products-A, B, and C. The selling price, variable costs, and contribution margin for one unit of...
-
What will be the output of the algorithm given below? Algorithm: Step 1: Start Step 2: Initialize i = 2, j 3, c, m = 5 Step 3: Repeat step 4 to step 9 until i < 4 step by 1 Step 4: Compute c = m - 2...
-
Heather Smith Cosmetics (HSC) manufactures a variety of products and is organized into three divisions (investment centers): soap products, skin lotions, and hair products. Information about the most...
-
Plastic Molding, Inc. manufacturers plastic molding for automobiles. It's costing system utilizes two cost categories, direct materials and conversion costs. Each product must pass through the...
-
CHANGE IN ACCOUNTING ESTIMATE Able Corp. acquired a machine January 1, 20x12 for $800,000. The machine had an eight-year useful life with an estimated residual value of $80,000. The entity uses the...
-
Let 0 = 600. Find the reference angle for 0. Use the reference angle to draw and label the reference triangle in the appropriate quadrant of the coordinate plane. Use the reference triangle to...
-
A loan of $25,800.00 at 4.00% compounded semi-annually.Is to be repaid with payments at the end of every 6 months. The loan was settled in 5 years. Calculate the size of the periodic payment.
-
Assume Eq. 6-14 gives the drag force on a pilot plus ejection seat just after they are ejected from a plane traveling horizontally at 1300 km/h. Assume also that the mass of the seat is equal to the...
-
For each of the following statements, either prove it is true or give a counterexample to show it is false. (a) The product of two rational numbers is always rational. (b) The product of two...
-
Which of the following numbers are rational and which are irrational? (a) \(\sqrt{2}+\sqrt{\frac{3}{2}}\). (b) \(1+\sqrt{2}+\sqrt{\frac{3}{2}}\). (c) \(2 \sqrt{18}-3 \sqrt{8}+\sqrt{4}\). (d)...
-
(a) Let \(a, b\) be rationals and \(x\) irrational. Show that if \(\frac{x+a}{x+b}\) is rational, then \(a=b\). (b) Let \(x, y\) be rationals such that \(\frac{x^{2}+x+\sqrt{2}}{y^{2}+y+\sqrt{2}}\)...
Study smarter with the SolutionInn App