Question
Problem 1 - What's your DS2000 Grade? (Please use python to solve the following problem) As you may know, we dont have your DS2000 grade
Problem 1 - What's your DS2000 Grade? (Please use python to solve the following problem)
As you may know, we dont have your DS2000 grade stored on Canvas,
Because Laney hates it, but you can figure it out anytime you like
And thats what well do for this homework!
The input data file has the following format:
1. Assignment Type (HW, Quiz, or Viz)
2. Grade on that assignment
Using a while loop, read in the contents of the file, and compute three things:
1. Average HW score
2. Average Quiz score
3. Overall DS2000 number grade
## A weighted average where homework is worth 75%
## Quizzes are worth 20%, and mini-viz is 5%)
Print out each of these things to the user
Rounded to 2 digits past the decimal place.
Assume that there could be any number of homeworks, any number of quizzes
But only one Viz grade. The input data file has some made-up data in it.
But we encourage you to also use your code to figure out your own current average!
Make sure to follow all the rubrics:
Gather data
Read the data file as: assignment type (string), score (float) using a while loop
Assume the file could contain any number of homeworks, and any number of quizzes. There is only one Viz grade.
Computations
Compute average HW grade
Compute average Quiz grade
Compute overall average score, based on the actual weights we use in DS2000
Communicate
Print all of the above, rounding each result to two digits past the decimal point
Readability
File name is saved in a constant above main
Unchanging weights (75%, 20%, 5%) are saved in constants above main
Filename: avg_grade.py Input files: Download ds 2000 grades.txt save it in the same directory as your avg_grade.py file. As you may know, we don't have your DS2000 grade stored on Canvas, because Laney hates it, but you can figure it out anytime you like -- and that's what we'll do for this homework! The input data file has the following format: - Assignment Type (HW, Quiz, or Viz) - Grade on that assignment Using a while loop, read in the contents of the file, and compute three things: - Average HW score - Average Quiz score - Overall DS2000 number grade (a weighted average where homework is worth 75%, quizzes are worth 20%, and mini-viz is 5% ) Print out each of these things to the user, rounded to 2 digits past the decimal place. For full documentation credit, write one test case in a comment at the top of your file using the format shown below (but with your own example.) Test case: HW grades 90,85,95,Avg=90 Quiz grades 100,90.Avg=95 Viz grade =90 Overall average =(.75)(90)+(.20)(95)+(.05)(90)=91 Assume that there could be any number of homeworks, any number of quizzes, but only one Viz grade. The input data file has some made-up data in it. But we encourage you to also use your code to figure out your own current averageStep by Step Solution
There are 3 Steps involved in it
Step: 1
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