Question
python 3.6 Restrictions No global variables may be used Your main function may only declare variables and call other functions NEW: You may not import
python 3.6
Restrictions
No global variables may be used
Your main function may only declare variables and call other functions
NEW: You may not import the statistics or csv modules
Description
Write a prgram that asks the user for a directory containing 1 or more homework files, compute some statics on them, and then display these statistics along with scores of all of the students.
Problem Details
Your program will be given the name of a directory that contains one or more .csv files
Each of these .csv files represents one homework assignment and has the following structure
Percent Total, a number representing the percent this assignment contributes to the students overall grade
Max Points, a number representing the maximum number of points a student can get on this assignment
,,
Last Name, First Name, Grade
Student 1 Last Name, Student 1 First Name, Student 1 Grade
Student 2 Last Name, Student 2 First Name, Student 2 Grade
...
The Percent Total's across all assignments will sum to 100
The names in the homework files are stored in arbitrary order
Your program should compute and display the following course statistics for the students' percentages in the class
The mean (average)
The median (the middle number)
We will always use the number that is at the middle position. We will not average numbers if there are even number of numbers we will still take the middle.
For example if the grades were 5, 10, 12, 50 then the middle position is 4 / 2 = 2 which is 12 in this example
The mode (the most commonly occuring value)
The mode for each of the test cases will always be unique
The uncorrected sample standard deviation
(1/N * sum(x_i - x_bar) ^ 2) ^ 0.5
x_i is the value of item i
x_bar is the average of all x_i
N is the number of items
After displaying the course statistics your program should display each student's grade in the class as well as their letter gradesGrades should be displayed in alphabetical order based on last name
If multiple people have the same last name they should be sorted based on their first name
You'll find the function sorted as well as specifying the optional key value helpful for doing this
Letter grades are determined as follows
A's >= 90%
B's >= 80% and < 90%
C's >= 70% and < 80%
D's >= 60% and < 70%
F's < 60%
Inputs
Inputs will always be valid and the files will always be structured correctly
Hints
Use Functions to break the problem down.
Tackle each part of the problem one piece at a time
If a problem has subproblems don't be afraid to make functions for those as well
Example
User input has underlined to help you differentiate what is user input and what is program output. You do not need to underline anything.
Tests/Test1 only contains HW1.csv
HW1.csv contains the following:
Percent Total,100, Max Points,50, ,, Last Name,First Name,Grade Smith,John,50 Fruit,Apple,43 Dog,Lab,25 Cat,Long,36 Smith,Will,13 Veg,Carrot,50
Please enter the name of the directory containing the homeworks: Tests/Test1 Mean | Median | Mode | Standard Deviation 72.33 | 86.00 | 100.00 | 26.97 Last Name | First Name | Percent | Letter Cat | Long | 72.00 | C Dog | Lab | 50.00 | F Fruit | Apple | 86.00 | B Smith | John | 100.00 | A Smith | Will | 26.00 | F Veg | Carrot | 100.00 | A
Step 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