[Solved]Bit Problem Import Javautilscanner Public Class Tempconversionjacobvaldez Public Static Vo Q37095374
I am having a bit of a problem
import java.util.Scanner;
public class TempConversionJacobValdez {
public static void main(String[] args) {
showMenu();
}
//Method showMenu
public static void showMenu() {
Scanner input = new Scanner(System.in);
displayMenuSelections();
int userSelection = input.nextint();
while (userSelection != 4)
{
switch(userSelection)
{
case 1:
showCelsius();
break;
case 2:
showKelvin();
break;
case 3:
showData();
break;
default:
System.out.println(“Your answer is invalid. Select 1,2,3, or4”);
System.out.println();
break;
}
displayMenuSelections();
userSelection = input.nextint();
}
System.out.println(“Bye”);
quitProgram();
}
// Display menu selections
public static void displayMenuSelections() {
System.out.println (“Select one of the following options: “);
System.out.println (“1. Convert Fahrenheit to celsius (Centigrade)”);
System.out.println (“2. Convert fahrenheit to Kelvin”);
System.out.println (“3. Display data”);
System.out.println (“4. Quit the program”);
System.out.println (“Enter your choice: “);
}
//Method showCelsius
public static void calculateTemp() {
Scanner input = new Scanner(System.in);
System.out.println(“Enter a Fahrenheit temperature: “);
float[][] fahrenheit = new float[10][3];
fahrenheit = input.nextfloat();
celsius = (fahrenheit – (float)(32.0)) * (float)(5.0 / 9.0);
kelvin = celsius + 273.15F;
while(kelvin < 0)
{
System.out.println(“You have entered an invalid temperature.”);
System.out.println(“Enter a Fahrenheit temperature: “);
fahrenheit = input.nextFloat();
celsius = (fahrenheit – (float)(32.0)) * (float)(5.0 / 9.0);
kelvin = celsius + 273.15F;
}
if(tempCounter >= maxCounter);
{
System.out.println(“Too many temperatures entered! Max is :” +maxCounter);
showData();
System.exit(0);
}
tempArray[tempCounter][0] = fahrenheit;
tempArray[tempCounter][1] = celsius;
tempArray[tempCounter][2] = kelvin;
tempCounter++;
}
//Show celsius
public static void showCelsius() {
calculateTemp();
System.out.println(String.format(“%.1f” , fahrenheit) + “Fahrenheit =” +
String.format(“%.1f” , celsius) + ” Celsius”);
}
//Show Kelvin
public static void showKelvin() {
calculateTemp();
System.out.println(String.format(“%.1f” , fahrenheit) + “Fahrenheit=” +
String.format(“%.1f” , kelvin) + ” Kelvin”);
}
//Display data
public static void showData() {
System.out.print(“Fahrenheit: “);
for(int i = 0; i < tempArray.length; i++) {
System.out.printf(“%7.1f ” , fahrenheit);
}
System.out.println();
System.out.print(“Celsius: “);
for(int i = 0; i < tempArray.length; i++) {
float celsius = tempArray[i][1];
System.out.printf(“%7.1f ” , celsius);
}
System.out.println();
System.out.print(“Kelvin: “);
for(int i = 0; i < tempArray.length; i++) {
float kelvin = tempArray[i][2];
System.out.printf(“%7.1f ” , kelvin);
}
System.out.println();
}
//Method to quit
public static void quitProgram() {
System.exit(0);
}
}
I keep getting the error code “cannot find symbol” in java.
Expert Answer
Answer to I am having a bit of a problem import java.util.Scanner; public class TempConversionJacobValdez { public static void mai… . . .
OR

