so this is mainly for Azcruz or anyone who can steer me in the right direction. in my code after the user inputs the number and gets the outcome, I want to give them an option to return to the options menu place thing. I cant seem to find it or think of a way. I hope I'm allowed to post it
. I'm using my own methods to find. my problem is all the way in the bottom and in cyan
public class ProgrammingAssignment4 {
public static void printGreetings(){
System.out.println("what do you want to convert today!");
System.out.println("chose a number between 1 - 7");
}
// the formula to convert fahrenhiet to celcius
public static double ConvertFtoC( double tempF ) {
double Celsius = (tempF - 32) * 5/9.0;
return Celsius;
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
String[] tempNames;
tempNames = new String[7];
double tempC;
double tempF;
double tempK;
char input;
// greetings
printGreetings();
tempNames[0]=" 1: Fahrenheit to Celsius";
tempNames[1] = " 2: Celsius to Fahrenheit";
tempNames[2] = " 3 Kelvin to Fahrenheit ";
tempNames[3] = " 4:Fahrenheit to Kelvin";
tempNames[4] = " 5: Calsius to Kelvin " ;
tempNames[5] = " 6: Kelvin To Celsius ";
tempNames[6] = " 7: Nothing";
System.out.println(Arrays.toString(tempNames));
input = scnr.next().charAt(0);
if(input == '1') {
//Converting Fahrenheit to Celsius
System.out.println(" enter the temperature in Fahrenheit");
tempF = scnr.nextDouble();
tempC = ConvertFtoC(tempF);
System.out.println("the temp is :" + tempC +" C ");
if (tempC >= 100) {
System.out.println(" thats pretty hot thats Boiling point for water"
+ " ");
} else if (tempC < 99 && tempC >=29){
System.out.println(" that is Sweaty hot weather ");
} else if (tempC < 29 &&tempC >= 23){
System.out.println("thats T-shirt and shorts temp");
} else if ( tempC < 23 && tempC >=20) {
System.out.println("that is average room tempurature ");
} else if ( tempC < 20 && tempC >=14){
System.out.println(" that is Long sleeve shirt and Pants Tempurature"
+ " ");
} else if ( tempC < 14 && tempC >= 9){
System.out.println("that is bring out the thick jacket if you wanna "
+ "stay warm");
} else if ( tempC < 9 && tempC >=-1){
System.out.println(" that is freezing as in water freezes at this "
+ "temp ");
} else if ( tempC < -1 && tempC >= -100){
System.out.println(" so cold that you may want to reconsider going"
+ " outside especially with kids ");
} System.out.println("do you wannt to convert more temps?"); // right here is where I want an option to return back
input = scnr.next().charAt(0);