In: Computer Science
import java.util.*;
import java.io.*;
class evaluateValue
{
public Integer zeroValue=null;
public Integer positiveValue=null;
public Integer negativeValue=null;
evaluateValue(int argument){
if(argument > 0){
positiveValue = 1;
}
else if(argument < 0){
negativeValue = 1;
}
else {
zeroValue = 1;
}
}
public void printit(){
if(zeroValue != null){
System.out.println(" The number was zero.");
}
if(positiveValue != null){
System.out.println(" The number was positive.");
}
if(negativeValue != null){
System.out.println(" The number was negative.");
}
}
}
public class assignment3
{
public static void main(String[] args)
throws IOException {
int val1;
// create a BufferedReader using System.in
BufferedReader obj = new BufferedReader(new
InputStreamReader(System.in));
String str;
System.out.println("Enter the number.");
str = obj.readLine();
val1 = Integer.parseInt(str);
evaluateValue ob = new evaluateValue(val1);
ob.printit();
}
// below is the screenshot of the code to avoid indentation
error if any.
}