The examples in this article share the specific code of python to implement the student performance evaluation system for your reference. The specific content is as follows
**1、 Problem description (functional requirements): **
Complete the design of the relevant software system according to the requirements of the experimental instruction. The requirements are detailed, clear and well-organized, with illustrations (flow charts), detailed notes for the main (key code), clear test results, and analysis of existing problems:
1 ) Realize student performance information (student number, name, department, three subject scores, test average score, classmates' mutual score, class teacher score, and comprehensive evaluation scores through class knowledge. The total score of comprehensive evaluation is determined by the average score of the test. 70%, students’ mutual score 10%, teacher’s score 20%,);
2 ) Able to save and read student performance information (additional points can be added if you use the database to access the information);
3 ) Realize the input, output, search, delete, and modify functions of all relevant information;
4 ) The system interface should at least implement the console interface (additional use of the desktop window interface can add points):
2、 The solution to the problem:
According to the system function requirements, problem solving can be divided into the following steps:
(1) Analyze the relationship between related functions and information in the system;
(2) Design the data access process and access interface (console interface) according to the problem description;
(3) Complete the definition of each member function in the class;
(4) Function debugging;
(5) Complete the system summary report and system manual.
Following the python car system, I then built a student information management system than Hulu Zhaodiao:
**The specific implementation is simple: **
First, I create a global variable to store all the student information
When adding, I first add each information to a list and then add this list to the list of global variables
To delete is to traverse the list and query the corresponding student ID. If the same, call the del function to delete the entire row.
There is little difference between modification and deletion. One is del and the other is directly equal to the place to be modified.
Display is to traverse the list output
Save data is open ("file directory",'r") access without overwriting access
For the specific implementation, so many running cases will not run one by one. Practice has proved that it is possible.
import os
def printwindows():print('='*30)print('Student Information Management System V1.0')print('1.Add student information')print('2.Delete student information')print('3.Modify student information')print('4.Show all student information')print('5.save data')print('0.Exit system')print('='*30)
students =[]
def add_student():while1:
os.system("cls")
student =[]
student_name =input("Please enter student name:")
student_id =input("Please enter student ID:")
student_xingbie =input("Please enter student gender:")
student_age =input("Please enter the age of the student:")
student_pione =input("Please enter student phone number:")
student.append(student_name)
student.append(student_id)
student.append(student_xingbie)
student.append(student_age)
student.append(student_pione)
students.append(student)
n =input("Do you want to continue adding? y or n:")if n =="n":break
def del_student():while1:
del_student_id =input("Please enter the student ID to be deleted:")for student in students:if student[1]== del_student_id:
del student
print("successfully deleted!")break
n =input("Do you want to continue adding? y or n:")if n =="n":break
def updata_student():while1:
updata_student_id =input("Please enter the student ID you want to change:")for student in students:if student[1]== updata_student_id:
flag =input("Select the student information you want to change: 1.Name, 2.Student ID, 3.Gender, 4.Age, 5.phone:")if flag ==1:
name =input("Please enter the name you want to replace:")
student[0]= name
elif flag ==2:
student_id =input("Please enter the student ID you want to change:")
student[1]= student_id
elif flag ==3:
student_xinbie =input("Please enter the gender you want to change to:")
student[2]= student_xinbie
elif flag ==4:
student_age =input("Please enter the age you want to replace:")
student[3]= student_age
elif flag ==5:
student_pione =input("Please enter the phone you want to change to:")
student[4]= student_pione
else:
pass
n =input("Do you want to continue adding? y or n:")if n =="n":break
def show_student():print("student information")print("Name, student number, gender, age, phone")for student in students:print(student[0]+" "+ student[1]+" "+ student[2]+" "+ student[3]+" "+ student[4])
os.system("pause")
def read_in_file():withopen("student_data.txt",'a')as f:for student in students:
f.write(student[0]+" "+ student[1]+" "+ student[2]+" "+ student[3]+" "+ student[4]+'\n')print("Saved successfully!")
def main():while(1):
os.system("cls")printwindows()print("Please enter the code you want to execute:")
n =int(input())if n ==1:add_student()
elif n ==2:del_student()
elif n ==3:updata_student()
elif n ==4:show_student()
elif n ==5:read_in_file()else:breakif __name__ =='__main__':main()
For more learning materials, please pay attention to the topic "Management System Development".
The above is the whole content of this article, I hope it will be helpful to everyone's study.
Recommended Posts