import java.util.Scanner;

public abstract class Vehiculo {

    protected String placas;
    protected static final double IVA = 0.16;

    public void leerDatos(Scanner sc) {
        do {
            System.out.print("Ingrese las placas: ");
            placas = sc.nextLine().trim();

            if (placas.isEmpty()) {
                System.out.println("Error: las placas no pueden quedar vacías.");
            }

        } while (placas.isEmpty());
    }

    public abstract double calcularImporte();

    public void mostrarDatos() {
        System.out.println("Placas: " + placas);
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: