This code doesn't match what the OP is looking for. If I enter 700 in there, it would give me a result of *. The OP wants 700 = ******* from their description.
ckeyrouz's is closer, but assumes its part of a argument on the program invocation. The same logic would apply to the scanner.
PHP Code:
public static String strRepeat(String sToRepeat, int iTimes)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < iTimes; ++i)
{
sb.append(sToRepeat);
}
return sb.toString();
}
public static void main(String... argv)
{
Scanner s = new Scanner(System.in);
// I won't bother with looping or error checking.
int iDollars = s.nextInt();
System.out.println(strRepeat("*", iDollars / 100));
}