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 6-digit numeric field starting with 100001.
Tests 1,2,3 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 ->=90(A),>=80 but <90(B),>=70 but <80(C),>=60 but <70(D),<60(F).
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 10 student records in your file. The more records the better.
Student id:
First name:
Last name:
Test 1:
Test 2:
Test 3:
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, e.g., 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 (studentGrade.txt) and display all the records in the file on the terminal.
e. Provide a functionality to search the file (studentGrade.txt) 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 (studentGradeReport.txt) 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 line-up nicely.
h. Break your application into functions (modules) each function having a unique responsibility. Use stubs. Preform positive and negative tests
import datetime
def findGrade(test_avrg):
grade =''
if test_avrg >=90:
grade ='A'
elif 80<= test_avrg <90:
grade ='B'
elif 70<= test_avrg <80:
grade ='C'
elif 60<= test_avrg <70:
grade ='D'
elif test_avrg <60:
grade ='F'
return grade
# program will start from main function
if __name__=='__main__':
student_data_dict = dict()
now = datetime.datetime.now()
current_date_time = now.strftime("%m/%d/%Y %H:%M:%S")
college = "Chattahoochee Technical College"
term = "Fall 2019"
instructor ="Dr. Jerry Mamo"
isMoreDataToEnter = True
while isMoreDataToEnter:
student_temp_dict = dict()
studentId = int(input("Enter the student Id : "))
if studentId <100001:
print("Please enter valid student Id. Try again! ")
continue
first_name = input("Enter first name : ")
last_name = input("Enter last name : ")
test_1= int(input("Enter Test 1 number : "))
test_2= int(input("Enter Test 2 number : "))
test_3= int(input("Enter Test 3 number : "))
test_average =(test_1+ test_2+ test_3)/3
test_average = round(test_average, 2)
grade = findGrade(test_average)
student_temp_dict["First Name"]= first_name
student_temp_dict["Last Name"]= last_name
student_temp_dict["Test 1"]= test_1
student_temp_dict["Test 2"]= test_2
student_temp_dict["Test 3"]= test_3
student_temp_dict["Test Average"]= test_average
student_temp_dict["Grade"]= grade
student_data_dict[studentId]= student_temp_dict
flag = input("Do you want enter more record Y or N ")
if flag.lower()=='n':
isMoreDataToEnter = False
with open("student_data.txt","w") as out:
out.write("College: "+ college +"")
out.write("Term: "+ term +"")
out.write("Instructor: "+ instructor +"")
out.write("Date: "+ str(current_date_time)+"")
for studentid, idDict in student_data_dict.items():
out.write("Student Id: "+ str(studentid)+"")
for key, value in idDict.items():
out.write(key +": "+ str(value)+"")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!