-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDri_Torres_Project_4_Part_1.py
59 lines (51 loc) · 1.57 KB
/
Dri_Torres_Project_4_Part_1.py
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
50
51
52
53
54
55
56
57
58
#/**********************************************************************/
#/* CSC 280 – Programming Project 4 Part 1 */
#/* */
#/* modifier: Dri Torres */
#/* */
#/* filename: Dri_Torres_Project_4_Part_1.py */
#/* modified from: CSC 280 Prog Progect #4 */
#/* date last modified: 10-06-2013 */
#/* */
#/* action: computes the total and average scores of a total specified */
#/* scores */
#/* */
#/* input: value of each score given as real numbers */
#/* */
#/* output: the total and average of all scores */
#/* */
#/**********************************************************************/
print "Enter the scores: "
a = int(raw_input("Score 1: "))
b = int(raw_input("Score 2: "))
numofscores = 2
totalscore = a + b
while b > a:
a = b
b = int(raw_input("Score " +str(numofscores + 1)+ ": "))
numofscores = numofscores + 1
totalscore = totalscore + b
totalscore = totalscore - b
print "Total: " +str(totalscore)+ " "
numofscores = numofscores - 1
print "Average: " +str(totalscore / numofscores)+ " "
#gc-123-182:CS 280 Home$ python Dri_Torres_Project_4_Part_1.py
#Enter the scores:
#Score 1: 80
#Score 2: 89
#Score 3: 90
#Score 4: 98
#Score 5: 100
#Score 6: 100
#Total: 457
#Average: 91
#mgc-123-182:CS 280 Home$ python Dri_Torres_Project_4_Part_1.py
#Enter the scores:
#Score 1: 30
#Score 2: 32
#Score 3: 45
#Score 4: 47
#Score 5: 74
#Score 6: -1
#Total: 228
#Average: 45