1. Define a function extract_grade(x): • x: A string containing a student number and grade in the format "studentNum-Grade%" • Return: The student's grade as a float. (Hint: Use the .split() and .strip() methods) 1. Define a function class_average(final_marks): final_marks: A list of strings, where each string is formatted as "studentNum-Grade%". • Return: The mean grade of the grades in final_marks calculated using equation (1) outlined below. (Hint: Use your extract_grade function and a for loop!) N-1 1 N i=0 2. Define a function class_std_dev(final_marks): • final_marks: A list of strings, where each string is formatted as "studentNum-Grade%". • Return: The standard deviation of the grades in final_marks calculated using equation (2) outlined below. (Hint: Use your class_average function and a for loop!) N-1 1 E(xi - O = N i=0

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
icon
Related questions
Question
1. Define a function extract_grade(x):
• x: A string containing a student number and grade in the format "studentNum-Grade%"
• Return: The student's grade as a float.
(Hint: Use the .split() and .strip() methods)
1. Define a function class_average(final_marks):
final_marks: A list of strings, where each string is formatted as "studentNum-Grade%".
• Return: The mean grade of the grades in final_marks calculated using equation (1) outlined below.
(Hint: Use your extract_grade function and a for loop!)
N-1
1
x =
N
i=0
2. Define a function class_std_dev(final_marks):
final_marks: A list of strings, where each string is formatted as "studentNum-Grade%".
Return: The standard deviation of the grades in final_marks calculated using equation (2) outlined below.
(Hint: Use your class_average function and a for loop!)
N-1
1
O =
i=0
Transcribed Image Text:1. Define a function extract_grade(x): • x: A string containing a student number and grade in the format "studentNum-Grade%" • Return: The student's grade as a float. (Hint: Use the .split() and .strip() methods) 1. Define a function class_average(final_marks): final_marks: A list of strings, where each string is formatted as "studentNum-Grade%". • Return: The mean grade of the grades in final_marks calculated using equation (1) outlined below. (Hint: Use your extract_grade function and a for loop!) N-1 1 x = N i=0 2. Define a function class_std_dev(final_marks): final_marks: A list of strings, where each string is formatted as "studentNum-Grade%". Return: The standard deviation of the grades in final_marks calculated using equation (2) outlined below. (Hint: Use your class_average function and a for loop!) N-1 1 O = i=0
Generating statistics from a set of data is a task that computers love. In this assignment, you will be implementing a grade processing system that will
generate the mean and standard deviation for a set of final exam grades.
We will assume that final grades are stored in a list, where each entry in the list is a string with the following format:
"studentNum-finalGrade%"
The string represents the final exam mark (finalGrade) that the student (studentNum) achieved. For example, the cell below contains a list of final exam marks
from two students. Student 1007089 achieved a mark of 91%, and student 1009989 achieved a mark of 77.5%.
grades = ['1007089-91%','1009989-77.5%' ]
We want to calculate the mean final exam mark from a list of grades. If we assume that we have N grades, the mean x can be calculated from the following
formula:
N-1
1
(1)
i=0
The variable x; represents each grade in our list at index i. We assume that we start counting at 0.
We also want to be able to calculate the standard deviation from a list of grades. The standard deviation measures the amount of variability in our data set. For
example, let's say we want to compute the average and standard deviation for the grades [80, 90, 70, 60]. The average of these grades is 75, and the
standard deviation is 11.2. Now imagine we want to compute the average and standard deviation for the grades [80, 76 ,74, 70]. The average of these grades
is 75, but the standard deviation is 3.6. Although both sets of grades have the same average, the second set has a smaller standard deviation. The reason is
because the grades are not as "spread out" as the grades in the first set. The grades in the second set deviate from their average by a small amount.
The standard deviation o is calculated using our mean x and the following formula:
N-1
1
>(x; -
(2)
O =
i=0
Transcribed Image Text:Generating statistics from a set of data is a task that computers love. In this assignment, you will be implementing a grade processing system that will generate the mean and standard deviation for a set of final exam grades. We will assume that final grades are stored in a list, where each entry in the list is a string with the following format: "studentNum-finalGrade%" The string represents the final exam mark (finalGrade) that the student (studentNum) achieved. For example, the cell below contains a list of final exam marks from two students. Student 1007089 achieved a mark of 91%, and student 1009989 achieved a mark of 77.5%. grades = ['1007089-91%','1009989-77.5%' ] We want to calculate the mean final exam mark from a list of grades. If we assume that we have N grades, the mean x can be calculated from the following formula: N-1 1 (1) i=0 The variable x; represents each grade in our list at index i. We assume that we start counting at 0. We also want to be able to calculate the standard deviation from a list of grades. The standard deviation measures the amount of variability in our data set. For example, let's say we want to compute the average and standard deviation for the grades [80, 90, 70, 60]. The average of these grades is 75, and the standard deviation is 11.2. Now imagine we want to compute the average and standard deviation for the grades [80, 76 ,74, 70]. The average of these grades is 75, but the standard deviation is 3.6. Although both sets of grades have the same average, the second set has a smaller standard deviation. The reason is because the grades are not as "spread out" as the grades in the first set. The grades in the second set deviate from their average by a small amount. The standard deviation o is calculated using our mean x and the following formula: N-1 1 >(x; - (2) O = i=0
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education