Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program using C language. Instruction below. Please write whole program not only one or two part. Thanks. Topics: User defined functions, pointers, menu

Write a program using C language. Instruction below. Please write whole program not only one or two part. Thanks.

Topics: User defined functions, pointers, menu driven program Synopsis: You will code a C program will manage money in a bank account. You will have 3 accounts namely checking, savings and credit. The user can choose to withdraw or deposit money in these accounts. Instructions: You must have at least 6 user defined functions (prototypes declared below) You must define a MAXCREDIT of -4500 Your starting bank balances should be as follows: oChecking:256.00 oSavings:1024.00 oCredit:-2048.00 //bank.c programming assignment2 #define_CRT_SECURE_NO_WARNINGS #include #defineMAXCREDIT-4500 // Displays the list of options available //prompts for the users selection and sets the value of the selection voidBankMenu(int*choice); //greets the uservoidGreeting(); //Takes one double argument and one character argument //displays the current balance of the account ('C' checking, 'S' savings, 'X' credit) voidAccountBalance(doubleaccount, charletter); //takes reference to all the bank account values and the menu selection //Makes the decision of which transaction should be done voidTransactionDecision(intnum, double*cPtr, double*sPtr, double*xPtr); //takes a reference to the selected account balance //gets the added amount from the user and adds it to the account voidDepositMoney(double*accountPtr); //takes a reference to the selected account balance //gets the withdrawal amount from the user //checks to see if there is enough money available or enough credit available //subtracts the money from the account if available voidWithdrawMoney(double*accountPtr, charletter); Additional Requirements: Do NOT declare any pointers for this assignment Do NOT use global variables Do NOT use break statements to stop loops Use function prototypes Write comments for each function prototype Write comment for each function definition Indent your code properly (refer to the textbook and sample code) Place adequate comments throughout your code Use meaningful variable names

Sample Program Output: Welcome to the Bank of COP 2220 It isa pleasure to manage your checking, savings, and credit accounts-- You currently have $480.45 in your checking account --You currently have $124.62 in your savings account --You currently have $-2134.78 credit balance ------------------------ (1) to DEPOSIT to CHECKING( 2) to WITHDRAW from CHECKING (3) to DEPOSIT to SAVINGS (4) to WITHDRAW from SAVINGS (5) to DEPOSIT to CREDIT (6) to TAKE an ADVANCE from CREDIT (7) for all ACCOUNT BALANCES (-1) QUIT

Select an option: 2 The transaction you chose was: 2 Withraw from Checking --You currently have $480.45 in your checking account Enter the amount to be Withdrawn: 400 --You currently have $80.45 in your checking account ------------------------ (1) to DEPOSIT to CHECKING (2) to WITHDRAWfrom CHECKING (3) to DEPOSIT to SAVINGS (4) to WITHDRAW from SAVINGS (5) to DEPOSIT to CREDIT (6) to TAKE an ADVANCE from CREDIT (7) for all ACCOUNT BALANCES (-1) QUIT

Select an option: 3 The transaction you chose was: 3 Deposit to Savings --Youcurrently have $124.62 in your savings account Enter the amount to deposit: 400 --You currently have $524.62 in your savings account ------------------------ (1) to DEPOSIT to CHECKING (2) to WITHDRAW from CHECKING (3) to DEPOSIT to SAVINGS (4) to WITHDRAW from SAVINGS (5) to DEPOSIT to CREDIT (6) to TAKE an ADVANCE from CREDIT (7) for all ACCOUNT BALANCES (-1) QUIT

Select an option: 6 The transaction you chose was: 6 Take out more Credit --You currently have $-2134.78 credit balance Enterthe amount to be Withdrawn: 3000 *** There is not enough credit available for this transaction *** The Maximum credit allowed is $-4500.00 *** Contact customer service about raising your Credit Line --You currently have $-2134.78 credit balance ------------------------ (1) to DEPOSIT to CHECKING (2) to WITHDRAW from CHECKING (3) to DEPOSIT to SAVINGS (4) to WITHDRAW from SAVINGS (5) to DEPOSIT to CREDIT (6) to TAKE an ADVANCE from CREDIT (7) for all ACCOUNT BALANCES (-1) QUIT

Select an option: 7 The transaction you chose was: 7 Show account balances --You currently have $80.45 in your checking account --You currently have $524.62 in your savings account --You currently have $-2134.78 credit balance ------------------------ (1) to DEPOSIT to CHECKING (2) to WITHDRAW from CHECKING (3) to DEPOSIT to SAVINGS (4) to WITHDRAW from SAVINGS (5) to DEPOSIT to CREDIT (6) to TAKE an ADVANCE from CREDIT (7) for all ACCOUNT BALANCES (-1) QUIT

Select an option: -1 The transaction you chose was: -1 Press any key to continue . .....

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

Databases Theory And Applications 27th Australasian Database Conference Adc 20 Sydney Nsw September 28 29 20 Proceedings Lncs 9877

Authors: Muhammad Aamir Cheema ,Wenjie Zhang ,Lijun Chang

1st Edition

3319469215, 978-3319469218

More Books

Students also viewed these Databases questions

Question

Identify conflict triggers in yourself and others

Answered: 1 week ago