Question

You are to write a program that will process students and their grades. For each student...

You are to write a program that will process students and their grades. For each student the program will read in a student’s name. It should also read in 10 test scores for the student and calculate his or her average. You must read the scores using a loop. The program should output the student’s name, average and letter grade. The average should be displayed accurate to 1 decimal digit.

Letter grades are assigned based on the scale:

90-100    A

80-89      B

70-79      C

60-69      D

below 60 F

You do not know how many students there are but there will be a sentinel for the student names. The sentinel is “done”.

I will run the program on the following data:

Mary Jones   

90 90 78 89 90 55 66 90 90 90

Sam Iam         

60 66 67 70 45 55 46 65 23 44

Mary Poppins

90 90 90 90 90 90 99 99 99 90

James Brown

80 88 78 89 85 84 82 82 83 83

done

So, make sure this data works on your end too.

Homework Answers

Answer #1

Here is the code:

while(True):
    name = input('Please enter name: ')
    if(name == 'done'):
        break
    else:
        marks = list()
        for loop1 in range(10):
            marks.append(int(input('Please enter marks of ' + str(loop1+1) + ' subject: ')))
        avg_marks = sum(marks) / len(marks)

        # finding grade
        if(avg_marks >= 90):
            grade = 'A'
        elif(avg_marks >= 80 and avg_marks < 90):
            grade = 'B'
        elif(avg_marks >= 70 and avg_marks < 80):
            grade = 'C'
        elif(avg_marks >= 60 and avg_marks < 70):
            grade = 'D'
        else:
            grade = 'F'

        print("\nStudent's name: ", name)
        print('Average: ',avg_marks)
        print('Grade: ',grade)

Here is the results:

For any doubts, please comment below.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Using the accompanying Student Grades​ data, construct a scatter chart for midterm versus final exam grades...
Using the accompanying Student Grades​ data, construct a scatter chart for midterm versus final exam grades and add a linear trendline. What is the​ model? If a student scores 7878 on the​ midterm, what would you predict her grade on the final exam to​ be? Student Midterm Final Exam 1 75 64 2 85 91 3 80 68 4 88 83 5 76 60 6 67 80 7 78 74 8 95 94 9 67 61 10 93 87 11...
Student Grades Student Test Grade 1 76 62 2 84 90 3 79 68 4 88...
Student Grades Student Test Grade 1 76 62 2 84 90 3 79 68 4 88 84 5 76 58 6 66 79 7 75 73 8 94 93 9 66 65 10 92 86 11 80 53 12 87 83 13 86 49 14 63 72 15 92 87 16 75 89 17 69 81 18 92 94 19 79 78 20 60 71 21 68 84 22 71 74 23 61 74 24 68 54 25 76 97...
The following scores represent a sample of final examination grades for a statistics course 23 60...
The following scores represent a sample of final examination grades for a statistics course 23 60 98 32 57 74 52 70 82 69 74 63 80 62 80 77 81 95 41 65 92 85 85 61 36 79 55 76 52 10 64 75 78 25 80 48 83 64 88 82 81 67 41 71 67 54 34 72 74 43 60 78 84 89 76 84 17 90 15 79 a) Compute the 20th percentile of...
have a java application need to create an application which is able to do some analysis...
have a java application need to create an application which is able to do some analysis on temperature data stored in a data file. You will be given the “temperatures.dat” data file which contains the data you must analyze. The analysis you’ll need to do is: Total number of data points Find coldest temperature Find warmest temperature Find average temperature Find the frequency of each temperature Find the most frequent temperature Find the least frequent temperature All classes must be...
The data file ExxamScores shows the 40 students in a TOM 3010 course exxam scores for...
The data file ExxamScores shows the 40 students in a TOM 3010 course exxam scores for the Middtermm and Final exxam. Is there statistically significant evidence to show that students score lower on their final exxam than middtermm exxam? Provide the p-value for this analysis.ROUND TO 4 DECIMAL PLACES. ExxamScores Student ID # Middtermmm Final 56065 97 64 79499 95 85 59716 89 72 83504 79 64 77735 78 74 57760 87 93 78204 83 70 81177 94 79 54398...
Below represent scores on an exam, each entry one score for one student 40 99 59...
Below represent scores on an exam, each entry one score for one student 40 99 59 98 63 63 64 65 67 35 67 67 68 70 71 71 71 46 72 72 60 73 74 74 74 75 97 75 62 76 76 76 76 76 77 57 77 98 77 63 78 78 78 79 79 80 80 80 80 80 81 81 92 81 93 82 82 83 83 83 83 83 83 83 84 84 84...
Consider the following list contained in file named input.txt: use (-999) to stop reading grades Khaled...
Consider the following list contained in file named input.txt: use (-999) to stop reading grades Khaled 65 78 56 89 -999 Kamal 37 55 44 22 18 56 26 -999 Ali 66 33 87 66 87 25 39 78 -999 Taher 12 67 -999 Write a program to read this information and Output the name and sum for each person. Note: the number of rows may vary.
Write a function that will read a collection of examination scores ranging in value from 1...
Write a function that will read a collection of examination scores ranging in value from 1 to 100. Your subprogram should count and print the number of scores in the outstanding category ( 90 – 100), the number of scores in the satisfactory category ( 60-89), and the number of scores in the unsatisfactory category ( 1-59). The test data for the subprogram is : 63           75           72 72           78           67 80           63           75 90           89           43 59           99           82...
The Test Scores for a Statistics course are given in the Excel below. The data (X1,...
The Test Scores for a Statistics course are given in the Excel below. The data (X1, X2, X3, X4) are for each student. X1 = score on exam #1 X2 = score on exam #2 X3 = score on exam #3 X4 = score on final exam Your professor wants to know if all tests are created equal. What is the F-Stat? EXAM1 EXAM2 EXAM3 FINAL 73 80 75 65.86667 93 88 93 80.16667 89 91 90 78 96 98...
The following scores represent a sample of final examination grades for a statistics course 23 60...
The following scores represent a sample of final examination grades for a statistics course 23 60 98 32 57 74 52 70 82 69 74 63 80 62 80 77 81 95 41 65 92 85 85 61 36 79 55 76 52 10 64 75 78 25 80 48 83 64 88 82 81 67 41 71 67 54 34 72 74 43 60 78 84 89 76 84 17 90 15 79 a) Provide a frequency polygon with...