-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhass4.py
More file actions
34 lines (32 loc) · 1.21 KB
/
Copy pathhass4.py
File metadata and controls
34 lines (32 loc) · 1.21 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
""" I won the grant for being the most awesome. This is how my reward is calculated.
My earnings start at $1 and can be doubled or tripled every month.
Doubling the amount can be applied every month and tripling the amount can be applied every other month.
Write a program to maximize payments given the number of months by user. """
#Introducing the program
Welcome = "Congratulations!"
Welcome2 = "If you are using this program, that means you won the You-Are-Awesome award!"
print (100*"*")
print(format(Welcome,'^100s'))
print(format(Welcome2,'^100s'))
print (100*"*")
print("\n")
print("I am sure you are dying to know how much you won, let's compute!")
print("\n")
#Calculating and printing out the results.
amount = 1
months = int(input("For how many months did they say you will receive payments? "))
print("\n")
print("Here are the monthly installment amounts:")
print("\n")
for strategy in range(1,months+1,1):
if strategy == 1:
payment = "$"+str(amount)
print("Month ",strategy, ":", payment.rjust(50))
elif strategy %2 == 0:
amount *= 2
payment = "$"+str(amount)
print("Month ",strategy, ":", payment.rjust(50))
else:
amount *= 3
payment = "$"+str(amount)
print("Month ",strategy, ":", payment.rjust(50))