ACTION PERFORMED
Enviado por HERNAMONT • 22 de Marzo de 2015 • 749 Palabras (3 Páginas) • 224 Visitas
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
Double Vlrfuturo=0.0;
Double intereses=0.0;
final double MILLSECS_PER_DAY = 24 * 60 * 60 * 1000;
Calendar calendar = new GregorianCalendar(2012,2,25);
calendar.add(Calendar.YEAR,Integer.parseInt(NUMEROGIROS.getSelectedItem()+"")/2);
calendar.add(Calendar.MONTH,5);
java.sql.Date fecha = new java.sql.Date(calendar.getTimeInMillis());
int numero=Integer.parseInt(NUMEROGIROS.getSelectedItem()+"");
Calendar fechasiguiente = new GregorianCalendar(2012,2,25);
double capital=Double.parseDouble(MATRICULA.getText());
int paso=1;
for(int r=0;numero>r;r++)
{
java.sql.Date fechasigu = new java.sql.Date(fechasiguiente.getTimeInMillis());
Double diferencia = ( fecha.getTime()- fechasigu.getTime())/MILLSECS_PER_DAY;
intereses=intereses+capital*0.04*(Double.parseDouble((diferencia/365)+""));
if ((capital*0.04*(Double.parseDouble((diferencia/365)+"")))+capital>6233700.0)
{
observacion.setText("El pago del semestre supera el monto permitido");
}
Vlrfuturo=Vlrfuturo+capital;
if ((paso % 2)==0)
{
capital=capital+capital*0.05;
fechasiguiente.add(Calendar.MONTH,7);
}
else
{
fechasiguiente.add(Calendar.MONTH,5);
}
paso++;
}
Double interesesgr=0.0;
Double interesestotal=0.0;
Double amortizacion=0.0;
Double pagototal =0.0;
Vlrfuturo=Vlrfuturo+intereses;
double tasa= Double.parseDouble(CRECIMIENTO.getText());
double ntasa=0.0;
ntasa=Math.pow(1+tasa,1.0/12.0)-1;
double cuota= Vlrfuturo/((1-Math.pow(1+ntasa,-1*72.0))/ntasa);
String valcuota = cuota+"";
BigDecimal vcuota = new BigDecimal(valcuota );
vcuota= vcuota.setScale(2, RoundingMode.HALF_UP);
Vlrcuota.setText(vcuota+"");
for(int r=0 ; r<72; r++)
{
interesesgr=Vlrfuturo*ntasa;
interesestotal=interesestotal+interesesgr;
amortizacion=cuota-interesesgr;
Vlrfuturo=Vlrfuturo-amortizacion;
System.out.println(r);
...