Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi, can you help me complete this problem in Python? University Database A unive

ID: 647983 • Letter: H

Question

Hi, can you help me complete this problem in Python?

University Database


A university database has to keep track of various kinds of people. In particular:

- A Person has a name and a phone number
- An Employee is a Person who also has a salary
- A Student is a Person who also has a gpa
- A Staff is an Employee who also has a job title
- A Professor is an Employee who also has a course assigned to them

Here's a short main body of a program that creates a list of different kinds of people, and then prints out some information about each person, as well as some summary statistics about the people in the university:

----


# Create a list of people
People = [ Student("Sandy", "326-8324", 3.65), Student("Jordan", "632-7434", 3.1),
           Professor("Leslie", "985-2363", 50000.00, "Info 501"),
           Staff("Alex", "743-4638", 25000.00, "Editor") ]

# display information about our people
print "These are the people in the university:"
for person in People:
   print person

# display the total salaries of all our employees and average GPA
# of all of our students
print
print "Our total university payroll budget is: " + str(Employee.total_salary)
print "Our average student GPA is: " + str(Student.mean_gpa())


----

As you can see, the main body assumes that there are classes called Person, Employee, Student, Professor, and Staff. Your task is to write the code for these classes, so that the main body code above displays the following output:

----


>>>
These are the people in the university:
Person Sandy has phone 326-8324
   and is a Student with gpa 3.65
Person Jordan has phone 632-7434
   and is a Student with gpa 3.1
Person Leslie has phone 985-2363
   and is an Employee with salary 50000.0
   and is a Professor assigned to class Info 501
Person Alex has phone 743-4638
   and is an Employee with salary 25000.0
   and is Staff with title Editor

Our total university payroll budget is: 75000.0
Our average student GPA is: 3.375

----

You can write whatever code you want inside the classes, but **you're not allowed to modify the main body**.
Make sure your code works even if we modify the People list to include more people.

Explanation / Answer

class people(object):
def_init_(self,name,ID):
                       self.name=name
                       self.ID=ID

class Student(people):
def_init_(self,name,ID,gpa):
                       self.name=name
                       self.ID=ID
                       self.gpa=gpa
   Student.gpa.total.append(self.gpa)
def mean_gpa():
return sum(Student.gpa_total)/float (len(Student.gpa_total))
def info_gpa(self):
mean= self.mean_gpa()
           return mean
def_str_(self):return self.info_gpa()

class Employee(people):
def_init_(self,name,ID,salary):
people._init_(self,name,ID)
   self.name=name
   self.ID=ID
   self.salary=salary
   self.employee=employee
   Employee.emp_total.append(self.employee)
def total_salary():return sum(Employee.emp_total)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote