hey i am the event organizer, below we will mine out the newbs
hehe
QUESTION 1 TO THIS CONTEST IS: How do you fix the while loop in this code?
public class Kalculator
{public static void main (String []args)
{String temp, total;
int menuChoice, num1, num2, result=0;
EasyReader r= new EasyReader();
System.out.println ("Select an operation (1,2,3,4) \n"+
" 1.Add \n"+
" 2.Subtract \n"+
" 3.Multiply \n"+
" 4.Divide \n");
System.out.print ("You have choose choice: ");
temp= r.readLine();
menuChoice= Integer.parseInt(temp);
while (int menuChoice = 1)
{System.out.print ("Enter only the number in choice for operation. \n"+
"Ex. You have choose choice:1 \n"+
" This choice '1' will give you the operation addition.");
}
System.out.print ("Enter your first integer: ");
temp= r.readLine();
num1= Integer.parseInt(temp);
System.out.print ("Enter your second integer: ");
temp= r.readLine();
num2= Integer.parseInt(temp);
if (menuChoice==1)
result = num1 + num2;
else if (menuChoice==2)
result = num1 - num2;
else if (menuChoice==3)
result = num1 * num2;
else if (menuChoice==4)
result = num1 / num2;
System.out.print ("Your result is "+result);
}
}
good luck, responses expected by 9pm EST