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 loop that counts the number of space

Write a loop that counts the number of space characters in a string. Recall that the space character is represented a

  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.

  Design an application in python

Design an application in Python- The application would generate a set of 100 integers in a random manner in the range of 50 to 150 including both the numbers in the range

  Write an expression that concatenates the string

Write an expression that concatenates the String variable suffix onto the end of the String variable prefix .

  How do you call the main function in python

How do you call the main function? in Python

  Write a python program that reads the contents of the data

Design an algorithm and use it to write a Python program that reads the contents of the data file into a list. The program should then loop, to allow a user to check various numbers against those stored in the list.

  The managing director of aussie best car abc has invited

the managing director of aussie best car abc has invited you to build a new computer system for them in python. the abc

  The program should use a boolean= valued function

Write a program that accepts a word as input and determines wehther or not it has three consecutive letters in the alphabet. The program should use a Boolean= valued function named isTripleConsecutive that accepts an entire word as input.

  Asign true to the variable has_dups

Asign True to the variable has_dups if the string s1 has any duplicate character (that is if any character appears more than once) and False otherwise

  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.

  Write a program that accepts as input a sentence

Write a program that accepts as input a sentence in which all of the words are run together but the first character of each word is uppercase. Convert the sentence to a string in which the words are separated by space and only the first word start..

  Compare programming with python and programming with scratch

Compare programming with python and programming with scratch. Describe the same program you might create in both programming languages.

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