I hope someone can help.
I am trying to write a Java program that will pass an Int-type, String-type and an object into an array that will loop 100 times, filling it with the items in parentheses. I have no clue how to accomplish this as I am brand new to Java and to programming in general. The last method is the one I need help filling. Please help!!
public class Locator
{
// array sizes (and limits)
private final static int STORE_LIMIT = 100;
private final static int POSTAL_ZONE_LIM IT = 100;
// instance variables
Store [] storeArray;
PostalZone [] postalZoneArray ;
private int nextStore;
private int nextPostalZone;
/**
* Constructor for objects of class Locator.
*/
public Locator()
{
storeArray = new Store[STORE_LIMIT];
postalZoneArray = new PostalZone[POSTAL_ZONE_LIM IT];
}
/**
* addStore - add a store to the array of stores.
*
* @param inputStoreNumbe r int Store number to add
* @param inputDescriptio n String Store description to add
* @param inputLocation String Location of store
*
* @return int index of added store, -1 if unable to
* add (array already full)
*/
public int addStore(int inputStoreNumbe r, String inputDescriptio n,
Location inputLocation)
{
}
TIA,
Dave
I am trying to write a Java program that will pass an Int-type, String-type and an object into an array that will loop 100 times, filling it with the items in parentheses. I have no clue how to accomplish this as I am brand new to Java and to programming in general. The last method is the one I need help filling. Please help!!
public class Locator
{
// array sizes (and limits)
private final static int STORE_LIMIT = 100;
private final static int POSTAL_ZONE_LIM IT = 100;
// instance variables
Store [] storeArray;
PostalZone [] postalZoneArray ;
private int nextStore;
private int nextPostalZone;
/**
* Constructor for objects of class Locator.
*/
public Locator()
{
storeArray = new Store[STORE_LIMIT];
postalZoneArray = new PostalZone[POSTAL_ZONE_LIM IT];
}
/**
* addStore - add a store to the array of stores.
*
* @param inputStoreNumbe r int Store number to add
* @param inputDescriptio n String Store description to add
* @param inputLocation String Location of store
*
* @return int index of added store, -1 if unable to
* add (array already full)
*/
public int addStore(int inputStoreNumbe r, String inputDescriptio n,
Location inputLocation)
{
}
TIA,
Dave
Comment