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.
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.
|