1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Alja [10]
3 years ago
8

g You need to create a program that will read the scores from the CSV file, pass the scores as a list to the finalGrade function

, and display the resulting final grade, along with the student's name. The input files are attached and the function finalGrade is given. You can assume that the same number of lines will be in the input files. Display the name and final grade for all students in the following format: Bill Gates earned 81.5% Mark Zuckerberg earned 99.6% ...

Computers and Technology
1 answer:
Goshia [24]3 years ago
6 0

Answer:

def finalGrade(scoresList):

""" Function that finds the final grade """

hw1_weighted = float(scoresList[0])/10 * 0.05

hw2_weighted = float(scoresList[1])/10 * 0.05

mid_weighted = float(scoresList[2])/100 * 0.40

fin_weighted = float(scoresList[3])/100 * 0.50

final_grade = (hw1_weighted + hw2_weighted + mid_weighted + fin_weighted) * 100

return final_grade

if __name__ == '__main__':

''' Reading and processing scores '''

# Reading names from text file

names = []

# Opening text file

with open("d:\\Python\\names.txt", "r") as fp:

# Reading data

for line in fp:

# Stripping new line

line = line.strip()

# Adding to list

names.append(line)

# Reading scores

finalGrades = []

# Reading scores

with open("d:\\Python\\scores.csv", "r") as fp:

# Reading data

for line in fp:

# Stripping new line

line = line.strip()

# Scores list

scores = []

# Iterating over scores

for score in line.split(','):

# Adding to list

scores.append(score)

# Finding grade

grade = finalGrade(scores)

# Adding to list

finalGrades.append(grade)

# Printing result

for i in range(len(names)):

print("\n%s earned %.1f%%"%(names[i], finalGrades[i]))

Explanation:

This program was implemented with python programming language.

This program will read the scores from the CSV file, pass the scores as a list to the finalGrade function, and display the resulting final grade, along with the student's name.

See attachment for screenshots

You might be interested in
___ is the branch of computer science that explores techniques for incorporating aspects of intelligence into computer systems.
mamaluj [8]
Artificial Intelligence
5 0
3 years ago
What is the biggest difference between a movie and a game?
sveta [45]

Answer:

It could be D

Explanation:

3 0
3 years ago
What are the functions of language in logic?​
kifflom [539]

Answer:

Three basic functions of language: Informative, Expressive, and Directive Language

  • Informative language. Simply put, informative language can be looked at as though it is either right or wrong, or true or false
  • Expressive language
  • Directive language

7 0
3 years ago
(ANSWER!)
andreev551 [17]

Answer:

it doesn't? maybe it helps by resetting it but other than that I don't think It does anything

4 0
3 years ago
Read 2 more answers
What is the similarities between traditional and modernized presentation​
Ivenika [448]

Answer:

“Traditional” refers to those societies or elements of societies that are small-scale, are derived from indigenous and often ancient cultural practices. “Modern” refers to those practices that relate to the industrial mode of production or the development of large-scale often colonial societies.

6 0
2 years ago
Other questions:
  • If Maya wants to access a view that would control multiple slides within a presentation, which view should she utilize? Master v
    9·1 answer
  • MinMax is a function that takes five arguments and returns no value. The first three arguments are of type int. The last two arg
    14·1 answer
  • What is related to Gamut in Adobe illustrator?
    8·1 answer
  • Examine the efficiency the various recovery algorithms used in deadlock handling
    10·1 answer
  • What is a database in access
    7·1 answer
  • Two or more computers connected together is referred to as a(n)
    14·1 answer
  • Counting calculus students. About A university offers 3 calculus classes: Math 2A, 2B and 2C. In both parts, you are given data
    6·1 answer
  • Which of the following is the best way to locate books and research from all over the United States and abroad?
    9·2 answers
  • someone please tell me if you watch drag race (rupauls drag race) I need someone to talk to about it ​
    12·1 answer
  • How do I make my own algorithms ​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!