Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement part of a loan management system as follows: a)Develop an account class (super class), a loan class (sub-class) and a saving account (sub-class) Account

Implement part of a loan management system as follows:

a)Develop an account class (super class), a loan class (sub-class) and a saving account (sub-class)

Account class

-customerIdCard: int

-accountId: int (should be auto-generated)

-customerName: String

-customerPhone: int

-balance: double

-annualInterestRate: double

-accountCreationDate: Date

+Account(customerIdCard: int, customerName: String, customerPhone: int, balance: double, annualInterestRate: double)

+getCustomerIdCard(): int

+getAccountId(): int

+getCustomerName(): String

+getBalance():double

+getAnnualInterestRate(): double

+setBalance(balance: double): void

+setAnnualInterestRate(annualInterestRate: double): void

+withdraw(amount: double): void

+deposit(amount: double): void

Loan class

-loanAmount: double

-numberofYears: int

-savingAccountId: int

-nextPaymentDate: Date

-monthlyPaymentAmt: double

-totalPaymentAmt: double

+loan(customerIdCard: int, customerName: String, customerPhone: int, loanAmount: double, savingAccountId: int, annualInterestRate: double, numberOfYears: int)

+getNumberOfYears():int

+getSavingAccountId(): int

+getLoanAmount(): double

+getLoanAccountId(): int

+SetNumberOfYears(numberOfYears: int): void

+setLoanAmount(loanAmount: double): void

+ReduceLoanBalance(Amount: double): void

+monthlyPayment(): double

+totalPayment(): double

SavingAccount class

+SavingAccount(customerIdCard: int, customerName: String, customerPhone: int, balance: double, annualInterestRate: double)

+calculateInterest(numberOfYears): void

b)Built a program class that displays the following menu containing five functions and the system will ask the user to input a menu item to execute a particular function:

1)built a new loan account

2)built a new saving account

3)Reduce Loan balance

4)Loan Enquiry

5)Exit

For i), the system should ask the user to input the Customer ID card number.

If the customer ID card number is matched with the ID card number in saving account, it will display the following items on screen: 1) Customer name, 2) Customer telephone number, 3) Customer savings account number.

Then, it will transfer all those items to loan account. If customer ID card number not found, ask the user to built a saving account first.

Then, it will continue to ask user to input: 1) Loan amount, 2) annual interest rate, 3) number of years. The system should generate a loan id and the date of creating the loan (current date). Based on the date of creating the loan, it will deduce the next payment date (28 days from now). The loan balance should be equal to the loan amount initially. Besides, it will calculate the monthly payment based on the formula on next page. After that, it will store all the information in a new loan object.

For ii), the system should ask the user to input the following: 1) Customer name, 2) Customer ID card number, 3) Customer telephone, 4) Annual interest rate, 5) Initial balance. The system will generate the account id and the account creation date. All the information above will be stored in a new savings account object.

For iii), the system will ask the user to input the loan id number and it will display corresponding loan information on screen. Then, it will ask user to input the total amount for loan payment. Based on the amount, it will check the corresponding savings account to see if the reduced amount is sufficient there. If sufficient, it will reduce the loan balance from his/her loan account. In addition, it will calculate the new monthly payment and the total amount together with displaying them on screen. Furthermore, the system will save the new values in the corresponding loan account. However, it will send error message to user if reduced amount is not sufficient in savings account.

For iv), it will ask user to input the loan account number and all the information about the corresponding loan will be displayed on screen.

For v), the execution of system will be terminated.

Please don't forget that after each function is performed, the system should display the main menu again and then ask the user to input a main item number. Finally, do the validations properly.

image text in transcribed
monthly payment = loan balance * monthly interest rate 1 - 1 (1 + monthly interest rate )number of years*12 total payment = monthly payment * number of years * 12

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

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions