cs125_sample_midterm
cs125_sample_midterm
Your program should add the names of all employees who have been with the company for mor than 10 years to
a list. The program should output the list of names of employees who have worked for the company for more
than 10 years as well as the average number of years they have been employed. Display an appropriate
message (see sample run below) if no employees have worked for the company for over 10 years.
Sample Run 1:
Enter email address: [email protected]
Sample Run 2:
1
2. (30 points) A spa offers the services listed below. Write a python script, yourname_q2.py, that inputs the
service requested by a customer and calculates and displays the customer’s bill. For massages and facials only,
if the customer is a VIP customer, they will receive a 15% discount on their bill. Note: the service type can be
entered in any case (upper/lower) and the program should accept either input. Assume one of the following
options will be entered:
Manicure (mc) 90
Sample Run 1:
Enter service (m/f/p/mc): m
Sample Run 2:
Enter service (m/f/p/mc): f
Are you a vip customer (y/n): n
Your bill is: $ 175
Sample Run 3:
Enter service (m/f/p/mc): mc
Your bill is: $ 90
Sample Run 4:
Enter service (m/f/p/mc): h
Invalid choice
2
2) (40 points) Write a python script, yourname_q3.py, that calculates a semester GPA. The GPA is calculated by
multiplying the grade points by the credits for each course and summing them. Dividing the sum by the total
credits will give the GPA. For example, if a student takes ENG101, a 3-credit course and gets an A (4 points) and
TURK101, a 2 credit course, and gets a B (3 points), GPA is calculated as follows: (3 * 4 + 3 * 2) / (3 + 2)
b. Prompt the user to input the number of courses they would like to enter.
c. For each course, input the course code and grade points.
d. Find the sum of the credits multiplied by the grade points for the input courses that appear in the dictionary.
e. Display the result.
Sample Run 1:
Enter number of courses: 3
Sample Run 2:
Enter number of courses: 2