Question

Please include screenshot of coding and program running - Python. Thanks in advance!!Task description You are given a student result data file (result.csv). It has columns ID: student id Assi ~ Ass4: assignment

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

Explanation::

  • Code in PYTHON is given below
  • Screenshot of the OUTPUT is given at the end of the code


Code in PYTHON::

import csv

ass1List=[]
ass2List=[]
ass3List=[]
ass4List=[]
examList=[]
totalList=[]
with open('data.csv') as csv_file:
    csv_reader = csv.reader(csv_file, delimiter=',')
    first = True
    index=0
    for row in csv_reader:
        if first:
            first=False
        else:
            ass1List.insert(index, row[1])
            ass2List.insert(index, row[2])
            ass3List.insert(index, row[3])
            ass4List.insert(index, row[4])
            examList.insert(index, row[5])
            totalList.insert(index, row[6])
            index=index+1



def calculateAverageMinMax(listArray):
    sum=float(listArray[0])
    minimum=float(listArray[0])
    maximum=float(listArray[0])
    for i in range(1,len(listArray)):
        val=float(listArray[i])
        sum=sum+val
        if val<minimum:
            minimum=val
        if val>maximum:
            maximum=val
    average=sum/len(listArray)
    return [average,minimum,maximum]



ass1Answer = calculateAverageMinMax(ass1List)
ass2Answer = calculateAverageMinMax(ass2List)
ass3Answer = calculateAverageMinMax(ass3List)
ass4Answer = calculateAverageMinMax(ass4List)
examAnswer = calculateAverageMinMax(examList)
totalAnswer = calculateAverageMinMax(totalList)

print("        AVERAGE   MINIMUM   MAXIMUM")
print("Ass1   ",ass1Answer[0],"   ",ass1Answer[1],"   ",ass1Answer[2])
print("Ass2   ",ass2Answer[0],"   ",ass2Answer[1],"   ",ass2Answer[2])
print("Ass3   ",ass3Answer[0],"   ",ass3Answer[1],"   ",ass3Answer[2])
print("Ass4   ",ass4Answer[0],"   ",ass4Answer[1],"   ",ass4Answer[2])
print("Exam   ",examAnswer[0],"   ",examAnswer[1],"   ",examAnswer[2])
print("Total  ",totalAnswer[0],"   ",totalAnswer[1],"   ",totalAnswer[2])

data.csv:

ID,Ass1,Ass2,Ass3,Ass4,Exam,Total
1,89.1,50,85,88.9,65,66
2,95.1,82.5,90.5,94.5,52,63
3,74.3,54.4,63,63.9,31,42
4,89.8,81.3,82,90.4,37,53
5,91.3,98.8,92.5,95.9,79,77

OUTPUT::

C: \Users\ Bhushan\PycharmProjects\Graphics venv AVERAGE MINIMUM MAXIMUM 87.92 73.4 82.6 86.72 52.8 74.3 50.0 63.0 Ass1 Ass2
Please provide the feedback!!

Thank You!!

Add a comment
Know the answer?
Add Answer to:
Task description You are given a student result data file (result.csv). It has columns ID: studen...
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
  • Task description: NOTE: - MUST BE ANSWERED IN PYTHON CODE FORMAT, USING PANDAS & DISPLAY A...

    Task description: NOTE: - MUST BE ANSWERED IN PYTHON CODE FORMAT, USING PANDAS & DISPLAY A SCREEN SHOT OF THE UPDATED OUTPUT FROM YOUR CODE. Please comment out code with description. You are given a student result data file (result_withoutTotal.csv). It has columns: ID: student id Ass1 ~ Ass4: assignment scores (out of 100); weight of ass1, ass2, ass3 and ass4 is 5%, 15%, 5%, and 15%, respectively. Exam: examination score (out of 120); weight is 60%. Total score can...

  • The subjects in the data are college students. In the data, id is student ID, anxiety...

    The subjects in the data are college students. In the data, id is student ID, anxiety is student’s anxiety score via Anxiety Scale, selfest is student’s self-esteem score via Rosenberg Self-esteem Scale, GPA is student’s GPA; for gender, 0=female, 1=male; for grade, 1=freshman, 2=junior, 3=senior. We have known that population mean for Anxiety Scale is μ=60 with σ=10. Raise relevant questions ( 2 questions is fine) about the data extensively, the questions can be either about descriptive analysis or inferential...

  • Excel File Edit View Insert Format Tools Data Window Help AutoSave Template-ACC 213 Lab 10 for...

    Excel File Edit View Insert Format Tools Data Window Help AutoSave Template-ACC 213 Lab 10 for Chapter 12 pre Home Insert Draw Page Layout Formulas Review Data View Conditional Formatting Arial A A 10 General Format as Table Paste B I U Aw +8 Cell Cell Styles f G104 A. E F 1 Lab #10-Chapter 12 Satement of Cash Flows Name 3 Instructions 1, Calouate the yearoveryear dferenoe in column D, then whether the change was an "norease" or "deoreaseee...

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