You are on page 1of 1

Mumbai Educational Trust

Institute Of Information Technology


UNIX - Programming

Assignment #1

Create a pluggable program called loantest.c which accepts a loan policy at runtime in form of a
library.

Implement following loan policies:

1. Home loan in file called homeloan.c with function


InterestRate which accepts amount p of double and duration n of int type
// logic return 9.5f if n <= 5 else 10.0f
Note:
Create library with name libhome.so

2. Personal loan in file called personalloan.c with function


InterestRate which accepts amount p of double and duration n of int type
//logic return 10.5f if p <= 50000 else 11.5f
Note:
Create library with name libpersonal.so

3. Business loan in file called businessloan.c with function


rateOfInterest which accepts amount p of double and duration n of int type

//logic in sequence of following instructions


a) r = 11.5f if p < 100000 else 12.5f;
b) If n greater than equal to 3 then r += 0.5f;
c) return r;
Note:
Create library with name libbusiness.so

Create a menu driven program called loantest.c as:

H. Home Loan
P. Personal Loan
B. Business Loan

Note:
a) Scan the option from the above menu
b) Scan the amount and the duration
c) Display the E.M.I for that loan policy using following logic

for(int n = 1; n <= duration; ++n){


float r = call function from library passing the amount and duration
double emi;
float i = r / 1200;
emi = amount * i / (1 - pow(1 + i, -12 * n));

Note: Program should be according to convention given by Akash sir.

You might also like