UNA HERMOSA MOTO

UNA HERMOSA MOTO

miércoles, 22 de abril de 2015

Problema Resuelto 20



20.-DETERMINAR DESCUENTO, IMPUESTO Y EL IMPORTE A PAGAR SEGÚN DETALLE:

CONSUMO (S/.)
DESCUENTO (%)
HASTA 100
MAYOR A 100
MAYOR A 200
10
20
30


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package problema020;
import java.io.*;
/**
 *
 * @author abel montalvan
 */
public class Problema020 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args)throws IOException{ 
        final float D1 = 0.1F;
        final float D2 = 0.2F;
        final float D3 = 0.3F;
        final float IGV = 0.18F;
        
        float c, m_d, m_igv, p;
 BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Consumo: ");
 c=(float)Integer.parseInt(in.readLine());
 if(c>200)
 {
     m_d=c*D3;
 }
 else
 {
     if(c>100)
     {
     m_d=c*D2;
     }
     else
     {
       m_d=c*D1;
     }
 }
 m_igv=(c-m_d) * IGV;
 p=c-m_d+m_igv;
 System.out.println("");
 System.out.println("Monto descuento: " + m_d);
 System.out.println("Impuesto IGV: " + m_igv);
 System.out.println("Importe a pagar: " + p);
 System.out.println();
    }
}

No hay comentarios:

Publicar un comentario