Professional Documents
Culture Documents
Martinez
BSIT
Problem # 1
sum = 0
max = float()
min = float()
for n in range(20):
sum += val
max = val
min = val
ave = sum / 20
print("Sum:", sum)
print("Average:", ave)
print("Maximum:", max)
print("Minimum:", min)
Problem # 2
students = []
teachers = []
def calculate_sfees(student):
if student['status'] == 'regular':
return 20000
return 30000
return 40000
else:
return 0
while True:
if choice == 1:
#Ask user to input name, age and status
student['fees'] = calculate_fees(student)
students.append(student)
print("Student added.")
elif choice == 2:
teachers.append(teacher)
elif choice == 3:
print("\nStudent Records")
print(f"Status: {student['status']}")
print(f"Fees: P{student['sfees']}")
#Displaying the teacher records
elif choice == 4:
print("\nTeacher Records")
# invalid choice
else: