Ask Question
14 December, 10:18

16.44 Lab 13D: Student Scores with Files and Functions Overview Create a program that reads from multiple input files and calls a user-defined function. Objectives Gain familiarity with CSV files Perform calculations with data from CSV files Create a user-defined function Read from multiple files in the same program

+2
Answers (1)
  1. 14 December, 10:48
    0
    See Explaination

    Explanation:

    # copy the function you have this is just for my convenniece

    def finalGrade (scoresList):

    weights = [0.05, 0.05, 0.40, 0.50]

    grade = 0

    for i in range (len (scoresList)):

    grade + = float (scoresList[i]) * weights[i]

    return grade

    import csv

    def main ():

    with open ('something. csv', newline='') as csvfile:

    spamreader = csv. reader (csvfile, delimiter=',', quotechar='|')

    file = open ('something. txt')

    for row in spamreader:

    student = file. readline (). strip ()

    scores = row

    print (student, finalGrade (scores))

    if __name__ = = "__main__":

    main ()
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “16.44 Lab 13D: Student Scores with Files and Functions Overview Create a program that reads from multiple input files and calls a ...” in 📙 Engineering if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers