Answer:
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Cody’s Car Care Shop");
System.out.println("Available services: oil change, tire rotation, battery check, and brake inspection");
System.out.print("Choose your service: ");
String service = input.nextLine();
if (service.equals("oil change"))
System.out.println("Your choice is: " + service + ". Its price is: $25");
else if (service.equals("tire rotation"))
System.out.println("Your choice is: " + service + ". Its price is: $22");
else if (service.equals("battery check"))
System.out.println("Your choice is: " + service + ". Its price is: $15");
else if (service.equals("brake inspection"))
System.out.println("Your choice is: " + service + ". Its price is: $5");
else
System.out.println("Invalid entry!");
}
}
Step-by-step explanation:
Print the available services
Ask the user for the service using Scanner
Check the service user entered using if else structure. If the service matches one of the options that is printed, print out the service and its price
Otherwise, print invalid entry