ClassworkTwo

mail@pastecode.io avatar
unknown
java
11 days ago
716 B
3
Indexable
Never
import java.util.Scanner;

public class ClassworkTwo {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String model = sc.nextLine();
        String wheelPos = sc.nextLine();
        int horsePow = sc.nextInt();

        int extraTax = 0;
        if (model.equals("Ford")) {
            extraTax += 25;
        }
        else if (model.equals("Ferrari")) {
            extraTax += 30;
        }

        if (wheelPos.equals("Left")) {
            extraTax += 10;
        }

        if (horsePow > 2000) {
            extraTax += 10;
        }

        System.out.println("The owner has to pay " + extraTax + " %" + " extra tax.");
    }
}
Leave a Comment