Hey, what's up! The program uses arrays to show expenditure/income by certain people. An the user have an option to expand array, delete, search indexes by DATE. I'm trying to set up a user interface but cannot get the method calls right .. Here's the code of the main class. I'd appreciate if smb could help me figure out one how to call AT LEAST one of the methods by user.
I've tried to call the method by //jacksBook.append(date)// and it's not working..

Thanks in advance!


//import java.util.Scanner;
import java.util.Random;
public class RecordManager
{
private Record[ ] records;
private int size;
private int capacity;


public static void main (String [ ] args)
{
Scanner keyboard = new Scanner(System.in);
RecordManager jacksBook = new RecordManager ( );
// System.out.print (jacksBook);
boolean answer = true;

System.out.println ("\n\n**************************");
jacksBook.bubblesortByDate ( );
System.out.print (jacksBook);
String option = "";
do
{
System.out.println ("*** menu of operations ****");
System.out.println ("1:add a record\n2:delete a record\n3:modify a record\n4:search for a record\n5:exit");
System.out.print ("enter your choice: ");
option = keyboard.nextLine ();
if (option.equals("1"))
{


System.out.println("Please, search by date according to the sample: mm/dd");
String date = keyboard.nextLine();
jacksBook.append(date);
}

}
while(answer);




}

public RecordManager ( )
{
Random gen = new Random ( );
capacity = 20;
records = new Record [capacity];
size = gen.nextInt (capacity);
for (int i = 0; i < size; i++)
records[i] = new Record ( );
}

public String toString ( )
{
String outString = "----------financial records----------";
for (int i = 0; i < size; i++)
outString += records[i];

return outString;
}

public void bubblesortByDate ( )
{
for (int pass = 1; pass <= size-1; pass++)
{
boolean swap = false;
for (int i = 0; i <= size-1-pass; i++)
{
if (records[i].getDate ( ).compareTo (records[i+1].getDate ( )) > 0)
{
Record temp = records[i];
records[i] = records[i+1];
records[i+1] = temp;
swap = true;
}
}
if (!swap)
break;

}

}

public void append (Record newRecord)
{
if (size == capacity)
expand ( );

records[size++] = newRecord;


}

public void insert (Record newRecord, int pos)
{
if ((pos < 0) || (pos > size))
{
System.out.println ("index ouf of bound");
return;

}

if (size == capacity)
expand ( );

if (pos == size)
append (newRecord);

else
{
for (int i = size-1; i >= pos; i--)
records[i+1] = records[i];

records[pos] = newRecord;
size++;


}

}


public void write (Record newRecord, int pos)
{
if ((pos < 0) || (pos >= size-1))
{
System.out.println ("index ouf of bound");
return;
}
else
records[pos] = newRecord;

}

//by date, sequential, first match only
public int search (String key)
{
for (int i = 0; i < size; i++)
{
if (key.equals (records[i].getDate ( )))
return i;
}

return -1;

}

//sequential search from "startPos"
//added 2/13,
public int search (String key, int startPos)
{
if ((startPos < 0) || (startPos > size-1))
return -1;

for (int i = startPos; i < size; i++)
{
if (key.equals (records[i].getDate ( )))
return i;
}

return -1;

}

//delete the first match, key = date
public void delete (String key)
{
int pos = search (key);
if (pos == -1)
{
System.out.println ("record not found");
return;
}
else
{
if (pos != size-1)
records[pos] = records[size-1];

size--;

}

}

private void expand ( )
{
capacity *= 2;
Record [ ] temp = new Record [capacity];

for (int i = 0; i < size; i++)
temp[i] = records[i];

records = temp;

}

}
//