Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have to write a C++ program that computes COMPOUND INTEREST NOT SIMPLE INTEREST, USING CONTROL STRUCTES; A NESTED LOOP(OUTER LOOP CONDITION IS NUMBER OF

I have to write a C++ program that computes COMPOUND INTEREST NOT SIMPLE INTEREST, USING CONTROL STRUCTES; A NESTED LOOP(OUTER LOOP CONDITION IS NUMBER OF ACCOUNTS, INNER LOOP CONDITION IS NUMBER OF MONTHS) AND MULTIPLE IF ELSE STATEMENTS

Balance Rate

overdrawn accounts no interest

0 thru $99.99 2.0%

$100.00 thru $999.99 3.0%

$1000.00 and above 4.0%

Given the initial balance of a number of accounts, write a program to find the final balance of each account at the end of a specified period of time.Your program should also find the sum of all final balances. You will be provided the input data file (in electronic form) for this program.

An example file that looks like the data file is shown on the other side of this sheet. You may use this example data file for program development. Your program should not be hardcoded for this example data file, rather your program should work for any data file that has the right format.

The first number in the data file (an integer) is the number of accounts to be processed. Data for the accounts follow on subsequent lines. For each account, three numbers are given per line as follows:

1. Four-digit account number, an integer.

2. Initial balance, a decimal number.

3. Number of months over which interest is to be computed, an integer.

Note that a negative initial balance indicates an overdrawn account. Your program should read the data directly from the data file, since the number of accounts in the file may change. Your program should work correctly for any number of accounts as specified in the data file. Your output should consist of four columns for each customer:account number,number of months,initial balance andfinal balance. The last line of your output should be the sum of all final balances. Note that the final balance for an overdrawn account is the same as the initial balance. All balances printed by your program should be printed with two decimal places.

Example Data for Program 2

32 1000 2.79 9 1234 95.04 23 3341 0.00 10 3221 -1.08 21 7462 404.14 4 3425 4784.00 11 3701 99.50 4 2701 -99.54 4 3532 999.50 7 4512 50.00 15 3667 500.00 15 3696 99.99 9 3917 100.00 9 2833 999.99 9 3332 1000.00 9 2462 -212.32 0 5442 9999.99 15 8817 990.50 11 9183 20.00 200 1112 74.74 21 9287 74.74 1 2591 0.00 22 2837 1.50 3 3832 -0.78 3 1003 7.47 15 8713 99.75 200 3452 1200.34 5 9876 495.95 10 3276 -294.17 10 2228 80.40 15 0000 77.77 7 7183 1.00 75 38.289.99939 JUNKJUNKDKDKDKD SHOULD NEVER GET HERE 3333 0,0,0

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

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions

Question

13-1 How does building new systems produce organizational change?

Answered: 1 week ago

Question

13-4 What are alternative methods for building information systems?

Answered: 1 week ago