-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathManagement System
91 lines (68 loc) · 2.39 KB
/
Management System
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
print("""Data collection and management system,
developed by yalzeee""")
#This program is built to manage data for a higher institution
#Start by importing functions we will need for this program
import datetime
import re
#This command imports all functioms from the datetime library
#In this institutiom lets assume we have Students, Lecturers and Workers stored in this database
class Student:
def __init__(self,name,gender, age, major):
self.name = name
self.gender = gender
if gender == "Male" or "male":
self.gen = "He"
elif gender == "Female" or "female":
self.gen = "She"
else:
self.gen = "It"
self.age = age
time = datetime.datetime.now()
self.tor = str(time)
self.major = major
self.tuition = 50000
tuit = str(self.tuition)
self.student_data = open(self.name, "w+")
data = [self.gender, self.age, self.tor, self.major, tuit]
for dat in data:
self.student_data.write(dat)
self.student_data.close()
def student_summary(self):
print("%s is a %s student,%s entered this institution at %s years old and was logged onto our systems at %s. %s is here for a %s major" % (self.name, self.gender, self.gen, self.age, self.tor, self.gen, self.major))
def update_tuition(self,paid):
if paid == int(-paid):
self.tuition -= paid
if paid == int(+paid):
self.tuition += paid
x = open(self.name,"a")
x.write(str(self.tuition))
x.close()
return self.tuition
class Lecturer:
def __init__(self,name,gender,department):
self.name = name
self.gender = gender
self.department = department
self.salary = 40000
self.staff_data = open(self.name, "w+")
data = [self.gender, self.department]
for dat in data:
self.student_data.write(dat)
self.student_data.close()
def compiled_salary(self):
allowance = float(input("What is the compiled allowance"))
salary = self.salary + allowance
return salary
def staff_upgrade(self,level):
if level == 1:
self.salary = 50000
elif level == 2:
self.salary == 60000
elif level == 3:
self.salary == 80000
else:
print("Invalid Input")
amy = Student("Amy White", "Female","18", "Medicine and Surgery")
yalz = Student("Oyale Peter", "Male", "19", "Linguistics")
print(yalz.update_tuition(5000))
tunde = Lecturer("Tunde Bajare","Male","Math and Statistics")