forked from kant003/HolaMundoHacktoberfest2017
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Shopping.java
25 lines (21 loc) · 868 Bytes
/
Shopping.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import java.util.Scanner;
public class Shopping{
public static void main(String[] args) {
//Objetos
double valorDeCompra;
double IVA = 1.21;
byte ScreenInfo = 0;
//Iniciando Scanner
Scanner escaneador = new Scanner(System.in);
System.out.println("Cuánto ha gastado en la compra?");
valorDeCompra = escaneador.nextDouble();
System.out.println("Desea aplicar el IVA? En caso afirmativo presione la tecla 1. En caso contrario presione la tecla 2.");
ScreenInfo = escaneador.nextByte();
//Iniciando if
if (ScreenInfo = 1) {
System.out.println('El total de la compra (IVA incluido) es:' + valorDeCompra * 1.21);
} else (ScreenInfo = 2) {
System.out.println('El total de compra (IVA no incluido) es:' + valorDeCompra);
}
}
}