Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class Producto {
- public static void main(String[]arg) {
- System.out.println("Programa Producto: ");
- String Nom = " ";
- double valor=0, desc=1 , iva=16, total=0, subtotal=0;
- int cant=0;
- InputStreamReader fila= new InputStreamReader (System.in);
- BufferedReader leer= new BufferedReader (fila);
- try {System.out.print("Digite el nombre del producto: ");
- Nom = leer.readLine();
- System.out.print("Ingrese el valor: ");
- valor= Double.parseDouble(leer.readLine());
- System.out.print("Cantidad a comprar: ");
- cant= Integer.parseInt(leer.readLine());
- }catch(IOException e) {}
- subtotal= valor*cant;
- subtotal= subtotal + subtotal*desc/100;
- total= subtotal+subtotal*iva/100;
- System.out.println("La factura es: ");
- System.out.println("Nombre: "+ Nom);
- System.out.println("Subtotal: "+ subtotal);
- System.out.println("Total a pagar: " + total);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement