compile error..(yes another)
Posted: Sat Dec 03, 2005 7:27 pm
finally got my code to compile ..and run but i keep getting this error message on scren when i run it..
Please enter your age java.io.IOException: The handle is invalid
oh and by the way this is my code..
just cant seem to go past the first line,...
something to do with reading input??
Please enter your age java.io.IOException: The handle is invalid
oh and by the way this is my code..
Code: Select all
*The bank wants to give away some money!
However there are some conditions that must be fulfilled:
To qualify, the customer must be over 18 and
They must have been with the bank for more than 5 years or
They must have a balance greater than 100 in their accounts.
Write a program that reads in this information, and lets the customer know whether they are in for some money or not.
Extend this program as follows:
If the customer does qualify, inform them how much money they will get:
" If their balance is greater than 100, then they get 2000
" If their balance is greater than 50, (but less than or equal to 100), then they get 1000
" If their balance is positive (but less than or equal to 50) then they get 500
" Finally if their balance is negative they are told to put some money in their account*/
public class Bank
{
public static void main (String [] args)
{
int age, years;
double balance;
ConsoleReader console = new ConsoleReader(System.in);
//prompt user for data
System.out.print("Please enter your age ");
age = console.readInt ();
if(age <18)
System.out.print("sorry you must be 18 or over to to be eligible for a loan ");
else
System.out.print("please enter the number of years you have been with this bank ");
years = console.readInt ();
if(years >5)
System.out.print("congratulations you qualifiy and you get 1000 euro ");
else
System.out.print("please enter your account balance ");
balance = console.readDouble ();
if(balance >100)
System.out.print("congratulations you qualifiy and you get 1000 euro ");
else
System.out.print("sorry you are not eligible for a loan ");
}
}something to do with reading input??