This is my code

``````import java.lang.Math;
import java.io.*;

public class TestDfunction {

static void fun(float num1, float num2) throws IOException
{

String strNum1, strNum2;

System.out.print("Enter the first number: ");
num1 = Float.parseFloat(strNum1);

System.out.print("Enter the second number: ");
num2 = Float.parseFloat(strNum2);

}

{

System.out.println("Please choose the type of operation needs to be computed by pressing the corresponding number: ");
System.out.println("----------------------------------------------------------------------------------------------");
System.out.println("                                    2.        Subtraction");
System.out.println("                                    3.        Multiplication");
System.out.println("                                    4.        Division");
System.out.println("                                    5.        Remainder");
System.out.println("                                    6.        Minimum");
System.out.println("                                    7.        Maximum");
System.out.println("----------------------------------------------------------------------------------------------");
}

public static void main(String[] args)

{

try{

float num11, num22;
String strChoose;
int choose;

choose = Integer.parseInt(strChoose);
System.out.println("");

while ((choose <1) || (choose >8))
{
System.out.println();
System.out.println("The number you have entered is invalid...");
choose = Integer.parseInt(strChoose);
}

switch (choose)
{

case 1:
fun(num11,num22);
System.out.println("The sum is: "+ (num11 + num22));
break;

case 2:
fun(num11,num22);
System.out.println("The diferrence is: " + (num11 - num22));
break;

case 3:
fun(num11,num22);
System.out.println("The product is: " + (num11 * num22));
break;

case 4:
fun(num11,num22);
System.out.println("The quotion is: " + (num11 / num22));
break;

case 5:
fun(num11,num22);
System.out.println("The remainder is: " + Math.IEEEremainder(num11,num22));
break;

case 6:
fun(num11,num22);
System.out.println("The smaller value is: " + Math.min(num11,num22));
break;

case 7:
fun(num11,num22);
System.out.println("The greater value is: " + Math.max(num11,num22));
break;

case 8:
System.exit(0);
}

}

catch (IOException e) {System.out.println("IO Error");}
}
}``````

Errors:
variable num11 might not have been initialized
variable num22 might not have been initialized

The error is pretty self explanatory. You never gave the variables a value.

``float num11, num22;``

That creates them but it does not initialize them with a value. If you give them a starting value, such as zero, your error is fixed; however your program does not work due to a logic error. Your method fun reads the values but never returns them. I think you should be able to figure it out from there.

Ahaaa

Will check that