Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C# application that implements the following class(s) as per business requirements mentioned below: A. Create an abstract Loan class (Loan.cs) that has the

Write a C# application that implements the following class(s) as per business requirements mentioned below: A. Create an abstract Loan class (Loan.cs) that has the following instance variables: a) Loan number - 3 digits. Loan number should only have getter and should be declared of the type read only. b) Customer name c) customer date of birth (This should be represented by an object of predefined Date class in C#), d) Customer address [( create a new Address class (Address.cs) having following instance data members: House number, Street name, City, Province, Zip code. Implement getter and setter and toString() method for Address class.)], e) Loan amount - Loan amount and interest rate cannot be negative and zero. f) Rate of interest. Interest rate should not be more than 5.0% in any given situation. g) Loan duration i.e. time Define Properties (getter and setter) along with validations for all the above instance variables. h) Loan class should have defined two overloaded constructors: One for initializing all the instance data members Second for initializing only Loan number, customer name, date of birth and address i) Declare an abstract public method double CalculateMonthlyLoanInstallment() which is used for calculating monthly loan installment amount. j) Define toString() to display the values B. Create following two derived classes of Loan class: Mortgage Loan (Mortgage Loan.cs) CarLoan (CarLoan.cs) C.For Mortgage Loan class, implement the following: k) Define an instance variable - property tax for yearly property tax I) Define another instance variable-infrastructure tax for municipal infrastructure which is a fixed monthly amount added to while calculating monthly loan installment amount m) Define Properties for the above and validations. Property tax and infrastructure tax should not be negative and zero. n) A constructor for initializing all the instance variables o) Overriding the method - double Calculate MonthlyLoan Installment() which calculates monthly mortgage loan installment and to this installment amount, you need to add property tax and infrastructure tax. p) You need to override toString() method to display the object's data. D.For Carloan class, implement the following: q) Define an instance variable - yearly car insurance amount and define property and validation. It should not be negative and zero. r) Constructor for initializing all the instance variables s) Overriding the method - double Calculate MonthlyLoanInstallment() which calculates monthly car loan installment (and to this installment amount, you need to add car insurance amount. First calculate the monthly car installment and then calculate monthly car insurance. And then add them together.) t) You need to override toString() method to display the object's data. E.Create a test class - Loan Test (LoanTest.cs) which tests above classes by at least creating two objects each of the MortgageLoan and CarLoan classes. And you are required to process them polymorphically i.e. assigning their references to Loan superclass and then processing them normally and polymorphically

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

Financial Statement Analysis Accounting Ratio Analysis

Authors: Commerce Central

1st Edition

979-8862220773

More Books

Students also viewed these Accounting questions

Question

3. You can gain power by making others feel important.

Answered: 1 week ago