Goals C++: programming basics, OOP C++: working with floating point number Use given unit tests as...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Goals C++: programming basics, OOP C++: working with floating point number Use given unit tests as instruction manual Get comfortable with the grading submission process Problems To Solve There are TWO problems to solve. Please find the description of the first 2 problem below: Problem 1: (50pt + 10 Extra Credit) Problem 2: (50pt) Code Repo Use the following repo for homework: Code: B> Not using this repo will result in 0 point. General requirements (VERY IMPORTANT): Do not create any new file or delete existing file in the repo. The grader bot checks for this. Do not make modification to any file outside the src and test folders. Do not make modification to any file unless specificially allowed (in comments or told by the instructor). (50pt) Compound Interest The Background "The eighth wonder of the world. He who understands it, earns it; he who doesn't, pays for it. This is the famous quote about compound interest. And here's the definition from Wikipedia B: - Albert Einstein Compound interest is the addition of interest to the principal sum of a loan or deposit, or in other words, interest on interest. It is the result of reinvesting interest, rather than paying it out, so that interest in the next period is then earned on the principal sum plus previously accumulated interest. Note: Compound interest is a general kind of effect that applies to more aspects than finance. We ain't just talking about money here. In simple term, compound interest is about a repeated small step produces acceleratingly large result over time. But be aware that this can manifest as angel or evil, meaning it can be really good or really bad for you. There are numerous ways to benefit or suffer from the effect of compound interest, and a larger issue is that many people learn this too late :( So, let's learn this to stay on the positive side of it, and now. The Task (50pt) The task of this home is to complete a compound interest simulator. Do not use any math library. There are a few distinct features of this task The calculator we are writing is based on this calculator B. Use it to help understand how compound interest works. Lots of our test cases are generated using this calculator. See this for a comparison between the web calculator and our use cases. All tests are given. This serves as validation, but more importantly, use it as a manual to figure out how the code should work. There's only one function for you to write here B. Computation is done in floating point number, so round-off error is an issue. See this for an intro. Extra Credit 1 (5pt) Write a paragraph in a block of comment in problem_1.cpp describing how you would apply the effect of compound interest to your life in a good way. Extra Credit 2 (5pt) Add a new unit test in unit_test_problem_1.cpp to show how you would apply the effect of compound interest financially, but DO NOT CHANGE OR REMOVE EXISTING TESTS! Your test has to pass and make logical sense to get this points. Abstract Data Type (ADT) In a programming language, we are often provided some data type such as integer, float, and even class such as in Java and C++. An Abstract Data Type (ADT) is a fancy term, but it really just means we can create our own data type. In C++ we can do this by using class. For example, List is a very commonly used data type. Similar to array, a list has a few properties: . A List contains a linear sequence of elements A List has a size and capacity, and capacity can be limited or unlimited . Each element in the List has an index of 0, 1, 2, etc. New element can be add to the front or back of the List Element can be removed from a List Lists can be merged into each other And here B's an C++ interface that defines a List ADT: template Goals C++: programming basics, OOP C++: working with floating point number Use given unit tests as instruction manual Get comfortable with the grading submission process Problems To Solve There are TWO problems to solve. Please find the description of the first 2 problem below: Problem 1: (50pt + 10 Extra Credit) Problem 2: (50pt) Code Repo Use the following repo for homework: Code: B> Not using this repo will result in 0 point. General requirements (VERY IMPORTANT): Do not create any new file or delete existing file in the repo. The grader bot checks for this. Do not make modification to any file outside the src and test folders. Do not make modification to any file unless specificially allowed (in comments or told by the instructor). (50pt) Compound Interest The Background "The eighth wonder of the world. He who understands it, earns it; he who doesn't, pays for it. This is the famous quote about compound interest. And here's the definition from Wikipedia B: - Albert Einstein Compound interest is the addition of interest to the principal sum of a loan or deposit, or in other words, interest on interest. It is the result of reinvesting interest, rather than paying it out, so that interest in the next period is then earned on the principal sum plus previously accumulated interest. Note: Compound interest is a general kind of effect that applies to more aspects than finance. We ain't just talking about money here. In simple term, compound interest is about a repeated small step produces acceleratingly large result over time. But be aware that this can manifest as angel or evil, meaning it can be really good or really bad for you. There are numerous ways to benefit or suffer from the effect of compound interest, and a larger issue is that many people learn this too late :( So, let's learn this to stay on the positive side of it, and now. The Task (50pt) The task of this home is to complete a compound interest simulator. Do not use any math library. There are a few distinct features of this task The calculator we are writing is based on this calculator B. Use it to help understand how compound interest works. Lots of our test cases are generated using this calculator. See this for a comparison between the web calculator and our use cases. All tests are given. This serves as validation, but more importantly, use it as a manual to figure out how the code should work. There's only one function for you to write here B. Computation is done in floating point number, so round-off error is an issue. See this for an intro. Extra Credit 1 (5pt) Write a paragraph in a block of comment in problem_1.cpp describing how you would apply the effect of compound interest to your life in a good way. Extra Credit 2 (5pt) Add a new unit test in unit_test_problem_1.cpp to show how you would apply the effect of compound interest financially, but DO NOT CHANGE OR REMOVE EXISTING TESTS! Your test has to pass and make logical sense to get this points. Abstract Data Type (ADT) In a programming language, we are often provided some data type such as integer, float, and even class such as in Java and C++. An Abstract Data Type (ADT) is a fancy term, but it really just means we can create our own data type. In C++ we can do this by using class. For example, List is a very commonly used data type. Similar to array, a list has a few properties: . A List contains a linear sequence of elements A List has a size and capacity, and capacity can be limited or unlimited . Each element in the List has an index of 0, 1, 2, etc. New element can be add to the front or back of the List Element can be removed from a List Lists can be merged into each other And here B's an C++ interface that defines a List ADT: template
Expert Answer:
Posted Date:
Students also viewed these programming questions
-
Question #4. The disposition effect has been characterized in various ways: the "effect, whereby investors are anxious to sell their winners, but reluctant to sell their losers" (Shefrin 2005, 419);...
-
KYC's stock price can go up by 15 percent every year, or down by 10 percent. Both outcomes are equally likely. The risk free rate is 5 percent, and the current stock price of KYC is 100. (a) Price a...
-
Question: What as the average weekly safety inventory level of refined sugar from the beginning January 2022 to the end of July 2022? A. 512,465.9691 metric tons per week B. 316,002.1474 metric tons...
-
The management of Mecca Copy, a photocopying centre located on University Avenue, has compiled the following data to use in preparing its budgeted balance sheet for next year: Ending Balances...
-
Using the data from Problem 1, what is the optimum portfolio assuming short sales are allowed but riskless lending and borrowing are forbidden? In Problem 1 2, 0 0 0 0 0 0 0|324121 t-050805 112011...
-
Define globalization. How has it proceeded in trade in goods and services versus capital markets?
-
In producing product \(\mathrm{ZZ}, 14,800\) direct labor hours were used at a rate of \(\$ 8.20\) per hour. The standard was 15,000 hours at \(\$ 8.00\) per hour. Based on these data, the direct...
-
Clipboard Office Supplys March 31, 2012, budgeted balance sheet follows: The budget committee of Clipboard Office Supply has assembled the following data. Sales in April were $48,000. You forecast...
-
Research "Globalization of Healthcare" online, and then answer the following questions: A decade ago, the idea that medical procedures might move offshore was unthinkable. Today it is a reality. W
-
Explain what advanced data analysis is in SOC. (Can you please provide an explanation, not word for word from an online source? Thank you)
-
Draft a memo to your boss Sydney setting forth the legal responsibilities (if any) towards this person. Discuss in detail, in relation to both federal and a specific state law, if the company has to...
-
An earthquake occurred in one of the warehouses of Sable Ltd in Melbourne on 15 June 2022 and caused extensive damage worth $50,000. The warehouse and its contents are fully insured. No disclosure...
-
Yolanda, your tax client, recently started her own business as a healthcare consultant and set up an office in her home used exclusively for client meetings and other business-related activities....
-
The functions f and g are defined as follows. f(x)=-5x+2 g(x)=-4x-3 Find f (6) and g (5). Simplify your answers as much as possible.
-
Assignment 1 During your audit of the financial statements of The Gary Manufacturing Company for the year ended December 3 1 , 2 0 0 7 , you find that at January 1 , 2 0 0 7 , the company had...
-
Of the 40 transactions carried out by the company during the year below, 1. Which includes costs - expenses or not both (use the table format below to make it easier to work on and check later) 2....
-
What can scientists learn by comparing the fossilized skeletons of extinct primates with the bones of modern species?
-
_____ is a situation in which the organization takes an adverse employment action against an employee because the employee brought discrimination charges against the organization or supported someone...
-
_____ consist of any action such as firings, demotions, schedule reductions, or changes that would harm the individual employee.
-
_____ exists when an employee is put under such extreme pressure by management that continued employment becomes intolerable for the employee and, as a result of the intolerable conditions, the...
Study smarter with the SolutionInn App