Computer Science 261
Assignment # 2
Due: Monday, Sept. 10
Purpose:
Write a program which takes an integer as its first argument and prints out a message saying whether the number is perfect, abundant, deficient, or prime. Be efficient in your use of loops and if-then-else statements.
Call this program perfect.java and place it in your handins folder.
Recall the following code from today's example:
int k; System.out.println("Number of arguments is " + args.length); for (int i = 0; i < args.length; ++i) { System.out.println("Argument " + (i+1) + " " + args[i]); } k = Integer.valueOf(args[0]).intValue(); System.out.println("Numeric value of first argument is " + k);