-
Lenguaje
Java usando Scanner
-
Descripción
Un almacén de venta de ropa tiene las siguientes promociones para sus clientes las cuales consisten en lo siguiente:
- Para ventas menores o iguales a 100.000, se hace un descuento del 15%.
- Para ventas mayores a 100.000 y menores o iguales a 200.0000, se hace el 25%.
- Para ventas mayores a 200.000, se hace un 35% de descuento.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import java.util.Scanner;
public class AlmacenDeVentaDeRopa {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double descuento, total, venta;
System.out.print("Ingresa el valor de venta: ");
venta = in.nextDouble();
in.nextLine();
descuento=venta*0.15;
if(venta>100000)
descuento=venta*0.25;
if(venta>200000)
descuento=venta*0.35;
total=venta-descuento;
System.out.println("Valor de descuento: " + descuento);
System.out.println("Valor de total: " + total);
}
}
public class AlmacenDeVentaDeRopa {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double descuento, total, venta;
System.out.print("Ingresa el valor de venta: ");
venta = in.nextDouble();
in.nextLine();
descuento=venta*0.15;
if(venta>100000)
descuento=venta*0.25;
if(venta>200000)
descuento=venta*0.35;
total=venta-descuento;
System.out.println("Valor de descuento: " + descuento);
System.out.println("Valor de total: " + total);
}
}