finding whether the number is odd or even and
positive or negative.
g.u.i:
coding
for even or odd:
{
int
NUM=Integer.parseInt(tf1.getText());
if(NUM%2==0)
tf2.setText("Even");
else
tf2.setText("Odd");
}
coding
for positive or negative:
{
int
NUM=Integer.parseInt(tf1.getText());
if(NUM>0)
tf3.setText("Positive");
else
tf3.setText("Negative");
}
coding
for clear button:
{
tf1.setText("");
tf2.setText("");
tf3.setText("");
}
coding
for exit button:
{
System.exit(0); }
Run
time screenshot: