Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab U13 C++ Control Structures Practice (20 Pts) due at the end of Unit 1 + 1 Week. Your objective for this lab is to

Lab U13 C++ Control Structures Practice (20 Pts) due at the end of Unit 1 + 1 Week.

Your objective for this lab is to practice with C++s control structuresdecision statements

and loop statements. Using these constructs are a part of virtually every C++ solution of any

substance. Being comfortable knowing when and how to use these statements is basic to

programming and problem solving

This is a two part Lab.

In part A, you will be using the decision and looping statements to determine how much

money you would make and have in Savings for the following situation: Determine what your Salary

will be on the 20th day of a 20-day job if you are paid 2 cents on the first day of employment and then

have your daily pay doubled for each succeeding day. How much can you save over the 20 days if you

use half your daily pay for expenses and save the rest?

Specifications:

Part A

Assume you are to be hired for a 25-day job and you propose to your employer, who is not too

bright but has lots of money at his disposal, that you be paid $5000 for the first day of work and then

for each day that follows, your daily salary be cut by 30% so that on the second day you are to be paid

$3500 and so forth Determine what your salary will be on the 20th DayNote if you have to start

paying the Boss for the privilege of working. Also assume you save half your daily salary and use the

rest for expenses. Report at the end of 25 days, how much money you have saved and how much

money you have made in total.

In part B, you will use a looping Control structure to calculate how compounding interest

affects your Savings. Use whatever looping control structure you feel is appropriate.

Specifications:

Part B

Write a program that takes in an initial savings amount and an expected interest rate and

determine how much money you will have after a year interest rollover. No withdrawals during

this time. Enclose these statements in a loop structure and then run your program for a period of

10 years and 20 years. Capture the total savings for each year after the interest has been added.

For some additional insight into how powerful compounding is for

your savings, suppose you add an annual contribution to your savings each year. Now capture

the total saving for each year after the interest and annual contribution has been added.

In part B you will take a problem description and solve it using, in part, a function you design and

specify in a separate (.h) file (for the function prototype) and another separate (.cpp) file (for the

function implementation/definition). Finally from a tester file which includes main() you will run your

solution and capture your output.

Deliverable(s):

Turn in the source listings of the programs you develop for both parts of this lab and the results

you get from running the programs against the test situations specified above. Be sure to properly

document your programs per the specifications in the previous labs. By now you should be getting a

feel for what information is necessary for fellow programmers who need to read and understand your

programs purpose and how it accomplishes the job.

Additional Programing suggestions:

1.) Write a program that implements the number guessing game.

2.) What will your monthly income be in Retirement if you have saved (say $400,000) in your

IRA/401K retirement plan when it comes time to retire and depend on this income. Assume the

balance you dont use in one year accumulates interest at a rate of 2 percent a year. For year

one the suggested process would be:

Year 1 income = (Saved amount)/ (Years the money is to last);

After Year 1 is deducted from your total, determine the Saved amount to be used in year 2 by adding

in your 2% interest you will receive on the Savings that is left over and then repeat above for year 2.

While this is a simple estimate of what you will receive and by no means what might actually

happen.at the end of the Years all the money will have been spent. If you want to make it more

realistic, consider the taxes that may be withdrawn each year depending on which tax bracket you

anticipate will apply to you. Further enhancements are also possible like leaving a legacy to your heirs

at the end of the anticipated years rather than using the money all up or having a windfall infusion of

money in some year

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David Kroenke

11th Edition

0132302675, 9780132302678

More Books

Students also viewed these Databases questions

Question

=+v1. Explain the terms associate and significant influence

Answered: 1 week ago

Question

Identify and describe basic workplace competencies

Answered: 1 week ago

Question

Describe the steps involved in coaching to improve poor performance

Answered: 1 week ago