Write a program that reads the name of a data file

Assignment Help Python Programming
Reference no: EM131036621

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

<purpose of the program here>

<purpose of the program here>

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.

Reference no: EM131036621

Questions Cloud

Managerial function of controlling : Traditionally theorist suggest that the managerial function of controlling should not be confused with control in the behavioral or manipulative sense. This function does not imply that managers should attempt to control or to manipulate the perso..
What has been the importance and significance of processes : What has been the importance and significance of these processes and their cyclic interaction to the evolution and diversity of life?
Difference between express consent-informed consent : What are the basic components of each type of written consent form? Discuss and explain the various types of advance directives. What is the difference between express consent, informed consent, and implied consent? Briefly explain how you establish ..
Is healthcare a basic human right or an earned privilege : Is healthcare a basic human right or an earned privilege? We also discussed the issue of universal healthcare and rationing. During our discussions we spoke of the connection between these issues. Please discuss your point of view regarding these iss..
Write a program that reads the name of a data file : 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.
Project paper assignment : This is a chance to perhaps incorporate some of your experience, interests, and career business/management goals and ambitions within the context of an individual project paper.
Write clearly and directly but be as precise as you can : Write clearly and directly, but be as precise as you can. The paper following this one will focus on a particular law or policy, so the greater precision that you develop at this stage, the easier it will be to recognize and talk about that law or..
A cafeteria has a coffee urn to service customers : A cafeteria has a coffee urn to service customers. Arrivals follow a Poisson distribution at a rate of 3 per minute. Customers take 15 seconds to get coffee, exponentially distributed. Suppose the urn is replaced by a machine that has a constant serv..
What price to ask for her well-kept house : What did it cost her? She says it costs $20,000 forty years ago. With these givens, advise her on her asking price.

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd