Topical Information

This program will give you more practice branching, calling standard library functions, looping and playing with character input's clever applications. (There may also be a chance to write your own functions -- to clean up the program and ease development -- to practice with randomness, or even to use more advanced input features. See the Options section below.)

Background Information

The company you work for uses information about the current year's planned budget compared to the current year's expenditures to decide what next year's budget will be.

Program Information

Write a program that helps the user -- prospectively a manager at the company -- determine the budget for the next year. You should gather from them both the budgetted amount for last year and the amount spent for last year. For each, the user may enter the currency units either in front or in back of the value. If they enter neither, you are to assume that currency is measured in dollars ($). Although it shouldn't happen, if they enter something in both places, you should be able to handle that, too.

Then calculate for them the percent of their budget that was used -- this may be over 100%. This percent should be rounded to the nearest whole percent. Finally, force their spending up to the next $100 and tell them that this figure will be their budget for the next year.

Make sure you print their results in a nice way. Use the currency unit they entered at the beginning (or $). Be sure to place this marker either in front or in back of the new budget just like they entered it. (If they didn't enter the units, place the $ in the front by default.) And always print two decimal places (even though we shouldn't have any change to report). Also print the percent of their budget that was used with a percent sign (%) after it.

As an example, you might have the program interaction look something like (the parts in blue are typed by the user):

$ budgetproj.out

                 Welcome to the Budget Projection Program!!!

What was your budget allotment last year?  $1300.00
Fine, and how much did you spend last year?  $1432.00

Thank you!!  Calculating...  Done.

Last year you used up about 110% of your budget.

Your budget next year will be $1500.00.

Thank you for using the BPP!!

Endeavor to have a fiscally fit day!


Note how the percent rounded down but the new budget amount went up.

This assignment is (Level 4).