0% found this document useful (0 votes)
14 views91 pages

Loan Management System Use Cases

The document contains specifications and code for a loan management system including use cases for customer registration, login, and applying for a loan. The registration use case allows a customer to register by entering personal details. The login use case authenticates existing customers. The apply for loan use case enables a logged in customer to select a loan type and amount. Diagrams and code are provided for each use case.

Uploaded by

TUSHAR CHAURE
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views91 pages

Loan Management System Use Cases

The document contains specifications and code for a loan management system including use cases for customer registration, login, and applying for a loan. The registration use case allows a customer to register by entering personal details. The login use case authenticates existing customers. The apply for loan use case enables a logged in customer to select a loan type and amount. Diagrams and code are provided for each use case.

Uploaded by

TUSHAR CHAURE
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

NAME

ID

Software Analysis and Design

IT

Assignment 4

Loan Management System


LOAN MANAGEMENT SYSTEM

USE CASE DIAGRAM:


Following are the Use case Specifications and respective diagrams for each use
case:
1. Registration of Customer
Use case Specifications:
1.1. Description :- Register to the System.
1.2. Actor :- Customer.
1.3. Precondition :- None.
1.4. Basic Flow Of Event :-

Actor System
[Link] on register button

2. Display Registration Screen

[Link] name,address,salary,KYC,

Phone no,email id,password.


[Link] data in database.
[Link] data in database.
[Link] to Home page.

[Link] Flow Of Event :

Actor System

3.1 Invalid Data Entry 3.1.1 Error message takes it back to


Step 3.
4.1 Email Address Exist 4.1.1 Error message user already exist
and exit.

[Link] Condition :- Account Created.


[Link] Cases :- Response Time is Less than 2s.

[Link] of Usage :- High Frequency and hence thoroughly tested and


implemented.

Activity Diagram:
Sequence Diagram:

State Machine Diagram:


Class Diagram:

Code :
1. Entity
import [Link];
import [Link]; // Import the Scanner class

public class EntityRegistration{

public ArrayList<String> u = new ArrayList<String>();


public ArrayList<String> p = new ArrayList<String>();
public ArrayList<String> e = new ArrayList<String>();
// private String uname, pass, email;

public void store (String uName, String Pass, String Email)


{
[Link](uName);
[Link](Pass);
[Link](Email);

}
2. Interface
import [Link]; // Import the Scanner class

public class RegistrationInterface{


private String uname;
private String pass;
private String email;

public void getDetails(){


Scanner myObj = new Scanner([Link]); // Create a Scanner
object
[Link]("Enter User Name");
[Link]= [Link](); // Read user input
[Link]("Enter Email");
[Link]=[Link](); // Read user input
[Link]("Enter Password");
[Link]=[Link](); // Read user input

}
public String getUname(){
return [Link];
}
public String getEmail(){
return [Link];
}
public String getPass(){
return [Link];
}
public void displayMessage()
{
[Link]("Registered successfully");
}

3. Controller
public class RegistrationController{
EntityRegistration er;
RegistrationInterface ri;

public void setEntityRegistration( EntityRegistration entityRegistration){


[Link]=entityRegistration;
}
public void setRegistrationInterface(RegistrationInterface
registrationInterface){
[Link]=registrationInterface;
}

public boolean authenticate(String u,String e)


{
return !([Link](u)||[Link](e));
}
}

4. System
public class RegistrationSystem{
public static void main(String[] args){
RegistrationInterface ri = new RegistrationInterface();
RegistrationController rc = new RegistrationController();
EntityRegistration er = new EntityRegistration();

[Link](er);
[Link](ri);

[Link]();
boolean result= [Link]([Link](),[Link]());

if (result)
{[Link]([Link](), [Link](),[Link]());

[Link]();
}
else [Link]("User exists");
}

2. Login
Use case Specifications:

2.1. Description : This use case let’s the user log into the their account.

2.2. Actor : User

2.3. Pre Condition : Internet Connection should be available and the


user must have registered before.
2.4. Basic Flow of Execution:

ACTOR SYSTEM

[Link] clicks on the Login


button

[Link] displays Login


screen to actor.

[Link] enters username and


password and clicks ‘OK’

[Link] searches given


username in database and
retrieve actor’s password.

[Link] compares the


password and authenticates
the actor.

[Link] displays ‘Login


Successful’ message and
navigate to actor’s page.

2.5. Alternate Flow of Execution:

ACTOR SYSTEM

3.1 Actor enters invalid 3.1.1 System shows error


username/password. and redirects to step 3 in the
basic flow (Three times and
exits use case
4.1 Username not available
in database.

4.1.1 System displays error


‘Invalid User’ ,exits use
case.

5.1 Invalid Password 5.1.1 System displays error


‘Invalid Password’ and
redirect to step 3 and exits
the usecase.

2.6. Post Condition : User gets logged into the system if the entered
credentials were correct

2.7. Special Specifications :

- Response Time : Should not be less than 3 seconds.

- Throughput : Concurrent 100 transactions required.

2.8. Other Specifications :

-Frequency Of Usage is high so the component needs to be developed


properly and tested with 100% accuracy.

- Complexity : Medium.

Activity Diagram:
Sequence Diagram:
State Machine Diagram:

Class Diagram:
Code :
[Link]
import [Link]; // Import the Scanner class

public class EntityLogin{


public String getUserDetails(String uName){
if ([Link]("Mahesh"))
return "Mahesh123";
else
return "pass";
}
public static void main(String[] args){
EntityLogin el = new EntityLogin();
Scanner myObj = new Scanner([Link]); // Create a Scanner object
[Link]("Enter User Name");
String uname= [Link](); // Read user input

[Link]("User Password: "+ [Link](uname));


}
}

[Link]
//package [Link];

import [Link]; // Import the Scanner class

public class LoginInterface{


private String uname;
private String pass;

public void readForm(){


Scanner myObj = new Scanner([Link]); // Create a Scanner object
[Link]("Enter User Name");
[Link]= [Link](); // Read user input
[Link]("Enter Password");
[Link]=[Link](); // Read user input

}
public String getUname(){
return [Link];
}
public String getPass(){
return [Link];
}

public static void main(String[] args){


LoginInterface li = new LoginInterface();
[Link]();
[Link]("User Name: "+ [Link]());
[Link]("Password: "+ [Link]());
}
}

[Link]
public class LoginController{
EntityLogin el;
LoginInterface li;

public boolean authenticateUser(String password, String pass ){


if ([Link](pass))
return true;
else
return false;
}

public void setEntityLogin( EntityLogin entityLogin){


[Link]=entityLogin;
}
public void setLoginInterface(LoginInterface loginInterface){
[Link]=loginInterface;
}

[Link]
class LoginSystem{
public static void main(String[] args){
LoginInterface li = new LoginInterface();
LoginController lc = new LoginController();
EntityLogin el = new EntityLogin();

[Link](el);
[Link](li);

[Link]();
boolean result = [Link]([Link](),
[Link]([Link]()));

if (result)
[Link]("Login Succcessful !!!! ");
else
[Link]("Login Failed.......");
}
}

[Link] for Loan


Use case Specifications:

3.1 Description – Actor can apply for loan.

3.2 Actors – Customer

3.3 Pre-Condition – Customer must be successfully logged into the system.


3.4 Basic Flow of interaction–

Actor System

1 Actor will click on apply for


loan

2 System displays apply for loan page


and requests type of loan

3 Selects type of loan. Clicks


next.

4 Processes input and requests amount


of loan

5 Inputs amount. Clicks next.

6 Processes input and displays the


various repayment schedule options

7 Selects feasible repayment


schedule and clicks next

8 Processes input and displays all


entered details and request user/
actor for confirmation

9 Clicks on confirm button

System displays confirmation


message “Applied for loan”
3.5 Alternate or Exceptional flow –

Actor System

1 User clicks on edit button System redirects to step (2) basic


flow

3.6 Post-condition – Redirects to Upload documents

3.7 Special Conditions –

Response time must be less than 3 seconds.

Concurrent 100 processes can be performed

3.8 Other Specifications –

Frequency of usage: Moderate

Complexity: Easy

Activity Diagram:
Sequence Diagram:
State Machine Diagram : Not Applicable

Class Diagram:
Code:

[Link]
import [Link];
//import [Link]; // Import the Scanner class

public class EntityApplyLoan {


ArrayList<String> types= new ArrayList<String>();

//ctype: customer selected type, camt: customer selected amount,


crsc: cust. selected repayment schedule
ArrayList<String> ctype= new ArrayList<String>();
ArrayList<String> camt= new ArrayList<String>();
ArrayList<String> crsc= new ArrayList<String>();

public void addTypes()


{
[Link]("Home loan");
[Link]("Gold loan");
[Link]("Personal loan");
[Link]("Business loan");
[Link]("Education loan");
[Link]("Vehicle loan");
}

public void storedetails(String type, String amt, String repaysch)


{
[Link](type);
[Link](amt);
[Link](repaysch);
}

public String getUserDetails(String confirm){


if ([Link]("yes"))
return "success";
else
return "enter options again";
}
}

[Link]
import [Link]; // Import the Scanner class

public class AFLInterface {


private String type;
private String amt;
private String repaysch;
private String confirm;

public void readForm(){


Scanner myObj = new Scanner([Link]); // Create a Scanner object

//[Link](types);

[Link]("Enter Type of Loan");


[Link]=[Link]();

[Link]("Enter Amount of Loan");


[Link]=[Link]();

[Link]("Enter Repayment Schedule of Loan");


[Link]=[Link]();

[Link]("Do you want to confirm the loan? please write


yes/no");
[Link]=[Link]();

}
public String getType(){
return [Link];
}
public String getAmt(){
return [Link];
}
public String getRepaySch(){
return [Link];
}
public String getConf(){
return [Link];
}

public static void main(String[] args){


AFLInterface ai = new AFLInterface();
[Link]();
[Link]("Type of Loan: "+ [Link]());
[Link]("Amount of Loan: "+ [Link]());
[Link]("Repayment schedule of Loan: "+
[Link]());
}
}

[Link]
public class AFLController {
EntityApplyLoan ea;
AFLInterface ai;

public void setEntityLogin( EntityApplyLoan entityApplyLoan){


[Link]=entityApplyLoan;
}
public void setLoginInterface(AFLInterface applyInterface){
[Link]=applyInterface;
}

[Link]
public class ApplyLoanSystem {

public static void main(String[] args){


AFLInterface ai = new AFLInterface();
AFLController ac = new AFLController();
EntityApplyLoan ea = new EntityApplyLoan();

[Link](ea);
[Link](ai);
[Link]();
[Link]([Link]);
[Link]();

String result = [Link]([Link]());


[Link]([Link](), [Link](), [Link]());

[Link](result);
}
}

6. Calculate EMI

Use case Specifications:

6.1 Description – For calculation of EMI according to loan type and period
6.2 Actors – Customer
6.3 Pre-Condition – Customer must be logged in
6.4 Basic Flow of interaction–
Actor System
1 Clicks on calculate EMI

2 Generates input screen for loan type


and period

3 User inputs loan type and period

4 Checks validity of input

5 Fetches interest rates from database

6 Calculates EMI

7 Displays calculated EMI

6.5 Alternate or Exceptional flow –

Actor System

3.1 User inputs invalid loan Display invalid loan type or period, redirect
type or period to point 3 in basic flow

6.6 Post-condition – Redirects to apply for loan

6.7 Special Conditions –


Response time must be less than 2 seconds.

6.8 Other Specifications –


Frequency of usage: Moderate
Complexity: Easy

Activity Diagram:
Sequence Diagram:
State Machine Diagram: Not Applicable

Class Diagram:
Code :-
[Link]
import [Link]; // Import the Scanner class

public class CalculateEMIEntity {


private String type;
private int period;

public String getType() {


return type;
}

public void setType(String type) {


[Link] = type;
}

public int getPeriod() {


return period;
}

public void setPeriod(int period) {


[Link] = period;
}

public float getInterestRate() {


if ([Link]().equalsIgnoreCase("personal")) {
return (float) 7.5;
} else if ([Link]("home")) {
return (float) 8;
} else {
return (float) 7.75;
}
}

public static void main(String[] args) {


CalculateEMIEntity ce = new CalculateEMIEntity();
[Link]("personal");
[Link](24);
[Link]("Loan details: ");
[Link]("Loan type: " + [Link]());
[Link]("Loan period: " + [Link]([Link]()));
[Link]("Loan interest rate: " +
[Link]([Link]()));
}
}

[Link]
import [Link]; // Import the Scanner class

public class CalculateEMIInterface {


private Scanner sc;

CalculateEMIInterface() {
sc = new Scanner([Link]); // Create a Scanner object
}

void takeInput(CalculateEMIEntity loanDetails) {


[Link]("Enter loan type: ");
[Link]([Link]());
[Link]("Enter loan period (in months): ");
[Link]([Link]());
}

void showInvalid() {
[Link]("Invalid loan details provided");
}

float takeAmountInput() {
[Link]("Enter amount: ");
return [Link]();
}
void displayEMI(float emi) {
[Link]("Monthly EMI: " + [Link](emi));
}

public static void main(String[] args) {


CalculateEMIInterface ci = new CalculateEMIInterface();
CalculateEMIEntity loanDetails = new CalculateEMIEntity();
[Link](loanDetails);
[Link]("Loan Type: " + [Link]());
[Link]("Loan Period: " + [Link]());

float amount = [Link]();


[Link]("Amount: " + [Link](amount));
}
}

3. Controller
public class CalculateEMIController {
boolean validate(String type, int period) {
if (period < 6 || period > 36) {
return false;
}
if ([Link]() == "mobile") {
return false;
}
return true;
}

float fetchInterest(CalculateEMIEntity loanDetails) {


return [Link]();
}

float calculateEMI(CalculateEMIEntity loanDetails, float amount) {


float interestRate = fetchInterest(loanDetails);
int period = [Link]();
return (float) (amount * (100.0 + interestRate)) / ((float) period * 100);
}
}

4. System
class CalculateEMISystem{
public static void main(String[] args){
CalculateEMIInterface ci = new CalculateEMIInterface();
CalculateEMIController cc = new CalculateEMIController();
CalculateEMIEntity loanDetails = new CalculateEMIEntity();

[Link](loanDetails);
boolean valid = [Link]([Link](),
[Link]());

if(!valid) {
[Link]();
} else {
float amount = [Link]();
float emi = [Link](loanDetails, amount);
[Link](emi);
}
}
}

7. EMI PAYMENT
Use case Specifications:

7.1 Description – For paying monthly EMI of loan taken by ECS mode or by
depositing a post-dated cheque.

7.2 Actors – Customer


7.3 Pre-Condition – EMI should already have been calculated and customer
should be logged in.

7.4 Basic Flow of interaction–

Actor System

1 User clicks on EMI payment


button.
2 Displays payment due(EMI + penalty,
if any) and input screen for selecting
between “ECS mode” and “post-dated
cheque”
3 User chooses the type of mode.

4 System navigates user to another


website.
5 User clicks on pay EMI button.

6 Displays message: Payment done


successfully.

7.5 Alternate or Exceptional flow –


Actor System

4.1 Poor network Display poor connectivity, redirect to point 2


connectivity during in Basic Flow
payment
5.1 EMI Payment is not done System calculates penalty and displays
within 15 days. message: Pay EMI and penalty within next 10
days

7.6 Post-condition – Payment done is recorded.

7.7 Special Conditions – If by doing the EMI payment, the complete loan is paid
off, close the loan account and give back the mortgage documents.

7.8 Other Specifications –


Frequency of usage: High
Complexity: Hard as payment completion is a difficult process.

Activity Diagram:
Sequence Diagram:
State Machine Diagram : Not Applicable

Class Diagram:
Code :-

1. Entity
import [Link];

public class EntityBank{


public boolean validatePayment(double amount){
[Link]("Amount of Rs. "+amount+" received by the
bank.");
return true;
}
public static void main(String[] args){
EntityBank eb = new EntityBank();
Scanner obj = new Scanner([Link]);
[Link]("Enter amount to be paid.");
double amount = [Link]();
[Link]("Amount of Rs. "+amount+"is being paid");
}
}

2. Interface
import [Link];

public class PaymentInterface{


private double amount;
public int paymentMode;
public int timeLeft;

public boolean readForm(){


Scanner obj = new Scanner([Link]);
[Link]("Enter EMI Payment amount to be repaid");
[Link] = [Link]();
[Link]();
[Link]("Enter Payment Mode\n 1. ECS\n 2. Cheque");
[Link] = [Link]();
if ([Link] != 1 && [Link] != 2){
[Link]("Invalid Payment Mode");
return false;
}
[Link]();
[Link]("Enter time left (in days) to make your
payment(negative if payment due date is passed)");
[Link] = [Link]();
return true;
}

public double getAmount(){


return [Link];
}
public int getPaymentMode(){
return [Link];
}
public int getTimeLeft(){
return [Link];
}

public static void main(String[] args){


PaymentInterface pi = new PaymentInterface();
[Link]();
[Link]("Amount being paid: "+[Link]());

switch([Link]()){
case 1:
[Link]("Payment Mode: ECS ");

break;
case 2:
[Link]("Payment Mode: Cheque");
break;
default:
[Link]("Payment Mode: INVALID");
}
[Link]("Time left to make Payment:
"+[Link]());

}
}

3. Controller
public class PaymentController{
EntityBank eb;
PaymentInterface pi;

public boolean makePayment(double amount, int paymentMode, int


timeLeft, boolean validatePayment){
if(timeLeft < 0){
if (timeLeft > -15){
[Link]("The payment is late (within 15 days), be sure
to pay the EMI due WITH the PENALTY within the next 10 days
otherwise payment through portal will not be done and will have to
contact the bank.");
}
else{
[Link]("Payment cannot be done because it has been
15 days since due EMI Payment Date");
return false;
}
}
else{
switch(paymentMode){
case 1:
[Link]("Payment is on-time and was done by ECS
mode.");
break;
case 2:
[Link]("Payment is on-time and was done by
Cheque.");
break;
}
}

if (validatePayment == true)
return true;
else
return false;
}

public void setEntityBank(EntityBank entityBank){


[Link] = entityBank;
}
public void setPaymentInterface(PaymentInterface
paymentInterface){
[Link] = paymentInterface;
}
}

4. System
class EMIPayment{
public static void main(String[] args){
PaymentInterface pi = new PaymentInterface();
PaymentController pc = new PaymentController();
EntityBank eb = new EntityBank();

[Link](eb);
[Link](pi);

boolean result;
if ([Link]()){

result = [Link]([Link](),
[Link](), [Link],
[Link]([Link]()) );
}
else {
result = false;
}

if (result)
[Link]("EMI Payment Successful !!!");
else
[Link]("Payment Failed ........");

}
}

8. CUSTOMER REPORT

Use case Specifications:

8.1 Description: This use case helps the user to download and view customer
reports

8.2 Actors: Customer

8.3 Pre- Conditions: The user must be logged into the system and there
should be an active internet connection.
8.4 Basic flow of Interactions:

Actor System
[Link] clicks on the “Get Reports”
button.
[Link] displays a list of all the possible
reports that can be generated
A. Payment report
B. Income Tax Report
[Link] clicks on the desired option.
[Link] generates the report and
displays it on the screen with a
“Download” button.
[Link] clicks on the “Download”
button.
[Link] opens the file manager and asks
for the location.
[Link] selects the location and clicks
on the “OK” button.
[Link] downloads the file on the
computer and displays the home page.

8.5 Alternate flow of interactions:

Actor System
5.1. User clicks on the “Back” button. 5.1.1. Join step 2 in basic flow.
4.1. Database connectivity is lost
4.1.1 System will display message
“Database error occurred”.
4.1.2. System exits the use-case
8.1. Internet connectivity is lost
8.1.1 System will display message
“Internet connectivity lost”.
8.1.2. Join step 4 in basic flow
8.2. There is insufficient storage.
8.2.1 System will display message
“Insufficient storage”.
8.2.2. Join step 4 in basic flow

8.6 Post Conditions: The user has successfully downloaded or viewed


reports

8.7 Special Conditions:


1. The system should respond to the user within 2 seconds of the request.
2. At the same time 100 users can access the use case simultaneously.

8.8 Other Specifications:


● Frequency: Moderate
● Complexity: Simple
Activity Diagram:
Sequence Diagram:

State Machine Diagram:


Class Diagram:
Codes:-

[Link]

import [Link].*;

import [Link].*;

class CustomerReports_Interface{

private String email;

private int loan_id;

private CustomerReports_Controller crc;

CustomerReports_Interface(){

crc = new CustomerReports_Controller();

public void getDetails() throws IOException{

BufferedReader br = new BufferedReader(new InputStreamReader([Link]));

[Link]("Enter your email: ");

email = [Link]();

Entity_User.addDummy();

Entity_User user= new Entity_User();


HashMap m=[Link]();

if(![Link](email)){

[Link]("You are not registered! ");

return;

User u=(User)[Link](email);

ArrayList<Integer> temp=[Link]();

[Link]("Following are your loan details: ");

for(int id: temp){

[Link]("ID: "+id);

[Link]("Enter loan id: ");

loan_id = [Link]([Link]());

[Link](loan_id);

}}

[Link]

import [Link].*;
import [Link].*;

import [Link];

class CustomerReports_Controller{

public void getReports(int loan_id){

ArrayList<PaymentDetails> list =
Entity_PaymentDetails.retrievePayments(loan_id);

SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy


HH:mm:ss");

for(PaymentDetails pd : list){

[Link]("Date : " + [Link]([Link]()));

[Link]("Amount : " + [Link]());

[Link]("Payment type : " + [Link]());

[Link]("---------------------------");

[Link]

import [Link].*;

import [Link].*;
import [Link];

class Entity_PaymentDetails{

private static HashSet<PaymentDetails> set = new HashSet<>();

public static void addPayment(PaymentDetails pd){

[Link](pd);

public static ArrayList<PaymentDetails> retrievePayments(int loan_id){

addDummyDetails();

ArrayList<PaymentDetails> list = new ArrayList<>();

for(PaymentDetails p : set){

if([Link]()==loan_id){

[Link](p);

return list;

public static void addDummyDetails(){


Date date = new Date();

PaymentDetails pdobj = new PaymentDetails(date ,(long)100,"emi",1);

PaymentDetails pdobj1 = new PaymentDetails(date,(long)200,"emi",1);

PaymentDetails pdobj2 = new PaymentDetails(date,(long)300,"emi",1);

addPayment(pdobj);

addPayment(pdobj1);

addPayment(pdobj2);

[Link]

import [Link].*;

import [Link].*;

class CustomerReports_System{

public static void main(String[] args) throws IOException{

CustomerReports_Interface cri = new CustomerReports_Interface();

[Link]();

}
}
9. Part Payment of Loan

Use case Specifications:

9.1 Use-Case Description:


The use case is used for part payment of the applicant’s loan.

9.2 Actors:
Applicant

9.3 Pre-condition
1. The loan should be approved.
2. The user must be logged in.
3. User must have an unpaid loan.

9.4 Basic Flow of Interaction:

Actor System
[Link] on Part Payment
option.

[Link] Part Payment page.


3. Selects amount to be
paid
[Link] if applicant has sufficient bank balance
to pay given amount.

[Link] transaction is successfully carried out.


[Link] success message along with
outstanding loan amount.

7. Click on ‘Done’ button

9.5 Alternative or Exception Flow of Interaction:

4.1 User does not have sufficient balance to pay the amount:
4.1.1 Display Insufficient Balance message, go back to previous screen.
4.2 Amount selected is greater than the outstanding loan amount:
4.2.1 Display Amount Invalid message and go back to previous screen.
5.1 Transaction failure:
5.1.2 Display Transaction Failed message and go back to previous
screen.

9.6 Post Condition


1. System displays message of success or failure
2. Applicant selects between reducing EMI amount or reducing repayment
period.

9.7 Special Conditions:


1. The response time should be less than 10sec.
2. The transactions should be concurrent

9.8 Other Specification:


Complexity-Low
Frequency-Moderate
Activity Diagram:
Sequence Diagram:
State Machine Diagram:
Class Diagram:

Codes:

1. Entity
import [Link]; // Import the Scanner class

public class EntityPartPay{


public String getUserDetails(String uName){
if ([Link]("Mahesh"))
return "Mahesh123";
else
return "pass";
}
public static void main(String[] args){
EntityPartPay epp = new EntityPartPay();
Scanner myObj = new Scanner([Link]); // Create a Scanner object
[Link]("Enter User Name");
String uname= [Link](); // Read user input

[Link]("User Password: "+ [Link](uname));


}
}

[Link]

public class PartPayController{


EntityPartPay epp;
PartPayInterface ppi;

public boolean authenticatePayment(double amount, double out_amt,


double balance){
if(balance-amount <= 5000)
return false;
else if(amount > out_amt)
return false;
else
return true;
}
public void setEntityPartPay( EntityPartPay entityPartPay){
[Link] = entityPartPay;
}
public void setPartPayInterface(PartPayInterface partPayInterface){
[Link]=partPayInterface;
}
}

[Link]

public class PartPayController{


EntityPartPay epp;
PartPayInterface ppi;

public boolean authenticatePayment(double amount, double out_amt,


double balance){
if(balance-amount <= 5000)
return false;
else if(amount > out_amt)
return false;
else
return true;
}

public void setEntityPartPay( EntityPartPay entityPartPay){


[Link] = entityPartPay;
}
public void setPartPayInterface(PartPayInterface partPayInterface){
[Link]=partPayInterface;
}
}

[Link]
public class PartPayController{
EntityPartPay epp;
PartPayInterface ppi;

public boolean authenticatePayment(double amount, double out_amt,


double balance){
if(balance-amount <= 5000)
return false;
else if(amount > out_amt)
return false;
else
return true;
}

public void setEntityPartPay( EntityPartPay entityPartPay){


[Link] = entityPartPay;
}
public void setPartPayInterface(PartPayInterface partPayInterface){
[Link]=partPayInterface;
}
}

10. Disburse Loan

Use case Specifications:

10.1 Use-Case Description:The use case is used to disburse loan to loan


applicant’s account

10.2 Actors:Bank Officer

10.3 Pre-condition:The loan should be approved

10.4 Basic Flow of Interaction:


Bank Officer System

[Link] on Disburse Loan [Link] Loan Id page

[Link] Loan Id [Link] details of


applicant and loan

[Link] on Proceed Loan [Link] money to


loan applicant’s account

10.5 Alternative or Exception Flow of Interaction:

Bank Officer System

[Link] on Cancel Payment button [Link] process is


cancelled and is
redirected to loan ID
page

10.6 Post Condition:System displays message of success or failure

10.7 Special Conditions:The response time should be less than 10sec.

10.8 Other Specification:

Complexity-Low

Frequency-Moderate
Activity Diagram:

Sequence Diagram:
State Machine Diagram:
Class Diagram:

Codes:

1. Entity
import [Link];
public class LoanDetailsEntity
{
//hashmap as mapping between loadID and status (loan details)
// true if loan is checked and sanctioned
HashMap<Integer,Boolean> loanDetails ;

LoanDetailsEntity()
{
loanDetails = new HashMap<Integer,Boolean>()
{
{
put(1,true);
put(2,false);
put(3,true);
put(4,true);
put(5,true);
}
};
}
//get loan details
private void getDataFromDB()
{
//code for getting data from the database
//into the hashmap

2. Interface

import [Link];

public class DisburseLoanInterface


{
public void print(String val)
{
[Link](val);
}
public int inputLoanID()
{
Scanner sc = new Scanner([Link]);
int inp = [Link]();
return inp;
}
public char inputOption()
{
Scanner sc = new Scanner([Link]);
String val = [Link]();
return [Link](0);
}
public boolean getDetails(int loadID)
{
DisburseLoanController controller = new DisburseLoanController();
return [Link](loadID);
}

3. Controller

import [Link];
public class DisburseLoanController
{
// private int loanID;
public boolean getLoanDetails(int loanID)
{
LoanDetailsEntity entity = new LoanDetailsEntity();
HashMap<Integer,Boolean> map = [Link];
if([Link](loanID))
return [Link](loanID);
else
return false;
}
public String displayLoanDetails(int loanID,boolean loanDetails)
{
if(loanDetails)
return "Loan for ID :"+loanID+" has been sanctioned\n";
else
return "Loan for ID :"+loanID+" is not sanctioned\n";
}
public boolean transferMoney(int loadID)
{
boolean response = false;
[Link]("Loan amount for ID "+loadID+" is transferred");
response= true;
//bank amount transfer code
// bank api connection
return response;
}
}

4. System

class DisburseLoanSystem
{
// static int loanID;
public static void main(String[] args)
{
DisburseLoanInterface interface_ = new DisburseLoanInterface();
DisburseLoanController controller = new DisburseLoanController();

interface_.print("Enter Loan ID : ");


int loanID = interface_.inputLoanID();
boolean response = interface_.getDetails(loanID);

if(response)
{
interface_.print([Link](loanID,response));
interface_.print("Do you want to proceed [Y/N] : ");
if(interface_.inputOption()== 'Y' )
{
boolean status = [Link](loanID);
interface_.print( status?"\nStatus from Bank:successful":"\nStatus
from Bank:failed" );
}
else interface_.print("\nLoan amount is not transferred");
}
else [Link]([Link](loanID,response));
}
}
11. Close Loan

Use case Specifications:


11.1 Description – It is used for closing an Open Loan.

11. 2 Actors – Admin

11.3 Pre-Condition – The admin should be logged in to the system.

11.4 Basic Flow of Interaction–


Actor System
1. Actor clicks on Close Loan 2. System displays the user details
button. form.
3. Actor enters the user details and 4.1 System checks the details.
clicks on Check details.
4.2 System checks if all EMIs are
paid.
4.3 System closes the loan.

11.5 Alternate or Exceptional Flow –


Actor System

Invalid user. System redirects to the user login


page.
Improper user details entered. System redirects to the user details
page.
All EMIs are not paid. System prints this message and
redirects to the homepage.

11.6 Post-Condition – The loan is closed and the homepage is displayed to the
actor.

11.7 Special Conditions – The response time for the System to check details and
EMI should not exceed 3 minutes.

11.8 Other Specifications – The loan holder (user) should contact the admin for
closing the loan. Without the intervention of the admin, an user cannot close
his/her loan.
Activity Diagram:

Sequence Diagram:
State Machine Diagram:

Class Diagram:
Codes:

1. Entity
import [Link];
public class CloseLoanEntity {

public boolean verifyUserDetails(String userName, String accountID){

if ([Link]("Mahesh") && [Link]("ABC442211"))


{
return true;
}

else {
return false;
}

public static void main(String args[]) {

CloseLoanEntity cle = new CloseLoanEntity();


Scanner scanner = new Scanner([Link]);

[Link]("Enter User Name");


String userName= [Link]();

[Link]("Enter Account ID");


String accountID = [Link]();

if (verifyUserDetails(userName, accountID)) {

if (paidEMI) {
[Link]("Loan can be now closed as per wish");
}

else {
[Link]("EMIs have not been paid.");
}
}

else {

[Link]("Wrong details entered, please try again!");

2. Interface
import [Link];

public class CloseLoanEntity {

public boolean verifyUserDetails(String userName, String accountID){

if ([Link]("Mahesh") && [Link]("ABC442211"))


{
return true;
}

else {
return false;
}

public static void main(String args[]) {

CloseLoanEntity cle = new CloseLoanEntity();


Scanner scanner = new Scanner([Link]);
[Link]("Enter User Name");
String userName= [Link]();

[Link]("Enter Account ID");


String accountID = [Link]();

if (verifyUserDetails(userName, accountID)) {

if (paidEMI) {
[Link]("Loan can be now closed as per wish");
}

else {
[Link]("EMIs have not been paid.");
}

else {

[Link]("Wrong details entered, please try again!");

3. Controller
public class CloseLoanController {

CloseLoanEntity cle;
CloseLoanInterface cli;
public void setCloseLoanEntity( CloseLoanEntity closeLoanEntity) {
[Link] = closeLoanEntity;
}

public void setCloseLoanInterface(CloseLoanInterface


closeLoanInterface) {
[Link] = closeLoanInterface;
}

public boolean verifyEMIpaid(CloseLoanInterface cli) {


return [Link];
}
}
4. System
class CloseLoanSystem {
public static void main(String args[]) {

CloseLoanInterface cli = new CloseLoanInterface();


CloseLoanController clc = new CloseLoanController();
CloseLoanEntity cle = new CloseLoanEntity();

[Link](cle);
[Link](cli);

[Link]();
boolean result = [Link](cli);

if (result == true) {
[Link]("Loan has been closed!!");
}
else {
[Link]("Failed to Close Loan");
}
}
}
12. Change Interest Rate
Use case Specifications:

12.1. Use Case Description :


The interest rate on our loan can change due to some regulatory
changes in government policy or bank policy. Then, the bank can use this
option to change interest rate. The bank employee will enter the new interest
rate, if that interest rate is valid, then it will be updated in the database and
displayed to user. Otherwise, the error message will be displayed.

12.2 Actor : Bank employee.

12.3 Pre-Condition:
The employee of bank should be logged in and should have proper
internet connection.

12.4 Basic Flow of Interaction

Actor System
1) The user clicks on change interest
rate button ( CIR button ) .
2) System will display the Change
interest rate screen.
3) The user will enter new interest rate
and clicks on the submit button.
4) System validates the new interest rate
given by the user. If the new interest rate
is valid, then it is stored in the database.
5) System will display the new updated
interest rate to the user.

12.5 Alternate Flow of Condition:

Actor System
1) The user enters invalid new interest
rate in the change interest rate column or
leaves that column empty.
2) System redirects the user to step 4.3
of the basic flow.
1) Database connectivity is lost.
1.1)System will display message
“Database error occurred.”
1.2)System redirects to step 4.3 of basic
flow.
1) Internet connectivity is lost.
1.1) System will display message
“internet connectivity is lost.
1.2) System redirects to step 4.3 of basic
flow.

12.6 Post-Condition:
The user has successfully changed the interest rate.

12.7 Special Condition :


Number of concurrent users : Only single user must access the use case at
that time.

12.8 Others Specification: none.

Activity Diagram:
Sequence Diagram:

State Machine Diagram:

Class Diagram:
Codes:

[Link]

import [Link]; // Import the Scanner class

public class EntityCIR{

int CurrentIR;
int newIR;
public boolean StorenewIR(int NewIR){
if (NewIR)
{ currentIR = newIR;
return true;
}
else
return false;
}

public static void main(String[] args){


EntityCIR ec = new EntityCIR();
Scanner myObj = new Scanner([Link]); // Create a Scanner object
[Link]("Enter New Interest rate to be updated");
int newIR = [Link](); // Read user input

if([Link])
[Link]("New Interst rate has been Updated
Sucessfully");
else
[Link]("error in updating interest rate");

}
}

[Link]

public class CirController{


EntityCIR ec;
CirInterface ci;

public void DisplayCurrentIR( int currentIR ){

[Link]("The Current Interest Rate is:" : currentIR);


}
public boolean validateIR(int newIR)
{
if(newIR>100)
return false;
else
return true;
}

public void setEntityCIR( EntityCIR entityCIR){


[Link]=entityCIR;
}
public void setCIRInterface(CirInterface cirInterface){
[Link]=cirInterface;
}

[Link]

public class CirController{


EntityCIR ec;
CirInterface ci;

public void DisplayCurrentIR( int currentIR ){

[Link]("The Current Interest Rate is:" : currentIR);

}
public boolean validateIR(int newIR)
{
if(newIR>100)
return false;
else
return true;
}

public void setEntityCIR( EntityCIR entityCIR){


[Link]=entityCIR;
}
public void setCIRInterface(CirInterface cirInterface){
[Link]=cirInterface;
}

[Link]

class CirSystem{
public static void main(String[] args){
CirInterface ci = new CirInterface();
CirController cc = new CirController();
EntityCIR ec = new EntityCir();

[Link](ec);
[Link](ci);

[Link]();
[Link]();
boolean result = [Link]([Link]());

if (result)
[Link]("Change of interest rate successful !!!! ");
else
[Link]("Change of interest rate failed .......");
}
}
PACKAGING AND LAYERING DIAGRAM:

You might also like