Question mark "?" appears in output

Output:

No. of quarters: 4

No. of dimes: ? 10

No. of nicks: ? 20

No. of pennies: ? 100

Total amount is $4.0.

Code

public class CountChange {

public static void main(String [] args) {

int qrtrs, dimes, nicks, penns;

double total;

System.out.print("\nNo. of quarters: ");

qrtrs = TextIO.getInt();

System.out.print("No. of dimes: ");

dimes = TextIO.getInt();

System.out.print("No. of nicks: ");

nicks = TextIO.getInt();

System.out.print("No. of pennies: ");

penns = TextIO.getInt();

total = qrtrs*0.25 + dimes*0.10 + nicks*0.05 + penns*0.01;

System.out.print("Total amount: $");

System.out.println(total);

}

}

Correction

Replace getInt() with getlnInt()

Question

Why does "?" appear in the output? And why does it go away with getlnInt()?

Thanks

[949 byte] By [firstnerda] at [2007-10-2 15:59:10]
# 1

The question mark is usually used by your computer (not Java) when your program asks it to display a character that doesn't exist in the characterset that is being use by [probably] the monitor.

Since you are using a custom Java class (TextIO) that we don't have and can't see the docs, that's all that can be said.

ChuckBinga at 2007-7-13 16:25:08 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...