# Number 1 Part A
# P is the Principal Amount
# i = interest factor
# j = compound interest factor
# n is an index
# k is also an index but used for plotting
# a is used in the for loop to print out the table of values
P = 2000; i = 1.0010; j = 0; n = 1; k=1; a = 0;
m = vector(RDF,100) # This is used to store the bank account values based on index
m[0] = P;
while P<=10000:
P = (P*i) + 100; j=.0001; i = i+j;
m[n] = P;
Q = [n,m[n]];
if P>=9999:
if P<=10001:
print "Number of months until bank account reaches $10000 is:"; print "%26s"%(n);
l=n; # l is used to store the value where the bank account reaches 10,000
print "Account value at 63 months is:"; print "%20s"%(m[n]);
n=n+1;
Q = [[k, m[k]] for k in range(l+1)]
pplot= scatter_plot(Q);
pplot.show()
print "Index Amount"
for a in range (0,64):
print "%2s "%(a),; print "%16s"%(m[a])
|
|
Number of months until bank account reaches $10000 is:
63
Account value at 63 months is:
10000.3687295
Index Amount
0 2000.0
1 2102.0
2 2204.3122
3 2306.95737464
4 2409.95641923
5 2513.33035821
6 2617.10035375
7 2721.28771432
8 2825.91390343
9 2931.00054846
10 3036.5694495
11 3142.6425884
12 3249.24213783
13 3356.39047054
14 3464.11016862
15 3572.42403302
16 3681.35509311
17 3790.92661635
18 3901.16211821
19 4012.08537214
20 4123.72041972
21 4236.09158098
22 4349.22346488
23 4463.14097997
24 4577.86934521
25 4693.43410098
26 4809.86112033
27 4927.17662037
28 5045.40717386
29 5164.57972112
30 5284.72158203
31 5405.86046836
32 5528.02449628
33 5651.24219917
34 5775.54254062
35 5900.9549278
36 6027.50922498
37 6155.23576741
38 6284.16537552
39 6414.32936932
40 6545.75958323
41 6678.48838115
42 6812.54867189
43 6947.97392498
44 7084.79818679
45 7223.056097
46 7362.78290553
47 7504.0144898
48 7646.78737239
49 7791.13873915
50 7937.10645771
51 8084.72909646
52 8234.04594395
53 8385.0970288
54 8537.92314008
55 8692.56584818
56 8849.06752619
57 9007.47137186
58 9167.82143006
59 9330.16261578
60 9494.54073783
61 9661.00252299
62 9829.59564091
63 10000.3687295
Number of months until bank account reaches $10000 is:
63
Account value at 63 months is:
10000.3687295
Index Amount
0 2000.0
1 2102.0
2 2204.3122
3 2306.95737464
4 2409.95641923
5 2513.33035821
6 2617.10035375
7 2721.28771432
8 2825.91390343
9 2931.00054846
10 3036.5694495
11 3142.6425884
12 3249.24213783
13 3356.39047054
14 3464.11016862
15 3572.42403302
16 3681.35509311
17 3790.92661635
18 3901.16211821
19 4012.08537214
20 4123.72041972
21 4236.09158098
22 4349.22346488
23 4463.14097997
24 4577.86934521
25 4693.43410098
26 4809.86112033
27 4927.17662037
28 5045.40717386
29 5164.57972112
30 5284.72158203
31 5405.86046836
32 5528.02449628
33 5651.24219917
34 5775.54254062
35 5900.9549278
36 6027.50922498
37 6155.23576741
38 6284.16537552
39 6414.32936932
40 6545.75958323
41 6678.48838115
42 6812.54867189
43 6947.97392498
44 7084.79818679
45 7223.056097
46 7362.78290553
47 7504.0144898
48 7646.78737239
49 7791.13873915
50 7937.10645771
51 8084.72909646
52 8234.04594395
53 8385.0970288
54 8537.92314008
55 8692.56584818
56 8849.06752619
57 9007.47137186
58 9167.82143006
59 9330.16261578
60 9494.54073783
61 9661.00252299
62 9829.59564091
63 10000.3687295
|