-
Notifications
You must be signed in to change notification settings - Fork 0
/
lab1file.py
93 lines (56 loc) · 1.79 KB
/
lab1file.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import math
I = 7
R = 1.2
D = int(input("Enter the amount of Days that the infection has occured: "))
pop = 39740
x = 0
tui = 0
II = I
sum = 0
sum2 = I
sum3=0
for i in range(D):
sum = I * R
sum2 = sum2 + sum
I = sum
if (i == 14):
tui = 9972 * math.trunc(sum2)
x=1
sum3=sum2
sum2 = math.trunc(sum2)
sum3 = math.trunc(sum3)
if x == 1:
print ("Total Infected {}".format( sum2))
print ("Total Infected at drop period (14 days) {}".format(sum3))
print ("Tution {}".format(tui))
print ("Precent infected {}".format(math.trunc((sum2/pop) * 100)))
else:
print ("Total Infected {}".format( sum2))
print ("Tution {}".format( sum2 * 9972))
print ("Precent infected {}".format(math.trunc((sum2/pop) * 100)))
S = int(input("Press 1 to continue or any other number to stop again"))
while(S == 1):
sum = 0
sum2 = II
I = II
D = int(input("Enter the amount of Days that the infection has occured: "))
for i in range(D):
sum = I * R
sum2 = sum2 + sum
I = sum
if (i == 14):
tui = 9972 * math.trunc(sum2)
x=1
sum3=sum2
sum2 = math.trunc(sum2)
sum3 = math.trunc(sum3)
if x == 1:
print ("Total Infected {}".format( sum2))
print ("Total Infected at drop period (14 days) {}".format(sum3))
print ("Tution {}".format(tui))
print ("Precent infected {}".format(math.trunc((sum2/pop) * 100)))
else:
print ("Total Infected {}".format( sum2))
print ("Tution {}".format( sum2 * 9972))
print ("Precent infected {}".format(math.trunc((sum2/pop) * 100)))
S = int(input("Press 1 to continue or any other number to stop again"))