Question: modify the CarCareChoice class so that as long as the user enters the first three characters of a service, the choice is considered valid. Rename
modify the CarCareChoice class so that as long as the user enters the first three characters of a service, the choice is considered valid. Rename the class CarCareChoice
heres what i have so far:
import java.util.Scanner;
public class CarCareChoice
public static void mainString args
Scanner input new ScannerSystemin;
String services oil change", "tire rotation", "battery check", "brake inspection";
double price ;
for String service : services
System.out.println service;
System.out.printlnPlease enter the name of the service you would like:";
String serviceChoice input.nextLinetoLowerCase;
for int i ; i services.length; i
if serviceChoiceequalsservicesi
System.out.printlnEnter selection servicesi;
System.out.printlnservicesi price is pricei;
found true;
break;
if found
System.out.printlnWrong service selected";
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
