Functions The signature of each function is provided below, do not make any changes to the otherwise the tester will not

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Functions The signature of each function is provided below, do not make any changes to the otherwise the tester will not

Post by answerhappygod »

Functions The Signature Of Each Function Is Provided Below Do Not Make Any Changes To The Otherwise The Tester Will Not 1
Functions The Signature Of Each Function Is Provided Below Do Not Make Any Changes To The Otherwise The Tester Will Not 1 (84.17 KiB) Viewed 18 times
Functions The Signature Of Each Function Is Provided Below Do Not Make Any Changes To The Otherwise The Tester Will Not 2
Functions The Signature Of Each Function Is Provided Below Do Not Make Any Changes To The Otherwise The Tester Will Not 2 (44.94 KiB) Viewed 18 times
In python
Functions The signature of each function is provided below, do not make any changes to the otherwise the tester will not work properly. The following are the functions you must implement: def read_grades_file(filename, project=False): Given a filename, open and read the given file and parse it into a dictionary in the grades format. The text file format should have one line for each value. The order is: • Name • Programming Assignments • Labs zyBooks • Midterm1 • Midterm2 Final . . Each line will contain a list of values separated by spaces. The first value on each line will be a string indicating the assignment type of the values that follow. The value for the name will be a string, and leading and trailing spaces should be ignored (you may find the string method strip to be useful for this). The value for the mid1",mid", and "final" assignment types will always be a single floating point value. All the other assignment types will have one or more floating point values. If the parameter project is False (default), then these grade values should be stored in the returned dictionary as-is. On the other hand, if project is True then you should check for missing grade values. If project is True and there are fewer than 9 programming assignments, 11 labs, or 15 zyBooks, you will need to project values for all of the missing grades (you do not need to consider the case where there are more grades). To do this for a given assignment type, compute the average grade for that assignment type, and then add copies of that average to the end of the given grade values so that that assignment type has the correct number of grades. For example, it the file had the following line "pa, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0", then there are only 7 programming assignment grade values. If project were True, you would compute the average of the given grades ((1.0+2.0+3.0-4.0+5.0*6.0+7.02/7 = 4.0), and add that to the end of the list of grade values, so that the dictionary's value for the key "pa" would be the list 11.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 4.0. 4.03 Examples: The "mason.grades" file included with the tester should look like this: name, George Mason par 100.0 100.0 95.0 95.0, 97.0 1 ab, 100.0, 100.0, 100.0, 0.0, 100.0 zy. 100.0, 1000, 100.0 100.0 100.0 midi, 90.0 mid2, 80.0 Final, 85.0
When this file is parsed with project=False, the returned dictionary should look like this {"name: George Mason', pa (100.0, 100.0, 95.0, 95.0, 97.0), lab": [100.0, 100.0, 1000, 0, 0, 100.0). zy: [100.0, 100.0, 100.0, 100.0, 100.0], midl. 90.0, mid2': 80.0, final': 85.0) The same file when parsed with project-True, the returned dictionary should look like this {'name': George Mason, pa'. [100.0, 100.0, 95.0, 95.0, 97.0, 97.4, 97.4, 97.4, 97.4), lab': [100.0, 100.0, 100.0, 0.0, 100.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.01) zy': [100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100 10, 100.0, 100.0, 100.0], 'midi': 90.0, "mid2: 80.0, "final': 85.0)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply