Win a copy of Machine Learning with TensorFlow this week in the Artificial Intelligence and Machine Learning forum!

John Collie

Greenhorn
+ Follow
since Jan 13, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by John Collie

public class bank
{
public static void main(String argv[])
{
int balanceAMT = Integer.parseInt(argv[0]);
int withdrawnAMT = Integer.parseInt(argv[1]);
int newbalanceAMT = 0;
if(balanceAMT > withdrawnAMT)
{
newbalanceAMT = balanceAMT - withdrawnAMT;
System.out.println("The amount withdrawn is " +withdrawnAMT);
System.out.println("The balance now is " +newbalanceAMT);
}
System.out.println("End of Program");
}
}
I can compile, but attempting to run results in an ArrayIndexOutofBoundsException. What am I missing? Any help would be appreciated. Thanks.
20 years ago