Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 7th, 2013, 02:38 AM
xsinx xsinx is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 1 xsinx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m
Reputation Power: 0
Loan java programming language student

Make a program that will compute the monthly payment of a particular loan
- make a class named loan
- declare attributes amount loaned , duration , interest , total loaned and monthly payment
- declare setter and getter methods for amount loaned and duration
- create overloading constructor
- 1st constructor is a default
Constructor that assign 10000 to amount loan and 5 months for duration
- 2nd constructor accept single value for amount and assign 5 months for duration
- 3rd constructor accept 2 values for amount loan and duration
- Declare method getInterest that accept value for duration and return the interest based on the ff condition

Duration Interest
5months – 6months 2%
7months – 9months 3%
10 months – 12 months 4%

- Create method getTotalloan that accept values for amount loaned , interest and duration and contain compilation (amount loan*interest)*term

Create method getMonthlyPayment that receives value of total loan and duration , and will return the quotient of total loan/duration.

Make a class named Costumer w/ contain the main method
- Ask the user to input value for amount and duration and pass it into the constructor
Compute the interest , total loan , and monthly payment using method in loan class


use JoptionPane

Out put

[1] 1st constructor
[2] 2nd constructor
[3] 3rd constructor

Enter choice:
Amount loan:
Duration:
Interest:
Total loan:
Monthly Payment:




thank you !


public class loan{
public int amtloan;
public int duration;
public int interest;
public int totalloan;
public int mpayment;

int duration1 = 5;
double interest1 = 0.02;
int duration2 = 7;
double interest2 = 0.03;
int duration3 = 10;
double interest3 = 0.04;
int a;
int b;
int c;
int d;
public int setamtloan(){
amtloan = a;
return amtloan;}

public int setduration(){
duration = b;
return duration;}

public int setinteresst(){
interest = c;
return interest;}

public int settotalloan(){
totalloan = a;
return totalloan;}

public int setmpayment(){
mpayment = d;
return mpayment;}

public int getamtloan(){
return amtloan;}

public int getduration(){
return duration;}

public int getinterest(){
return interest;}

public int gettotalloan(){
return totalloan;}

public int getmpayment(){
return (a*c)*b;}

public loan(double a,double b){
a = 10000;
b = 5;
public loan(double c,double d){
c = ;
d = 5;

}
}





import javax.swing.*;
public class costumer{
public static void main(String args[]){

int x = Integer.parseInt(JOptionPane.showInputDialog

if(x==1)
{
loan l = new loan(double a,double b);

l.setamtloan();
l.setduration();
l.setinterest();
l.settotalloan();
l.setmpayment();
l.getamtloan();
l.getduration();
l.getinterest();
l.gettotalloan();
l.getmpayment();
}
}
}

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > Loan java programming language student


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap