Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 2 - Macro Bank updates its customer's accounts at the end of each month. The bank offers two types of accounts: savings and current.

image text in transcribed

image text in transcribed

Task 2 - Macro Bank updates its customer's accounts at the end of each month. The bank offers two types of accounts: savings and current. Every customer must maintain a minimum balance. If a customer's current balance falls below the minimum balance, there is a penalty of 7 OMR for savings account and 12 OMR for current accounts. If the balance at the end of the month is at least the minimum balance, the account receives interest as follows: . "savings' accounts receive 5% interest on current balance 'current accounts with balances of up to 4000 OMR receive 2% interest on current balance; otherwise the interest 6% on current balance. Write and execute a C program using onlinegdp.com with descriptive comments explaining each line code: 1. Reads an account number (int type), account type: s or S for savings, cor C for current, and minimum balance that the account number should maintain, and current balance (both of typ float) of five customers. (5 marks for comments) (10 marks) 2. The program must use switch-case construct for account types (Savings and Current). Each ca will call relevant function, otherwise run the program again. (5 marks for comments) (10 marks) 3. The functions will calculate final balance as per the conditions given above and return that amount back to the main function (10 marks for comments) (20 marks) 4. All the data are saved in arrays (account number, account type, minimum balance, current balance and final balance) (5 marks for comments) (10 marks) 5. Account data are retrieved from the arrays then shown in a table format as displayed in the Sample Output 1 below: (10 marks for comments) (20 marks) 6. Test the program running it five times using the following input data samples and print the output (final balance) of each as given in Sample Output 2. Paste the code and output in the report. (7.5 marks for comments) (15 marks) Sample Output 1: Account No: 1 Enter account number and account type (C or S): 123 3 Enter account minimum balance: 1500 Enter current balance: 1493 The final balance is 1486.0 Account No: 2 Enter account number and account type (C or S): 10055 C Enter account minimum balance: 3350 Enter current balance: 3338 The final balance is 3326.0 Sample Output 2: Acct Type s Acct No 123 55 334 C Min. Balance 1500.0 3350.0 7450.0 2200.0 4500.0 Acct Balance 1493.0 3338.0 7822.5 2244.0 4770.0 Final Balanc 1486.0 3326.0 8213.6 2288.9 5056.2 S 21 C 55

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 Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

7 Describe the role of an HR business partner

Answered: 1 week ago