• Lenguaje

    Java usando Scanner

  • Descripción

    Permita reducir en un 0,23% el valor de la factura dada según indique el usuario por pantalla.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import java.util.Scanner;

public class ReduccionDel023 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        double factura, reduccion, total;
        System.out.print("Ingresa el valor de factura: ");
        factura = in.nextDouble();
        in.nextLine();
        reduccion=factura*0.0023;
        total=factura-reduccion;
        System.out.println("Valor de reduccion: " + reduccion);
        System.out.println("Valor de total: " + total);
    }

}