Question: # universityTester.py import random from university import Instructor # Global constants RAISE 2 = 2 RAISE 5 = 5 RAISE 8 = 8 RAISE 1
# universityTester.py
import random
from university import Instructor
# Global constants
RAISE
RAISE
RAISE
RAISE
ADJPROF 'Adjunct Professor'
ASSISPROF 'Assistant Professor'
ASSOCPROF 'Associate Professor'
FULLPROF 'Full Professor'
ADJSAL
ASSISSAL
ASSOCSAL
FULLSAL
def main:
# Strings declaration
fName 'Smith'
fName 'Doe'
fName 'YourLastName'
# Function definitions
def getRandom:
Generate a random integer number between and inclusive.
Returns:
int: Random integer between and
return random.randint
def startingSalarynum:
Get starting salary based on the given number.
Parameters:
num int: A number to determine starting salary.
Returns:
float: Starting salary based on the given number.
if num :
return ADJSAL
elif num :
return ASSISSAL
elif num :
return ASSOCSAL
elif num :
return FULLSAL
else:
return
def classificationnum:
Get classification based on the given number.
Parameters:
num int: A number to determine classification.
Returns:
str: Classification based on the given number.
if num :
return ADJPROF
elif num :
return ASSISPROF
elif num :
return ASSOCPROF
elif num :
return FULLPROF
else:
return 'Unknown Professor'
def raiseSalarynum:
Get raise percentage based on the given number.
Parameters:
num int: A number to determine raise percentage.
Returns:
int: Raise percentage based on the given number.
if num :
return RAISE
elif num :
return RAISE
elif num :
return RAISE
elif num :
return RAISE
else:
return
def printByAccessorobj:
Print rank, name, and salary of the given professor object.
Parameters:
obj Instructor: The Instructor object to print details of
printobj
def goodBye:
Print last two lines to end the program."""
print
This program was written by Dr YourLastName."
printEnd of program.
# Step : Instantiate Instructor objects
num getRandom
num getRandom
classify classificationnum
classify classificationnum
salary startingSalarynum
salary startingSalarynum
person Instructorclassify fName salary
person Instructorclassify fName salary
person InstructorclassificationgetRandom fName startingSalarygetRandom
# Step : Print details of Instructor objects
printByAccessorperson
printByAccessorperson
printperson
# Step : Raise salary for person
num getRandom
increase raiseSalarynum
printf
Full Professor fName will get an increase in salary by: increase
salary persongetSalary
newsalary salary increase
personsetSalarynewsalary
printByAccessorperson
# Step : Possibly change rank for person
print
Adjunct Professor Doe may or may not get a new title."
classify classificationgetRandom
personsetRankclassify
printperson
# Step : Create and print dictionaries
profRank Num: persongetRank 'Num: persongetRank 'Num: persongetRank
print
profRank:", profRank
profName Num: fName 'Num: fName 'Num: fName
printprofName: profName
profSalary Num: persongetSalary 'Num: persongetSalary 'Num: persongetSalary
printprofSalary: profSalary
# Step : Calculate and print total and average salaries
totalsalary profSalaryNum profSalaryNum profSalaryNum
print
Total salary for professors: $ totalsalary
averagesalary totalsalary
printAverage salary for professors: $ averagesalary
# Step : Print final lines
goodBye
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
