I facing this problem as shown in Figure below
I want to divide the two values but it seem something goes wrong (without error)
but if I change the sign to "+" or "*" , they seem to perform perfectly.
Can anyone tells me whats wrong with the "/"?
By the way, there's a light bulb beside it saying that Resource leak, may I know what's wrong as well?
One more question, I've tried another method using
public class PrintSquare {
public static void main(String[] args) {
int userInput;
int square;
System.out.print("Please type a number: ");
userInput = TextIO.getlnInt();
square = userInput * userInput;
System.out.print("The square of that number is ");
System.out.println(square);
}
}
Everything seems fine except for the line userInput = TextIO.getlnInt();
The error says that TextIO can't be resolved.
May I know what's problem with it as well?
This post has been edited by ChrisNt: 07 July 2015 - 03:39 AM
Reason for edit:: code tags

New Topic/Question
Reply


MultiQuote



|