Lets assume Num is simply 3.
public static int income(Scanner console, int number)
{
int incomeNum = console.nextInt();
int amount;
for(int i = 0; i <= number; i++)
{
System.out.println("Next income amount?");
incomeNum = console.nextInt();
amount += incomeNum;
}
return amount;
}
I need the incomeNum to add itself up when the user puts in a number and store it into amount and have that amount be returned to the main. I'm stuck because it says the amount is not initialized...