Question: Create a student grade entry, display, and calculation application. The application creates two files providing the services detailed below. a . Create variables in your
Create a student grade entry, display, and calculation application. The application creates two files providing the services detailed below.
a Create variables in your program to store the following header information which you will use to format and print a header in the report.
College: Chattahoochee Technical College
Term:
Instructor:
Date: Todays date obtained from the system
b Prompt the user to enter the following grade information until the user indicates all student data is entered. After each record is entered, ask the user if there are more records to enter.
Student id is a digit numeric field starting with
Tests are numeric fields.
Test average is a numeric field, and it is the average of the three tests taken.
Grade is a char field determined based on test average A but B but C but DF
Make sure there are calculated grades which fall in each letter grade category. That means you should have data to assign a letter grade of A B C D and F
You should have at least student records in your file. The more records the better.
Student id:
First name:
Last name:
Test :
Test :
Test :
Test average:
Grade:
c Add validation logic for each input field. Put the code in a try catch block. Research the exception each input field can potentially throw, eg value error. None of the fields should be spaces. Numeric fields should accept only numeric data.
d Once all the data is entered the program should save it in a file studentGradetxt and display all the records in the file on the terminal.
e Provide a functionality to search the file studentGradetxt by student id or first and last name and either display only the record retrieved or display a message that no record matching the criteria is found if that is the case. The decision the program makes must be correct. For example, it should not display no record found while there is a record matching the search criteria. If more than one record matching the criteria is found, for example if two students have the same first name and the search is performed by first name, both records must be displayed.
f Create a new output file studentGradeReporttxt containing only the student id first name, last name and the letter grade calculated and saved in the file. The rest of the data in the input file should not be included.
g Use appropriate column headings when displaying the student data. Make sure the column headings lineup nicely.
h Break your application into functions modules each function having a unique responsibility. Use stubs. Preform positive and negative tests
import datetime
def findGradetestavrg:
grade
if testavrg :
grade A
elif testavrg :
grade B
elif testavrg :
grade C
elif testavrg :
grade D
elif testavrg :
grade F
return grade
# program will start from main function
if namemain:
studentdatadict dict
now datetime.datetime.now
currentdatetime now.strftimemdY H:M:S
college "Chattahoochee Technical College"
term "Fall
instructor Dr Jerry Mamo"
isMoreDataToEnter True
while isMoreDataToEnter:
studenttempdict dict
studentId intinputEnter the student Id :
if studentId :
printPlease enter valid student Id Try again!
continue
firstname inputEnter first name :
lastname inputEnter last name :
test intinputEnter Test number :
test intinputEnter Test number :
test intinputEnter Test number :
testaverage test test test
testaverage roundtestaverage,
grade findGradetestaverage
studenttempdictFirst Name" firstname
studenttempdictLast Name" lastname
studenttempdictTest test
studenttempdictTest test
studenttempdictTest test
studenttempdictTest Average" testaverage
studenttempdictGrade grade
studentdatadictstudentId studenttempdict
flag inputDo you want enter more record Y or N
if flag.lowern:
isMoreDataToEnter False
with openstudentdata.txtw as out:
out.writeCollege: college
out.writeTerm: term
out.writeInstructor: instructor
out.writeDate: strcurrentdatetime
for studentid, idDict in studentdatadict.items:
out.writeStudent Id: strstudentid
for key, value in idDict.items:
out.writekey : strvalue
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
