4. Task 3: Using a nested loop Write a program that takes a bank account balance and an interest rate as an input. And then outputs the value of the account in 5 years. The output should show the value of the account for two different methods of compounding interest: annually and monthly. When compounded annually, the interest is added once per year at the end of the year. When compounded monthly the interest is added in 12 times per year. On annual interest, you can assume that the interest is posted exactly one year from the date of deposit. In other words, you do not have to worry about interest being posted on a specific day of the year, like December 31. Similarly, you can assume monthly interest is posted exactly one month after. Since the account earns interest on the interest, the account should have a higher balance when interest is posted more frequently. Be sure to adjust the interest rate for the time period of the interest. If the rate is 5%, then when posting monthly interest, you use (5/12%). Do your calculations using a loop that adds in the interest for each time period. (Do not use some sort of algebraic formula). Your program should have an outer loop that allows the user to repeat this calculation for a new balance and interest rate. NOTE: Your source code must display any of the given sample output below. It means your source code should be flexible enough to meet any of the given sample output. Your source code output must be identical to any of the given sample output. It means you have to strictly follow what are the displayed text, labels, casing of characters in the sample output. OUTPUT 1 Bank Account Balance: 100 Interest Rate: 5 Mode Menu [1] Annually [2] Monthly Option: 1 Annually Interest Bank Account Balance in Year 1: 105.00 Bank Account Balance in Year 2: 110.25 Bank Account Balance in Year 3: 115.76 Bank Account Balance in Year 4: 121.55 Bank Account Balance in Year 5: 127.63 OUTPUT 2 Bank Account Balance: 100 Interest Rate: 5 Mode Menu [1] Annually [2] Monthly Option: 2 Monthly Interest Year 1 Bank Account Balance in Month 1: 100.42 Bank Account Balance in Month 2: 100.84 Bank Account Balance in Month 3: 101.26 Bank Account Balance in Month 4: 101.68 Bank Account Balance in Month 5: 102.10 Bank Account Balance in Month 6: 102.53 Bank Account Balance in Month 7: 102.95 Bank Account Balance in Month 8: 103.38 Bank Account Balance in Month 9: 103.81 Bank Account Balance in Month 10: 104.25 Bank Account Balance in Month 11: 104.68 Bank Account Balance in Month 12: 105.12 Year 2 Bank Account Balance in Month 1: 105.55 Bank Account Balance in Month 2: 105.99 Bank Account Balance in Month 3: 106.44 Bank Account Balance in Month 4: 106.88 Bank Account Balance in Month 5: 107.32 Bank Account Balance in Month 6: 107.77 Bank Account Balance in Month 7: 108.22 Bank Account Balance in Month 8: 108.67 Bank Account Balance in Month 9: 109.12 Bank Account Balance in Month 10: 109.58 Bank Account Balance in Month 11: 110.04 Bank Account Balance in Month 12: 110.49 Year 3 Bank Account Balance in Month 1: 110.95 Bank Account Balance in Month 2: 111.42 Bank Account Balance in Month 3: 111.88 Bank Account Balance in Month 4: 112.35 Bank Account Balance in Month 5: 112.82 Bank Account Balance in Month 6: 113.29 Bank Account Balance in Month 7: 113.76 Bank Account Balance in Month 8: 114.23 Bank Account Balance in Month 9: 114.71 Bank Account Balance in Month 10: 115.19 Bank Account Balance in Month 11: 115.67 Bank Account Balance in Month 12: 116.15 Year 4 Bank Account Balance in Month 1: 116.63 Bank Account Balance in Month 2: 117.12 Bank Account Balance in Month 3: 117.61 Bank Account Balance in Month 4: 118.10 Bank Account Balance in Month 5: 118.59 Bank Account Balance in Month 6: 119.08 Bank Account Balance in Month 7: 119.58 Bank Account Balance in Month 8: 120.08 Bank Account Balance in Month 9: 120.58 Bank Account Balance in Month 10: 121.08 Bank Account Balance in Month 11: 121.58 Bank Account Balance in Month 12: 122.09 Year 5 Bank Account Balance in Month 1: 122.60 Bank Account Balance in Month 2: 123.11 Bank Account Balance in Month 3: 123.62 Bank Account Balance in Month 4: 124.14 Bank Account Balance in Month 5: 124.65 Bank Account Balance in Month 6: 125.17 Bank Account Balance in Month 7: 125.70 Bank Account Balance in Month 8: 126.22 Bank Account Balance in Month 9: 126.74 Bank Account Balance in Month 10: 127.27 Bank Account Balance in Month 11: 127.80 Bank Account Balance in Month 12: 128.34
4. Task 3: Using a nested loop Write a program that takes a bank account balance and an interest rate as an input. And then outputs the value of the account in 5 years. The output should show the value of the account for two different methods of compounding interest: annually and monthly. When compounded annually, the interest is added once per year at the end of the year. When compounded monthly the interest is added in 12 times per year. On annual interest, you can assume that the interest is posted exactly one year from the date of deposit. In other words, you do not have to worry about interest being posted on a specific day of the year, like December 31. Similarly, you can assume monthly interest is posted exactly one month after. Since the account earns interest on the interest, the account should have a higher balance when interest is posted more frequently. Be sure to adjust the interest rate for the time period of the interest. If the rate is 5%, then when posting monthly interest, you use (5/12%). Do your calculations using a loop that adds in the interest for each time period. (Do not use some sort of algebraic formula). Your program should have an outer loop that allows the user to repeat this calculation for a new balance and interest rate. NOTE: Your source code must display any of the given sample output below. It means your source code should be flexible enough to meet any of the given sample output. Your source code output must be identical to any of the given sample output. It means you have to strictly follow what are the displayed text, labels, casing of characters in the sample output. OUTPUT 1 Bank Account Balance: 100 Interest Rate: 5 Mode Menu [1] Annually [2] Monthly Option: 1 Annually Interest Bank Account Balance in Year 1: 105.00 Bank Account Balance in Year 2: 110.25 Bank Account Balance in Year 3: 115.76 Bank Account Balance in Year 4: 121.55 Bank Account Balance in Year 5: 127.63 OUTPUT 2 Bank Account Balance: 100 Interest Rate: 5 Mode Menu [1] Annually [2] Monthly Option: 2 Monthly Interest Year 1 Bank Account Balance in Month 1: 100.42 Bank Account Balance in Month 2: 100.84 Bank Account Balance in Month 3: 101.26 Bank Account Balance in Month 4: 101.68 Bank Account Balance in Month 5: 102.10 Bank Account Balance in Month 6: 102.53 Bank Account Balance in Month 7: 102.95 Bank Account Balance in Month 8: 103.38 Bank Account Balance in Month 9: 103.81 Bank Account Balance in Month 10: 104.25 Bank Account Balance in Month 11: 104.68 Bank Account Balance in Month 12: 105.12 Year 2 Bank Account Balance in Month 1: 105.55 Bank Account Balance in Month 2: 105.99 Bank Account Balance in Month 3: 106.44 Bank Account Balance in Month 4: 106.88 Bank Account Balance in Month 5: 107.32 Bank Account Balance in Month 6: 107.77 Bank Account Balance in Month 7: 108.22 Bank Account Balance in Month 8: 108.67 Bank Account Balance in Month 9: 109.12 Bank Account Balance in Month 10: 109.58 Bank Account Balance in Month 11: 110.04 Bank Account Balance in Month 12: 110.49 Year 3 Bank Account Balance in Month 1: 110.95 Bank Account Balance in Month 2: 111.42 Bank Account Balance in Month 3: 111.88 Bank Account Balance in Month 4: 112.35 Bank Account Balance in Month 5: 112.82 Bank Account Balance in Month 6: 113.29 Bank Account Balance in Month 7: 113.76 Bank Account Balance in Month 8: 114.23 Bank Account Balance in Month 9: 114.71 Bank Account Balance in Month 10: 115.19 Bank Account Balance in Month 11: 115.67 Bank Account Balance in Month 12: 116.15 Year 4 Bank Account Balance in Month 1: 116.63 Bank Account Balance in Month 2: 117.12 Bank Account Balance in Month 3: 117.61 Bank Account Balance in Month 4: 118.10 Bank Account Balance in Month 5: 118.59 Bank Account Balance in Month 6: 119.08 Bank Account Balance in Month 7: 119.58 Bank Account Balance in Month 8: 120.08 Bank Account Balance in Month 9: 120.58 Bank Account Balance in Month 10: 121.08 Bank Account Balance in Month 11: 121.58 Bank Account Balance in Month 12: 122.09 Year 5 Bank Account Balance in Month 1: 122.60 Bank Account Balance in Month 2: 123.11 Bank Account Balance in Month 3: 123.62 Bank Account Balance in Month 4: 124.14 Bank Account Balance in Month 5: 124.65 Bank Account Balance in Month 6: 125.17 Bank Account Balance in Month 7: 125.70 Bank Account Balance in Month 8: 126.22 Bank Account Balance in Month 9: 126.74 Bank Account Balance in Month 10: 127.27 Bank Account Balance in Month 11: 127.80 Bank Account Balance in Month 12: 128.34
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
4. Task 3: Using a nested loop
Write a program that takes a bank account balance and an interest rate as an input. And then outputs the value of the account in 5 years. The output should show the value of the account for two different methods of compounding interest: annually and monthly. When compounded annually, the interest is added once per year at the end of the year. When compounded monthly the interest is added in 12 times per year. On annual interest, you can assume that the interest is posted exactly one year from the date of deposit. In other words, you do not have to worry about interest being posted on a specific day of the year, like December 31. Similarly, you can assume monthly interest is posted exactly one month after. Since the account earns interest on the interest, the account should have a higher balance when interest is posted more frequently. Be sure to adjust the interest rate for the time period of the interest. If the rate is 5%, then when posting monthly interest, you use (5/12%). Do your calculations using a loop that adds in the interest for each time period. (Do not use some sort of algebraic formula). Your program should have an outer loop that allows the user to repeat this calculation for a new balance and interest rate.
NOTE:
Your source code must display any of the given sample output below.
It means your source code should be flexible enough to meet any of the given sample output.
Your source code output must be identical to any of the given sample output.
It means you have to strictly follow what are the displayed text, labels, casing of characters in the sample output.
Your source code must display any of the given sample output below.
It means your source code should be flexible enough to meet any of the given sample output.
Your source code output must be identical to any of the given sample output.
It means you have to strictly follow what are the displayed text, labels, casing of characters in the sample output.
OUTPUT 1 |
---|
Bank Account Balance: 100 |
Interest Rate: 5 |
Mode Menu |
[1] Annually |
[2] Monthly |
Option: 1 |
Annually Interest |
Bank Account Balance in Year 1: 105.00 |
Bank Account Balance in Year 2: 110.25 |
Bank Account Balance in Year 3: 115.76 |
Bank Account Balance in Year 4: 121.55 |
Bank Account Balance in Year 5: 127.63 |
OUTPUT 2 |
---|
Bank Account Balance: 100 |
Interest Rate: 5 |
Mode Menu |
[1] Annually |
[2] Monthly |
Option: 2 |
Monthly Interest |
Year 1 |
Bank Account Balance in Month 1: 100.42 |
Bank Account Balance in Month 2: 100.84 |
Bank Account Balance in Month 3: 101.26 |
Bank Account Balance in Month 4: 101.68 |
Bank Account Balance in Month 5: 102.10 |
Bank Account Balance in Month 6: 102.53 |
Bank Account Balance in Month 7: 102.95 |
Bank Account Balance in Month 8: 103.38 |
Bank Account Balance in Month 9: 103.81 |
Bank Account Balance in Month 10: 104.25 |
Bank Account Balance in Month 11: 104.68 |
Bank Account Balance in Month 12: 105.12 |
Year 2 |
Bank Account Balance in Month 1: 105.55 |
Bank Account Balance in Month 2: 105.99 |
Bank Account Balance in Month 3: 106.44 |
Bank Account Balance in Month 4: 106.88 |
Bank Account Balance in Month 5: 107.32 |
Bank Account Balance in Month 6: 107.77 |
Bank Account Balance in Month 7: 108.22 |
Bank Account Balance in Month 8: 108.67 |
Bank Account Balance in Month 9: 109.12 |
Bank Account Balance in Month 10: 109.58 |
Bank Account Balance in Month 11: 110.04 |
Bank Account Balance in Month 12: 110.49 |
Year 3 |
Bank Account Balance in Month 1: 110.95 |
Bank Account Balance in Month 2: 111.42 |
Bank Account Balance in Month 3: 111.88 |
Bank Account Balance in Month 4: 112.35 |
Bank Account Balance in Month 5: 112.82 |
Bank Account Balance in Month 6: 113.29 |
Bank Account Balance in Month 7: 113.76 |
Bank Account Balance in Month 8: 114.23 |
Bank Account Balance in Month 9: 114.71 |
Bank Account Balance in Month 10: 115.19 |
Bank Account Balance in Month 11: 115.67 |
Bank Account Balance in Month 12: 116.15 |
Year 4 |
Bank Account Balance in Month 1: 116.63 |
Bank Account Balance in Month 2: 117.12 |
Bank Account Balance in Month 3: 117.61 |
Bank Account Balance in Month 4: 118.10 |
Bank Account Balance in Month 5: 118.59 |
Bank Account Balance in Month 6: 119.08 |
Bank Account Balance in Month 7: 119.58 |
Bank Account Balance in Month 8: 120.08 |
Bank Account Balance in Month 9: 120.58 |
Bank Account Balance in Month 10: 121.08 |
Bank Account Balance in Month 11: 121.58 |
Bank Account Balance in Month 12: 122.09 |
Year 5 |
Bank Account Balance in Month 1: 122.60 |
Bank Account Balance in Month 2: 123.11 |
Bank Account Balance in Month 3: 123.62 |
Bank Account Balance in Month 4: 124.14 |
Bank Account Balance in Month 5: 124.65 |
Bank Account Balance in Month 6: 125.17 |
Bank Account Balance in Month 7: 125.70 |
Bank Account Balance in Month 8: 126.22 |
Bank Account Balance in Month 9: 126.74 |
Bank Account Balance in Month 10: 127.27 |
Bank Account Balance in Month 11: 127.80 |
Bank Account Balance in Month 12: 128.34 |
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY