Question

In Python, Complete the extraCreditTotal() function to take a list of grades as a parameter and...

In Python, Complete the extraCreditTotal() function to take a list of grades as a parameter and return the total number points above 100.

Examples:

extraCreditTotal( [101, 83, 107, 90] ) returns 8 (because 1 + 0 + 7 + 0 is 8)

extraCreditTotal( [89, 113, 95] ) returns 13

extraCreditTotal( [89, 73, 96, 97, 99, 100] ) returns 0

0 0
Add a comment Improve this question Transcribed image text
Answer #1

PYTHON Code:

def extraCreditTotal(list):
total = 0
for i in range(len(list)):
if list[i]>100:
total += (list[i]-100)
return total

print("extraCreditTotal( [101, 83, 107, 90] ) :",extraCreditTotal( [101, 83, 107, 90] ))
print("extraCreditTotal( [89, 113, 95] ) :",extraCreditTotal( [89, 113, 95] ))
print("extraCreditTotal( [89, 73, 96, 97, 99, 100] ) :",extraCreditTotal( [89, 73, 96, 97, 99, 100] ))

def extraCredit Total (list): total = 0 for i in range (len (list)): if list[i]>100: total += (list[i]-100) return total prin

Output:

extraCreditTotal( [101, 83, 107, 90] ) : 8 extraCreditTotal( [89, 113, 95] ) : 13 extraCreditTotal( [89, 73, 96, 97, 99, 100)

Add a comment
Know the answer?
Add Answer to:
In Python, Complete the extraCreditTotal() function to take a list of grades as a parameter and...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Microsoft Excel Question. I'm having trouble using the vlookup function, I have calculated a final numerical...

    Microsoft Excel Question. I'm having trouble using the vlookup function, I have calculated a final numerical grade for a hypothetical course, and and trying to use a set of numerical grades with their corresponding letter grades to get a vlookup function to return the letter grade from the numerical grade. However the function for some reason only returns the lowest value out of the set grades, not the closest match. Projects Classwork Teamwork/Integrity 100 100 A+ 98 A+ 97 A...

  • write a program that uses a function to read in the grades for four classes and...

    write a program that uses a function to read in the grades for four classes and then uses a function to calculate the average grade in each of the classes. input the grades for one student. we will name her Beverly. output how Beverly's grade differs from each classe average. Make sure that your output is very clear. Below is your data: English 90 70 85 45 95 95 82 97 99 65 History 63 94 60 76 83 98...

  • 1.         For each set below, using Excel, construct            a.         a frequency distribution,   ...

    1.         For each set below, using Excel, construct            a.         a frequency distribution,    b.         a relative frequency distribution, and            c.         a cumulative relative frequency distribution. Consider whether or not you should group your data. Describe how you determined your bin width, if you grouped the data in intervals. Set 1 75    95    103 100 93 91 90 92 89 105 86 85 81 96 103 99 94 95 91 97 92 107...

  • FOR PYTHON: Write a function findMinRow() that takes a two-dimensional list of numbers as a parameter....

    FOR PYTHON: Write a function findMinRow() that takes a two-dimensional list of numbers as a parameter. It returns the index of the minimum row in the list. The minimum row is the row with the smallest sum of elements. If the list has multiple rows that achieve the minimum value, the last such row should be returned. If the list is empty the function should return -1. The following shows several sample runs of the function: Python 3.4.1 Shell File...

  • Please help me with this program.You are to write a C++ program that will read in...

    Please help me with this program.You are to write a C++ program that will read in up to 15 students with student information and grades. Your program will compute an average and print out certain reports. Format: The information for each student is on separate lines of input. The first data will be the student�s ID number, next line is the students name, next the students classification, and the last line are the 10 grades where the last grade is...

  • The Computer Science Instructor has just completed compiling all the grades for the C++ Programming class....

    The Computer Science Instructor has just completed compiling all the grades for the C++ Programming class. The grades were downloaded into a file titled ‘studentGrades.txt’ (attached). Write a C++ Program that reads this file and calculates the following as described : The final semester numeric and letter grade (using 10 point scale) Calculated as follows: Labs 1-6 (worth 50% of final grade) Lab 7 is extra credit (worth 2 % of final grade OR replaces lowest lab grade – Select...

  • An article of the American Journal of Clinical Pathology, by Metz et al. (A-4) published the...

    An article of the American Journal of Clinical Pathology, by Metz et al. (A-4) published the comparison of three methods to determine the percentage of dysmorphic erythrocytes in the urine. They obtained the following results when using the A (X) and B (Y) methods in 75 urine samples. Draw a scatter diagram and obtain the regression equation and graph it on the diagram. X            Y            X            Y            X            Y            X            Y 0            0            20          16          65          55          89          81 0           ...

  • The following table gives the heat index (Heat Stress Index) as a function of the air...

    The following table gives the heat index (Heat Stress Index) as a function of the air temperature (Environ- mental Temperature) and the Relative Humidity. The heat index is measured in °F, the air temperature is measured in °F, and the relative humidity is measured in %. For this problem we will use the variables I (heat index), T (air temperature), and H (relative humidity). The table presents IT, H). Table 3: Apparent temperature, Heat Stress Index (HSI* Environmental Temperature °F...

  • Complete function long_list_printer.print_list(). When it's finished, it should be able to print this list, a =...

    Complete function long_list_printer.print_list(). When it's finished, it should be able to print this list, a = [ [93, 80, 99, 72, 86, 84, 85, 41, 69, 31], [15, 37, 58, 59, 98, 40, 63, 84, 87, 15], [48, 50, 43, 68, 69, 43, 46, 83, 11, 50], [52, 49, 87, 77, 39, 21, 84, 13, 27, 82], [64, 49, 12, 42, 24, 54, 43, 69, 62, 44], [54, 90, 67, 43, 72, 17, 22, 83, 28, 68], [18, 12, 10,...

  • weight of 30 people: 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,...

    weight of 30 people: 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110 screenshot of matlab is needed, please and thank you Create your own data that represents the weight of 30 people.Test the null hypothesis that the data comes from a normal distribution with mean mu = 70 and standard deviation sigma = 8. Hint: use the “ztest"...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT