Ask Python Expert

Purpose of this assignment: The purpose of this assignment is to understand function and file.

Problem Statement: Write a program that reads the name of a data file which contains student ids (such as c1234500) and their scores. The program will find and print the average score, the number of students processed, the student ID with the highest score, and the processed output as shown in the sample output.

Sample Input files:

Sample output 1

Sample output 2

score3.txt

c1234500   91.5

Enter the file name: score3.txt

Enter the file name: score.txt

c1234501   83

 

score.txt does not exist.

c1234502   96

There are 8 record in the file

 

c1234503   63.5

The average of the scores is 85.5

Enter the file name: score.dat

c1234504   82

 

score.dat does not exist.

c1234506   78

Student ID score Grade standing

 

c1234507   95

c1234500    91.5    A   above

Enter the file name: score4.txt

c1234510   95

c1234501    83.0    B   below

 

 

c1234502    96.0    A   above

There are 3 student records.

score4.txt

c1234503    63.5    D   below

The average score is 90.2

C5432101  95

c1234504    82.0    B   below

 

c5432102   83.5

c1234506    78.0    C   below

Student ID score Grade standing

c5432103   92

c1234507    95.0    A   above

C5432101    95.0   A   above

 

c1234510    95.0    A   above

c5432102     83.5   B   below

 

 

c5432103     92.0   A   above

 

c1234502 have the highest score of 96

 

 

 

C5432101 have the highest score of 95

REQUIREMENTS:-

 

1) Print the purpose of the program.

2) Your program must read an input file name interactively.

3) If file does not exist. print error message and keep asking the user to enter another file name.

4) Your program should read and count student records from the file until the end of file.

5) Your program will find and print the average score, the number of students processed

6) Your program will find and print the student ID with the highest score

7) The processed output is displayed in the table format as shown in the sample output. The program output should show ID, score, standing. and the letter grade (A for >90, B for >80, C for >70, D for >60. otherwise F).

8) Program Structure: Your program must define and call the following functions. You may define other functions.

• find standing(scores, avg) # find and return the list that stores the standing of each student as either above or below.
• print tables(id list, scores list. stand list): given 3 lists print the table as shown above.
• letter_grade(score) # find and return the letter grade for the score
• open_file() # returns the successfully opened file object

10) Your program must have a beginning comment block and proper documentation as in ola 1.

Python, Programming

  • Category:- Python
  • Reference No.:- M91761089
  • Price:- $55

Priced at Now at $55, Verified Solution

Have any Question?


Related Questions in Python

Part i the assignment filesone of the most important

Part I: The Assignment Files One of the most important outcomes of this assignment is that you understand the importance of testing. This assignment will follow an iterative development cycle. That means you will write a ...

Homework -this homework will have both a short written and

Homework - This homework will have, both a short written and coding assignment. The problems that are supposed to be written are clearly marked. 1) (Written) Make heuristics Describe two heuristics for the slide problem ...

Tasksdemonstrate data scraping of a social network of

Tasks Demonstrate data scraping of a social network of choice. Develop technical documentation, including the development of the code & detailing the results. Provide a report on the findings, that includes research into ...

Assignment1 utilising python 3 build the following

Assignment 1. Utilising Python 3 Build the following regression models: - Decision Tree - Gradient Boosted Tree - Linear regression 2. Select a dataset (other than the example dataset given in section 3) and apply the De ...

Python programming assignment -you first need an abstract

Python Programming Assignment - You first need an abstract base class, called, Account which has the following attributes and methods: accountID: This attribute holds the ID assigned the account , if not provided set to ...

Learning outcomes lo3 - research develop and document a

Learning Outcomes LO3 - Research, develop, and document a basic security policy, and analyse, record, and resolve all security incidents LO4 - Identify and assess the threats to, and vulnerabilities of networks Assessmen ...

Question research pythons dictionary data type dictdiscuss

Question : Research Python's dictionary data type (dict). Discuss its interface and usage. Include examples. Discuss practical applications of dictionaries.

Questionwhat is a python development frameworkgive 3

Question What is a python development framework? Give 3 examples python development framework used today. and explain which development framework is used in which industry.

Below zero - ice cream storethe local ice-cream store needs

Below Zero - ice cream store The local ice-cream store needs a new ordering system to improve customer service by streamlining the ordering process. The manager of the store has found that many orders are incorrect and s ...

The second task in this assignment is to create a python

The second task in this assignment is to create a Python program called pancakes.py that will determine the final order of a stack of pancakes after a series of flips.(PYTHON 3) Problem Task In this problem, your input w ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As