Input a number and find whether it is positive or negative.
1
Expert's answer
2011-06-15T11:15:43-0400
public class Program { & public static void main(String[] args) { & java.util.Scanner kb = new java.util.Scanner(System.in); & System.out.print("Please enter number: "); & double number = Double.parseDouble(kb.nextLine()); & if (number<0) System.out.println("Negative"); & else if (number>0) System.out.println("Positive"); & else System.out.println("Zero"); & } }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment