Language: Python 1. The sample input will have to be in Text File (.TXT) 2. By using the first function, this program reads score and name values from a file. The program then determines the grade for each students by using the second function. Finally, the program displays the name, score, and grade information on the console. The two functions are shown in the images attached below:

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Language: Python

1. The sample input will have to be in Text File (.TXT)

2. By using the first function, this program reads score and name values from a file. The program then determines the grade for each students by using the second function. Finally, the program displays the name, score, and grade information on the console. The two functions are shown in the images attached below: 

(A) https://www.freec X
wex Eligible Expenses X
Logout
I Form Shooting Pr X
Answered: Langu X
Bb Upload Assignme X
Bb CS170 Lab File, F X
Bb Syllabus 2021
blackboard.truman.edu/bbcswebdav/pid-1156029-dt-content-rid-14602527_1/courses/2021404103/CS170%20Lab%20File%20Function%20Grade.pdf
A
Paused
CS170 Lab File, Function, Grade
1 / 2
100%
+ |
Lab: Functions, Files, and Grades
This assignment should demonstrate the use of functions. By using the first function, this
program reads score and name values from a file. The program then determines the grade for
each students by using the second function. Finally, the program displays the name, score,
grade information on the console. The two functions are shown below:
and
1. def readFileValues(fileName):
# uses the fileName to prepare a file variable and open the file in read mode
# reads a line from the file and split the line into tokens in order to get score values
# stores the values in a scoreList variable
# reads the next line from the file and split the line into tokens to get name values
# stores the values in a nameList variable
# returns both of the two lists to the calling function
2. def calculateGrade(score):
# this function uses the score value to calculate the grade as the following:
# if the score is between 90 and 100 then the grade is A
# if the score is between 80 and 90 then the grade is B
# if the score is between 70 and 80 then the grade is C
# if the score is between 60 and 70 then the grade is D
# if the score is between 50 and 60 then the grade is E
# else the grade is F
# returns the calculated grade to the calling function
The main function uses the readFileValues to read the score values and name values in the
scoreList variable and nameList variable respectively. It then loops through the scoreList values
to calculate the letter grade of the students. Lastly, it displays the name, score, and the
calculated grade for each of the students. The sample input and output of the program are
shown below:
Sample Input
98.5
88
92.5
78.5
68.5
69
85
Sue
Joe
Ann
Deb
Bob
Esa
Cole
...
II
Transcribed Image Text:(A) https://www.freec X wex Eligible Expenses X Logout I Form Shooting Pr X Answered: Langu X Bb Upload Assignme X Bb CS170 Lab File, F X Bb Syllabus 2021 blackboard.truman.edu/bbcswebdav/pid-1156029-dt-content-rid-14602527_1/courses/2021404103/CS170%20Lab%20File%20Function%20Grade.pdf A Paused CS170 Lab File, Function, Grade 1 / 2 100% + | Lab: Functions, Files, and Grades This assignment should demonstrate the use of functions. By using the first function, this program reads score and name values from a file. The program then determines the grade for each students by using the second function. Finally, the program displays the name, score, grade information on the console. The two functions are shown below: and 1. def readFileValues(fileName): # uses the fileName to prepare a file variable and open the file in read mode # reads a line from the file and split the line into tokens in order to get score values # stores the values in a scoreList variable # reads the next line from the file and split the line into tokens to get name values # stores the values in a nameList variable # returns both of the two lists to the calling function 2. def calculateGrade(score): # this function uses the score value to calculate the grade as the following: # if the score is between 90 and 100 then the grade is A # if the score is between 80 and 90 then the grade is B # if the score is between 70 and 80 then the grade is C # if the score is between 60 and 70 then the grade is D # if the score is between 50 and 60 then the grade is E # else the grade is F # returns the calculated grade to the calling function The main function uses the readFileValues to read the score values and name values in the scoreList variable and nameList variable respectively. It then loops through the scoreList values to calculate the letter grade of the students. Lastly, it displays the name, score, and the calculated grade for each of the students. The sample input and output of the program are shown below: Sample Input 98.5 88 92.5 78.5 68.5 69 85 Sue Joe Ann Deb Bob Esa Cole ... II
(A) https://www.freec X
wex Eligible Expenses X
Logout
I Form Shooting Pr X
Answered: Langu X
Bb Upload Assignme X
Bb CS170 Lab File, F X
Bb Syllabus 2021
blackboard.truman.edu/bbcswebdav/pid-1156029-dt-content-rid-14602527_1/courses/2021404103/CS170%20Lab%20File%20Function%20Grade.pdf
A
Paused
CS170 Lab File, Function, Grade
2 / 2
100%
+ |
Sample Input
98.5
88
92.5
78.5
68.5
69
85
Sue
Joe
Ann
Deb
Bob
Esa
Cole
Sample Output
Sue
98.5
A
Joe
88
В
Ann
92.5
A
Deb
78.5
C
Bob
68.5
Esa
69
Cole
85
В
The lab description comes with a skeleton program (a program that highlights the algorithm
and provides some code) that you can use to complete the assignment.
The deliverables for this assignment are the program file and a screenshot demonstrating one
sample run of the program.
When you are satisfied with your program, you can submit the deliverables on the blackboard
course website by Monday, July 26. Please let me know if you have any questions. Thanks.
...
II
Transcribed Image Text:(A) https://www.freec X wex Eligible Expenses X Logout I Form Shooting Pr X Answered: Langu X Bb Upload Assignme X Bb CS170 Lab File, F X Bb Syllabus 2021 blackboard.truman.edu/bbcswebdav/pid-1156029-dt-content-rid-14602527_1/courses/2021404103/CS170%20Lab%20File%20Function%20Grade.pdf A Paused CS170 Lab File, Function, Grade 2 / 2 100% + | Sample Input 98.5 88 92.5 78.5 68.5 69 85 Sue Joe Ann Deb Bob Esa Cole Sample Output Sue 98.5 A Joe 88 В Ann 92.5 A Deb 78.5 C Bob 68.5 Esa 69 Cole 85 В The lab description comes with a skeleton program (a program that highlights the algorithm and provides some code) that you can use to complete the assignment. The deliverables for this assignment are the program file and a screenshot demonstrating one sample run of the program. When you are satisfied with your program, you can submit the deliverables on the blackboard course website by Monday, July 26. Please let me know if you have any questions. Thanks. ... II
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education