zyDE 2.2.2: Student grade statistics. The following program calculates some information regarding final and midterm scores. Try enhancing the program by calculating the average midterm and final scores. #Program to calculate statistics from student test scores. midterm_scores = [99.5, 78.25, 76, 58.5, 100, 87.5, 91, 68, 100] final_scores = [55, 62, 100, 98.75, 80, 76.5, 85.25] #Combine the scores into a single list all_scores = midterm_scores + final_scores num_midterm_scores = len(midterm_scores) num_final_scores = len(final_scores) print(num_midterm_scores, 'students took the midterm.') print(num_final_scores, 'students took the final.') #Calculate the number of students that took the midterm but not the final dropped_students = num_midterm_scores - num_final_scores print(dropped_students, 'students must have dropped the class.') lowest_final = min(final_scores) highest_final = max(final_scores)
Added by Kathryn S.
Close
Step 1
To calculate the average midterm score, we need to sum up all the midterm scores and divide it by the number of midterm scores. Show more…
Show all steps
Your feedback will help us improve your experience
Supreeta N and 92 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
A large university administers entrance exams to all entering students. The test is administered again as an exit exam for all graduates. The test results for one group of students are given below. Freshman Year Mean = 53 sd = 7 Senior Year Mean = 92 sd = 4 The scores for three students on both tests are listed below. For each student calculate Z scores and determine whether the student performed better as a freshman or as a senior. Student A Freshman score - 57 Senior score - 97 Student B Freshman score - 51 Senior score - 94 Student C Freshman score - 45 Senior score - 82 Determine the probabilities that randomly selected students will have scores in each of these ranges As a freshman Less than 52 Between 40 and 50 More than 62 As a senior Less than 98 Between 80 and 100 More than 85
Donna D.
Write a grading program for a class with the following grading policies: 1. There are two quizzes, each graded on the basis of 10 points. 2. There is one midterm exam and one final exam, each graded on the basis of 100 points. 3. The final exam counts for 50% of the grade, the midterm counts for 25%, and the two quizzes together count for a total of 25%. (Do not forget to normalize the quiz scores. They should be converted to a percent before they are averaged in.) Any grade of 90 or more is an A, any grade of 80 or more (but less than 90) is a B, any grade of 70 or more (but less than 80) is a C, any grade of 60 or more (but less than 70) is a D, and any grade below 60 is an F. The program will read in the student's score (two quizzes and two exams) and output the student's record, which consists of two quiz and two exam scores, as well as the student's average numeric score for the entire course and the final letter grade.
Vaidik S.
6.17 LAB: Course Grade Write a program that reads the student information from a tab separated values (tsv) file. The program then creates a text file that records the course grades of the students. Each row of the tsv file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student. A sample of the student information is provided in StudentInfo.tsv. Assume the number of students is at least 1 and at most 20. The program performs the following tasks: * Read the file name of the tsv file from the user. * Open the tsv file and read the student information. * Compute the average exam score of each student. * Assign a letter grade to each student based on the average exam score in the following scale: * A: 90 =< x * B: 80 =< x < 90 * C: 70 =< x < 80 * D: 60 =< x < 70 * F: x < 60 * Compute the average of each exam. * Output the last names, first names, exam scores, and letter grades of the students into a text file named report.txt. Output one student per row and separate the values with a tab character. * Output the average of each exam, with two digits after the decimal point, at the end of report.txt. Hint: Use the precision sub-specifier to format the output. Ex: If the input of the program is: StudentInfo.tsv and the contents of StudentInfo.tsv are: Barrett Edan 70 45 59 Bradshaw Reagan 96 97 88 Charlton Caius 73 94 80 Mayo Tyrese 88 61 36 Stern Brenda 90 86 45 the file report.txt should contain: Barrett Edan 70 45 59 F Bradshaw Reagan 96 97 88 A Charlton Caius 73 94 80 B Mayo Tyrese 88 61 36 D Stern Brenda 90 86 45 C Averages: Midterm1 83.40, Midterm2 76.60, Final 61.60
Akash M.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD