Advertisement
Guest User

eje5

a guest
Jun 26th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class eje05 {
  3. static Scanner teclado= new Scanner(System.in);
  4.  
  5. static void calcular (int cant) {
  6. System.out.println("Ingrese 1 para autos y 2 paraa camionetas");
  7. int num=teclado.nextInt();
  8. if (num == 1) {
  9. int totalA= cant*100;
  10. System.out.println("El precio total es USD" +totalA);
  11. if (cant > 7) {
  12. System.out.println("tiene un descuento de USD " + totalA*0.25);
  13. }
  14. }
  15. else{
  16. int totalC= cant*130;
  17. System.out.println("El precio total es USD" +totalC);
  18. if (cant > 7) {
  19. System.out.println("tiene un descuento de USD " +totalC*0.25);
  20. }
  21.  
  22. }
  23. }
  24. public static void main(String[] args) {
  25. // TODO Auto-generated method stub
  26. System.out.println("Ingrese la cantidad de dias que desea alquilar");
  27. int x =teclado.nextInt();
  28. calcular(x);
  29. }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement