Character.isLetter problem
I am trying to work with converting integers to string for the purposes of ending loops. The code below is what I am working with. The idea is that the user can input deposits until the user enters a negative value or the letter "Q". At that point the total deposits are returned to the calling procedure. The code ran fine until I included the Character.isLetter('Q') in the if statement. As of now, this line always returns True and never gets to the else. Thank you for your help.
[ code]
import java.util.*;
public class Deposits {
public static int getDeposit(int ttlDep){
int value = 0;
System.out.println("Enter a negative number or Q when finished entering deposits");
Scanner input = new Scanner(System.in);
value = input.nextInt();
String aString = Integer.toString(value);
System.out.println("aString is: " + aString);
if ((value <= 0)||(Character.isLetter('Q')))
return ttlDep;
else
ttlDep = ttlDep + value;
return getDeposit(ttlDep);
}
public static void main(String[] args){
int finalDep = 0;
System.out.println("Enter your deposit below.");
int dep = getDeposit(finalDep);
System.out.println("Your deposit of $" + dep + " was received. Thank you");
}
}
[/code]