1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
|
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Calcul
{
float totaldue=0;
int temps=0;
boolean som=false;
String riendanssommdemande;
float taux=0,totalannee=0, tempstaux=0,moi=0;
int emprunt=0;
float sommprelev=0;
public float pret(boolean som,String riendanssommdemande, float taux, float totalannee, float tempstaux, float moi, int emprunt, float totaldue, int temps)
{
riendanssommdemande = Integer.toString(emprunt);
if(som==true)
{
if(riendanssommdemande.equals("")||taux ==0)
{
JOptionPane.showMessageDialog(null,"Formulaire incomplet");
}
else
{
moi=(int)(emprunt*taux/100) + (int)emprunt;
totalannee=moi*12;
tempstaux=taux/100;
return totaldue=temps*totalannee+tempstaux;
}
}
return totaldue;
}
public float affichetable(float sommprelev, float moi, float totaldue, int temps )
{
sommprelev=totaldue/temps;
return sommprelev;
}
public void main(String[] args)
{
pret( som, riendanssommdemande, taux, totalannee, tempstaux, moi, emprunt, totaldue, temps);
affichetable(sommprelev, moi, totaldue, temps);
}
} |
Partager