bs comp sci expert, my code is still wrong whenever i test it. i need help (please see photo)
bs comp sci expert, my code is still wrong whenever i test it. i need help (please see photo)
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
bs comp sci expert, my code is still wrong whenever i test it. i need help (please see photo)

Transcribed Image Text:Create a function that calculates the college general weighted average (GWA) for three school subjects. The inputs
will be the grades for each of the subjects. The first subject has 5 units, the second has 3 units, and the third has 1 unit.
Assume that there will always be college numerical grades inputted for the first two subjects. The third subject should
be an input with a default value of 1.00.
Input Format
The inputs will be 2 comma separated numbers.
Constraints
Assume that only valid numeric grades will be given.
Output Format
Print the computed GWA using the specified format. Remember to round to two decimal places using round (, 2).
Sample:
Input:
1.0, 1.0
Output:
The student's GWA is 1.0
Python > e main.py > ...
1
#function to return GWA
def GWA_calc(g1, g2, g3=1.0):
3
#finding the total grade
Testcase 0 x
total_grade = (g1*5)+(g2*3)+(g3*1)
#returning the average
4
Your code did not pass this test case.
return total_grade/9
Input (stdin)
7
1.0,1.0
#user input
in1, in2 =
8.
Your Output (stdout)
9
input().split(",")
The student's GWA is 1.0
10
in1, in2 = float(in1), float(in2)
Expected Output
11
#calling the function
The student's GWA is 1.e.
avg = GWA_calc(in1, in2)
#printing the result
print("The student's GWA is", round(avg, 2))
12
Compiler Message
13
Wrong Answer
14
PROBLEMS
OUTPUT
DEBUG CONSOLE
TERMINAL
PS C:\My files\Python> python main.py
1.0,1.0
The student's GWA is 1.0
PS C:\My files\Python>
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 2 images

Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education