I tried to convert it to char but I'm still getting a problem that it won't build properly, newbie here. But any help would do please
import java.util.Scanner;
public class PizzaChoice {
public static void main(String[] args){
//char sizes;
Scanner input = new Scanner(System.in);
final int NUMBER_OF_CHOICES = 4;
char[] pizzaSize = {'S', 'M', 'L', 'X'};
double[] prices = {6.99, 8.99, 12.50, 15.00};
char sizeChosen;
double pizzaPrice = 0.0;
boolean validChoice = false;
Scanner inputDevice = new Scanner(System.in);
System.out.print("Enter pizza size- S, M, L, or X: ");
sizeChosen = inputDevice.nextLine().charAt(0);
for(int s = 0; s < NUMBER_OF_CHOICES; ++s)
{
if(sizeChosen.equals(pizzaSize[s]))
{
validChoice = true;
pizzaPrice = prices[s];
}
}
if(validChoice)
System.out.println("The price for chosen size " +
sizeChosen + " is $" + pizzaPrice);
else
System.out.println("Sorry - Invalid Choice Entered");
}
}