ClassworkTwo
unknown
java
a year ago
716 B
5
Indexable
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."); } }
Editor is loading...
Leave a Comment