viernes, 13 de julio de 2012

Grupo 4 -ejercicio 14


package Grupo_4;
import java.io.*;
//Poner el nombre de tu clase en "EJEM_16" o crea una clase con este nombre
public class EJEM_16 {
   
    public static void main(String[] args)throws Exception{
       
        BufferedReader lee = new BufferedReader(new InputStreamReader(System.in));
        double cuotaInicial,cuotaMensual,costoCasa,ingreso;
        cuotaMensual = 0;
        cuotaInicial = 0;
       
        System.out.println("INGRESE :COSTO DE LA CASA");
        costoCasa = Double.parseDouble(lee.readLine());
       
        System.out.println("INGRESE : INGRESO MENSUAL");
        ingreso = Double.parseDouble(lee.readLine());

        if(ingreso<1250){
            cuotaInicial = (15*costoCasa)/100;
            cuotaInicial = Math.floor(cuotaInicial*100)/100;
            cuotaMensual = Math.floor(cuotaMensual*100)/100;
        }
        if(ingreso>=1250){
            cuotaInicial = (30*costoCasa)/100;
            cuotaInicial = Math.floor(cuotaInicial*100)/100;
            cuotaMensual = (costoCasa - cuotaInicial)/75;
            cuotaMensual = Math.floor(cuotaMensual*100)/100;
        }
        System.out.println("DEBE PAGAR UNA INICIAL DE : " + cuotaInicial);
        System.out.println("DEBE PAGAR UNA CUOTA MENSUAL DE : " + cuotaMensual);
       
    }
}