USE C LANGUAGE THIS IS THE OUTPUT USE C LANGUAGE PLEASE ------------------------
ID: 3915276 • Letter: U
Question
USE C LANGUAGE
THIS IS THE OUTPUT
USE C LANGUAGE PLEASE
-----------------------------------------------------------------
Year Month Interest Principal Balance | INTEREST PRINCIPAL
-----------------------------------------------------------------
1 1 500 610 149390 | 500 610
2 498 612 148779 | 998 1221
3 496 614 148165 | 1494 1835
4 494 616 147550 | 1988 2450
5 492 618 146932 | 2480 3068
6 490 620 146312 | 2969 3688
7 488 622 145690 | 3457 4310
8 486 624 145066 | 3943 4934
9 484 626 144440 | 4426 5560
10 481 628 143812 | 4908 6188
11 479 630 143182 | 5387 6818
12 477 632 142550 | 5864 7450
-----------------------------------------------------------------
Year Month Interest Principal Balance | INTEREST PRINCIPAL
-----------------------------------------------------------------
2 13 475 634 141916 | 6340 8084
14 473 636 141279 | 6813 8721
15 471 639 140641 | 7284 9359
16 469 641 140000 | 7752 10000
17 467 643 139357 | 8219 10643
18 465 645 138712 | 8684 11288
19 462 647 138065 | 9146 11935
20 460 649 137415 | 9606 12585
21 458 651 136764 | 10064 13236
22 456 654 136110 | 10520 13890
23 454 656 135455 | 10974 14545
24 452 658 134797 | 11425 15203
-----------------------------------------------------------------
Year Month Interest Principal Balance | INTEREST PRINCIPAL
-----------------------------------------------------------------
3 25 449 660 134136 | 11875 15864
26 447 662 133474 | 12322 16526
27 445 665 132809 | 12767 17191
28 443 667 132142 | 13209 17858
29 440 669 131473 | 13650 18527
30 438 671 130802 | 14088 19198
31 436 674 130129 | 14524 19871
32 434 676 129453 | 14958 20547
33 432 678 128775 | 15389 21225
34 429 680 128094 | 15819 21906
35 427 683 127412 | 16246 22588
36 425 685 126727 | 16670 23273
-----------------------------------------------------------------
Year Month Interest Principal Balance | INTEREST PRINCIPAL
-----------------------------------------------------------------
4 37 422 687 126040 | 17093 23960
38 420 689 125351 | 17513 24649
39 418 692 124659 | 17931 25341
40 416 694 123965 | 18346 26035
41 413 696 123269 | 18759 26731
42 411 699 122570 | 19170 27430
43 409 701 121869 | 19579 28131
44 406 703 121166 | 19985 28834
45 404 706 120460 | 20389 29540
46 402 708 119752 | 20791 30248
47 399 710 119042 | 21190 30958
48 397 713 118329 | 21586 31671
-----------------------------------------------------------------
Year Month Interest Principal Balance | INTEREST PRINCIPAL
-----------------------------------------------------------------
5 49 394 715 117614 | 21981 32386
50 392 717 116896 | 22373 33104
51 390 720 116177 | 22763 33823
52 387 722 115454 | 23150 34546
53 385 725 114730 | 23535 35270
54 382 727 114002 | 23917 35998
55 380 730 113273 | 24297 36727
56 378 732 112541 | 24675 37459
57 375 734 111807 | 25050 38193
58 373 737 111070 | 25423 38930
59 370 739 110330 | 25793 39670
60 368 742 109589 | 26161 40411
-----------------------------------------------------------------
Year Month Interest Principal Balance | INTEREST PRINCIPAL
-----------------------------------------------------------------
6 61 365 744 108844 | 26526 41156
62 363 747 108098 | 26889 41902
63 360 749 107348 | 27249 42652
64 358 752 106597 | 27607 43403
65 355 754 105843 | 27962 44157
66 353 757 105086 | 28315 44914
67 350 759 104327 | 28665 45673
68 348 762 103565 | 29013 46435
69 345 764 102801 | 29358 47199
70 343 767 102034 | 29701 47966
71 340 769 101264 | 30041 48736
72 338 772 100492 | 30379 49508
-----------------------------------------------------------------
Year Month Interest Principal Balance | INTEREST PRINCIPAL
-----------------------------------------------------------------
7 73 335 775 99718 | 30714 50282
74 332 777 98941 | 31046 51059
75 330 780 98161 | 31376 51839
76 327 782 97379 | 31703 52621
77 325 785 96594 | 32028 53406
78 322 788 95806 | 32349 54194
79 319 790 95016 | 32669 54984
80 317 793 94223 | 32986 55777
81 314 795 93428 | 33300 56572
82 311 798 92629 | 33611 57371
83 309 801 91829 | 33920 58171
84 306 803 91025 | 34226 58975
-----------------------------------------------------------------
Year Month Interest Principal Balance | INTEREST PRINCIPAL
-----------------------------------------------------------------
8 85 303 806 90219 | 34529 59781
86 301 809 89410 | 34830 60590
87 298 811 88599 | 35128 61401
88 295 814 87785 | 35423 62215
89 293 817 86968 | 35716 63032
90 290 820 86148 | 36006 63852
91 287 822 85326 | 36293 64674
92 284 825 84501 | 36578 65499
93 282 828 83673 | 36859 66327
94 279 831 82842 | 37138 67158
95 276 833 82009 | 37414 67991
96 273 836 81173 | 37688 68827
-----------------------------------------------------------------
Year Month Interest Principal Balance | INTEREST PRINCIPAL
-----------------------------------------------------------------
9 97 271 839 80334 | 37958 69666
98 268 842 79492 | 38226 70508
99 265 845 78647 | 38491 71353
100 262 847 77800 | 38753 72200
101 259 850 76950 | 39012 73050
102 256 853 76097 | 39269 73903
103 254 856 75241 | 39523 74759
104 251 859 74382 | 39773 75618
105 248 862 73520 | 40021 76480
106 245 864 72656 | 40266 77344
107 242 867 71789 | 40509 78211
108 239 870 70918 | 40748 79082
-----------------------------------------------------------------
Year Month Interest Principal Balance | INTEREST PRINCIPAL
-----------------------------------------------------------------
10 109 236 873 70045 | 40984 79955
110 233 876 69169 | 41218 80831
111 231 879 68290 | 41448 81710
112 228 882 67408 | 41676 82592
113 225 885 66524 | 41901 83476
114 222 888 65636 | 42122 84364
115 219 891 64745 | 42341 85255
116 216 894 63851 | 42557 86149
117 213 897 62955 | 42770 87045
118 210 900 62055 | 42980 87945
119 207 903 61152 | 43187 88848
120 204 906 60247 | 43390 89753
-----------------------------------------------------------------
Year Month Interest Principal Balance | INTEREST PRINCIPAL
-----------------------------------------------------------------
11 121 201 909 59338 | 43591 90662
122 198 912 58426 | 43789 91574
123 195 915 57511 | 43984 92489
124 192 918 56593 | 44175 93407
125 189 921 55673 | 44364 94327
126 186 924 54749 | 44550 95251
127 182 927 53822 | 44732 96178
128 179 930 52891 | 44912 97109
129 176 933 51958 | 45088 98042
130 173 936 51022 | 45261 98978
131 170 939 50082 | 45431 99918
132 167 943 49140 | 45598 100860
-----------------------------------------------------------------
Year Month Interest Principal Balance | INTEREST PRINCIPAL
-----------------------------------------------------------------
12 133 164 946 48194 | 45762 101806
134 161 949 47245 | 45923 102755
135 157 952 46293 | 46080 103707
136 154 955 45338 | 46234 104662
137 151 958 44380 | 46385 105620
138 148 962 43418 | 46533 106582
139 145 965 42453 | 46678 107547
140 142 968 41485 | 46820 108515
141 138 971 40514 | 46958 109486
142 135 974 39539 | 47093 110461
143 132 978 38562 | 47225 111438
144 129 981 37581 | 47353 112419
-----------------------------------------------------------------
Year Month Interest Principal Balance | INTEREST PRINCIPAL
-----------------------------------------------------------------
13 145 125 984 36596 | 47479 113404
146 122 988 35609 | 47601 114391
147 119 991 34618 | 47719 115382
148 115 994 33624 | 47835 116376
149 112 997 32626 | 47947 117374
150 109 1001 31626 | 48055 118374
151 105 1004 30622 | 48161 119378
152 102 1007 29614 | 48263 120386
153 99 1011 28603 | 48362 121397
154 95 1014 27589 | 48457 122411
155 92 1018 26572 | 48549 123428
156 89 1021 25551 | 48638 124449
-----------------------------------------------------------------
Year Month Interest Principal Balance | INTEREST PRINCIPAL
-----------------------------------------------------------------
14 157 85 1024 24526 | 48723 125474
158 82 1028 23498 | 48804 126502
159 78 1031 22467 | 48883 127533
160 75 1035 21433 | 48958 128567
161 71 1038 20395 | 49029 129605
162 68 1042 19353 | 49097 130647
163 65 1045 18308 | 49162 131692
164 61 1049 17259 | 49223 132741
165 58 1052 16207 | 49280 133793
166 54 1056 15152 | 49334 134848
167 51 1059 14093 | 49385 135907
168 47 1063 13030 | 49432 136970
-----------------------------------------------------------------
Year Month Interest Principal Balance | INTEREST PRINCIPAL
-----------------------------------------------------------------
15 169 43 1066 11964 | 49475 138036
170 40 1070 10895 | 49515 139105
171 36 1073 9821 | 49551 140179
172 33 1077 8745 | 49584 141255
173 29 1080 7664 | 49613 142336
174 26 1084 6580 | 49639 143420
175 22 1088 5493 | 49661 144507
176 18 1091 4401 | 49679 145599
177 15 1095 3307 | 49694 146693
178 11 1099 2208 | 49705 147792
179 7 1102 1106 | 49712 148894
180 4 1106 0 | 49716 150000
Explanation / Answer
#include <stdio.h>
#include <math.h>
void output_amortized(double loan_amount, double interest_rate, double term_years)
{
int y, m;
double monIntRate = (interest_rate / 12.0);
double monthInt = loan_amount * monIntRate;
double balance = loan_amount - monthInt;
loan_amount = loan_amount * monIntRate * pow((1 + monIntRate), 180) / (pow((1 + monIntRate),180) - 1);
for(y = 1; y <= term_years; y++)
{
printf(" -----------------------------------------------------------------");
printf(" Year Month Interest Principal Balance | INTEREST PRINCIPAL");
printf(" -----------------------------------------------------------------");
printf(" %4d ", y);
for(m = 1; m <= 12; m++)
{
printf("%4d %.2lf %.2lf %.2lf | %.2lf ", m, monthInt, loan_amount, balance);
}
}
}
int main()
{
output_amortized(150000.0, 33.0, 15);
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.