Programming assignment #5 banking transactions in c programing

PROGRAMMING ASSIGNMENT #5

 

Write a C program that allows the user to make some banking transactions. The program

 

should first prompt the user to enter the current balance of his/her bank account (in

 

dollars and cents, not less than zero). The program should then prompt the user to enter

 

the number of withdrawals to make, and then the number of deposits to make. For this

 

assignment, let’s set a maximum of 50 deposits and 50 withdrawals, you’ll see why as

 

you read on. These will be stored in arrays, which you will be studying for this

 

assignment. One of your program statements should be:

 

 float deposit[50], withdrawal[50];

 

Using a loop, the program should then prompt the user to enter the amount of the first

 

deposit (a positive amount to add to the bank account balance), the amount of the

 

second deposit, the third, & etc., until the number of deposits have been processed

 

Using a second loop, the program should then prompt the user to enter the amount of the

 

first withdrawal (a positive amount to subtract from the bank account balance, if

 

possible), the amount of the second withdrawal, the third, & , etc. until the number of

 

withdrawals have been processed. Once all deposits and withdrawals have been made, the

 

program should output the ending balance.

 

Read all the specifications carefully. I did not show all of the editing features

 

The dialog with the user should look similar to the following, only with your special

 

introductory statement(s) as you wish:

 

Welcome to the Sears Banking System (or whatever you wish here)

 

Please enter your name: Jim

 

Now enter your current balance in dollars and cents: 256.40

 

Enter the number of withdrawals: 2

 

Enter the number of deposits : 3

 

Enter the amount of deposit #1: 10.50

 

Enter the amount of deposit #2: 12.25

 

Enter the amount of deposit #3: 125.30

 

Enter the amount of withdrawal #1: 120.35

 

Enter the amount of withdrawal #2: 35.60

 

*** The closing balance Jim is $248.50 ***

 

At this point, the program should also output one of the following messages based on the

 

closing balance. That is:

 

If the closing balance is greater than or equal to 50000.00, output:

 

 “*** (name) it is time to invest some money! ***”

 

If the closing balance is between 15000.00 and 49999.99, output:

 

 “*** (name) maybe you should consider a CD. ***”

 

If the closing balance is between 1000.00 and 14999.99, output:

 

 “*** (name) keep up the good work! ***”

 

If the closing balance is between 0.00 and 999.99, output:

 

 “*** (name) your balance is getting low! ***”

 

So, in the above example, the last line of sample output would be:

 

*** Jim your balance is getting low! ***

 

Regarding error checking on all user input, the following check should be made while

 

users are entering the withdrawal amounts: If the withdrawal amount exceeds the current

 

balance (including the new deposits), the program should issue the following error

 

*** Withdrawal amount exceeds current balance. ***

 

The program should then re-prompt for a lower withdrawal amount. But, if the current

 

balance goes to zero, no more withdrawals should be made and an appropriate message

 

should appear (that one’s up to you! Use some polite creativity!)

 

So, for example, a sample run of the program with error checking might look like:

 

Enter current balance in dollars and cents: -56.40

 

Error: Beginning balance must be at least zero, please re-enter!

 

Enter current balance in dollars and cents: 256.40

 

Enter the number of withdrawals: 2

 

Enter the number of deposits: -3

 

Error: Number of deposits must be at least zero, please re-enter.

 

Enter the number of deposits: 3

 

Enter the amount of deposit #1: 10.50

 

Enter the amount of deposit #2: 12.25

 

Enter the amount of deposit #3: 125.30

 

Enter the amount of withdrawal #1: 5000.00

 

*** Withdrawal amount exceeds current balance. ***

 

Enter the amount of withdrawal #1: 120.35

 

Enter the amount of withdrawal #2: 35.60

 

*** The closing balance Jim is $248.50 ***

 

*** Jim your balance is getting low. ***

 

You are to keep track of all of the deposits and all of the withdrawals so that you can

 

print them out in “record” form. You do this by storing them in arrays. You will have

 

one array to hold the deposit amounts entered by the user, and another array to hold the

 

withdrawal amounts. You want to be sure that the size of the arrays are large enough to

 

handle 50 deposits and 50 withdrawals. Perhaps:

 

float deposits[50], withdrawals[50];

 

 *** Banking Summary ***

 

Start Balance: $ 256.40

 

Deposit #1: 10.50

 

Deposit #2: 12.25

 

Deposit #3: 125.30

 

Withdrawal #1: 120.35

 

Withdrawal #2: 35.60

 

Ending Balance: $ 248.50

 

It is hard to see this in HTML, but I want you to align the decimal points in the

 

Notice the test above for “Too many deposits”. You want to be sure that the user does not

 

want to enter more information than you can store in your array. In my example above, I

 

made the array sizes “50”. That means that I can store up to 50 deposits and 50

 

withdrawals. So, I want to test that the user does not plan to enter more than that. The

 

same error checking should be done on the code that prompts for withdrawals.

 

If you run out of time then you can:

 

1. Omit the error checking for balance not going less than zero for -5.

 

2. Omit the personalized message for -5

 

NOTE: There are some bothersome complications with the entry and storage of some

 

float numbers. Because of the way data is stored the float number 22.39 may be stored as

 

22.389999 and this may cause a problem with your final if statements and even with

 

balance equaling zero. To help with this you can test for the balance < .01 instead of =

 

0. This is a well known anomaly in C. You may not encounter these problems, I just

 

wanted to warn you of the potential problem.

 

(Darth Vader theme plays in background…..)

Get 20% Discount on This Paper
Pages (550 words)
Approximate price: -

Try it now!

Get 20% Discount on This Paper

We'll send you the first draft for approval by at
Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

Custom Writings Help is a Quality-Oriented Company in Online Writing as a result of hiring exceptional professionals to execute clients' tasks.

Essays

Research Papers

At Custom Writings Help,We understand the struggle of research paper writing, and that is why at Custom WritingS Help, we are all out to help you. We pride ourselves on having a team of clinical writers. The stringent and rigorous vetting process ensures that only the 'BEST' Writers are chosen for the job. We have highly qualified Ph.D. and MA writers working with us; we equally offer these experienced writers specific bonuses and incentives to make them deliver highly original, unique, and informative content at reasonably low prices.

Admissions

Thesis Writing Service

Worlwide, Many Masters Students are struggling with Thesis Completion. A thesis is likely to be the longest and most challenging piece of work a student has ever completed. However, unlike essays and other assignments, a student can pick a particular interest topic and work on their initiative. Fortunately, we are there for you. At Custom Writings Help, you are assured of an authentic, imaginative, informative, linguistically great, and advantageous thesis that adheres to all your needs. So, why continue considering different writers when you have discovered the best in the field?

Editing

Custom Papers

Not a single student can avoid writing custom papers. However, a total lack of experience, skills, and time makes it very hard to produce a superb writing piece. Therefore, if you are seeking professional help, turn to us. Our specialized and experienced writers compose a variety of model papers, including custom essays, college term papers, research papers, book reports, MBA essays, executive summaries, dissertations, Ph.D. theses, admission essays, and research proposals for college and university students at any level.

Coursework

Essay Writing

Most of the students disregard the critical principles of essay writing and compose papers below sensible guidelines. Therefore, with Custom Writings Help, one should not worry about his/her essay. Our Writers compose informative and engaging content on all complexities and topics. We write meaningful and smart essays while prioritizing all aspects that bring about a good grade, such as impeccable grammar, proper structure, zero-plagiarism, and conformance to guidelines.

Coursework

Coourse Work Writing

Don't let the seemingly never-ending onslaught of writing assignments get you down. If you are looking where to get course work assistance online, the writers at Custom Writings Help are here to assist you with all of your writing needs. We undertake to unique delivery of papers that meet the professor's requirements. The content is proofread, edited, and checked plagiarism before submission to customers. No matter how big or small your work is, we will deliver on time. Try US Now! !

Coursework

Dissertation Writing Service

High-Quality Dissertation Writing Services are rare. They require Ph.D. academicians – not easily found. However, are an exception. The years, time, and resources we have invested in the dissertation world has given us a competitive advantage over others. Choose to come to Custom Writings Help; You will find perfect Ph.D. consultants who have written hundreds of dissertations theses ready to help you. Let our dissertation-writing services help you craft your dissertation, for you are assured we will give you the results.