G
GreenMountainBoy
HELLO,
Would anyone be able to advise me as to how to write a simple Random
Access File I/O program.
The record structure is
public Employee
{
int iRecordNumber;
String sName;
double dSalary;
}
I need to be able to create these records from the keyboard, then write
them to disk, and then be able to read one based on a iRecordNumber.
Part of the problem is that the Name string is variable length and I
need it to be a fixed 25 characters - I have found that character
arrays won't function in many places where a string is called for..any
simple solutions? I guess I could pad the string so that it is the
right length, but the rest of the program still confuses me. any help
would be forever remebered.
I need to be able to 1) add new items, 2) list all items, 3) query an
item based on its record number, 4) update a record (salary only), 5)
delete an item.
I have looked in all the standard Java texts for an example framework,
but there is nothing comparable....
THANKS SO MUCH FOR YOUR HELP... I REALLY APPRECIATE IT...
p.s. I posted this on the java help forum but it seems that it requires
the expertise that this forum provides.
thanks, GreenMountainBoy
Would anyone be able to advise me as to how to write a simple Random
Access File I/O program.
The record structure is
public Employee
{
int iRecordNumber;
String sName;
double dSalary;
}
I need to be able to create these records from the keyboard, then write
them to disk, and then be able to read one based on a iRecordNumber.
Part of the problem is that the Name string is variable length and I
need it to be a fixed 25 characters - I have found that character
arrays won't function in many places where a string is called for..any
simple solutions? I guess I could pad the string so that it is the
right length, but the rest of the program still confuses me. any help
would be forever remebered.
I need to be able to 1) add new items, 2) list all items, 3) query an
item based on its record number, 4) update a record (salary only), 5)
delete an item.
I have looked in all the standard Java texts for an example framework,
but there is nothing comparable....
THANKS SO MUCH FOR YOUR HELP... I REALLY APPRECIATE IT...
p.s. I posted this on the java help forum but it seems that it requires
the expertise that this forum provides.
thanks, GreenMountainBoy