-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheDxExercise.py
More file actions
49 lines (44 loc) · 1.84 KB
/
Copy patheDxExercise.py
File metadata and controls
49 lines (44 loc) · 1.84 KB
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
my_current_average = 87.1
survey_completers = 50
class_size = 100
# You may modify the lines of code above, but don't move them!
# When you Submit your code, we'll change these lines to
# assign different values to the variables.
# Unlike David Joyner (who believes such bonuses are unethical),
# Prof. Shmavid Shmoyner offers a bonus to students' final
# average based on the percentage of students that complete the
# end-of-course survey.
#
# Prof. Shmoyner's formula is simple: every person that does
# the end-of-course survey adds one point to the "pool" of
# points. These points are then divided evenly among all
# students in the class.
#
# For example, if 50 students do the end-of-course survey,
# then 50 points are divided among the class. If there were
# 100 students in the class, then each student gets 0.5 bonus
# points. If there were 50 students in the class, then every
# student would get 1 bonus point.
#
# The variables above describe a particular class. Your
# average is given by my_current_average. survey_completers
# shows how many students completed the survey. class_size
# holds how many students are in the class.
#
# Write some code that will print the following message with
# the appropriate values:
#
# After the 0.5 point bonus, my average is 87.6.
#
# You should round the bonus to the nearest tenth of a point.
# To do this, you can use Python's built-in round() function.
# To use it, use the following syntax:
# rounded_num = round(original_num, 1)
my_current_average = 87.1
survey_completers = 50
class_size = 100
pool_points = survey_completers / class_size
pool_points = round(pool_points, 1)
my_new_average = my_current_average + pool_points
my_new_average = round(my_new_average, 1)
print('After the ' + str(pool_points) + ' point bonus, my average is ' + str(my_new_average) + '.')