UNA HERMOSA MOTO

UNA HERMOSA MOTO

miércoles, 22 de abril de 2015

Problema Resuelto 19



19.- UN RESTAURANTE OFRECE UN DSCTO. DEL 10% PARA CONSUMOS DE HASTA S/.100.00 Y UN DSCTO. DE 20% PARA CONSUMOS MAYORES, PARA AMBOS CASOS SE APLICA UN IMPUESTO DEL 18%.DETERMINAR EL MONTO DEL DSCTO. EL IMPUESTO Y EL IMPORTE A PAGAR.

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

    /**
     * @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 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<=100)
 {
 m_d=c * D1;
 }
 else
 {
 m_d=c * D2;
 }
 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