I'm in an introductory java class and need some desperate help on my project. What the code has to do is have the user enter an integer and then it gives the amount of deficient numbers up to that integer. He gave us a similar code shown below that uses prime numbers instead. I don't even know where to start with this or what to change so any help at all would be greatly appreciated. The code he gave us was this:
import java.util.Scanner;
public class Prime
{
public static void main (String[] args)
{
Scanner s = new Scanner(System.in);
int n, f, fcount, p, a;
p = 0;
System.out.print("Enter an integer:");
a = s.nextInt();
for (n = 1; n<=a; n++)
{
System.out.print(n + "\t");
fcount = 0;
for (f = 1; f <= n/2; f++)
if (n % f == 0)
{
System.out.print(f + " ");
fcount++;
}
if (fcount == 1)
p++;
System.out.println();
}
System.out.println("Number of primes = " + p);
}
}