Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class eje05 {
- static Scanner teclado= new Scanner(System.in);
- static void calcular (int cant) {
- System.out.println("Ingrese 1 para autos y 2 paraa camionetas");
- int num=teclado.nextInt();
- if (num == 1) {
- int totalA= cant*100;
- System.out.println("El precio total es USD" +totalA);
- if (cant > 7) {
- System.out.println("tiene un descuento de USD " + totalA*0.25);
- }
- }
- else{
- int totalC= cant*130;
- System.out.println("El precio total es USD" +totalC);
- if (cant > 7) {
- System.out.println("tiene un descuento de USD " +totalC*0.25);
- }
- }
- }
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- System.out.println("Ingrese la cantidad de dias que desea alquilar");
- int x =teclado.nextInt();
- calcular(x);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement