View Single Post
  #8 (permalink)  
Old 01-03-2008, 12:47 AM
tim's Avatar
tim tim is offline
Senior Member
 
Join Date: Dec 2007
Location: South Africa
Posts: 334
tim is on a distinguished road
Quote:
Originally Posted by pringle View Post
Yes we were told to use basic arrays due to us being beginners at Java.

The first question I asked about active entries - basically if the user looks at the menu and presses '1', the Contact Detail List will be initialised. Now as the program is made up of four separate arrays,does this mean that I have to write out the four arrays and write 'int active entries = 0; beneath all of the four arrays or only write it once underneath the last array written?

The second question is about my confusion arising from the provided pseudocode. We are to call our program 'StudentContactManager'. In the following piece of pseudocode, it keeps mentioning 'contact detail list':

CASE user option OF
1: Initialise contact detail list
2: Display contact details list
3: Insert new entry into contact detail list
4: Delete entry from contact detail list
5: Search contact detail list

As i've said, the program is made up of four arrays, with each array holding separate information on ten students. As I name my arrays differently, i.e. firstName, lastName - why does it say for example 'display contact detail list'

Hopefully that helps
Okay, I'll try and help you.
I did a similar thing at varsity. It appears to me that you must create a method that does the correct action depending on what the user enters, so you will need five methods. I would have another method that displays the menu.

Menu option 1:
Initialize the arrays by using the new keyword and choose an integer limit on the size of your data structure. Now, set the active entry counter to zero once, after you created the arrays.
Code:
firstName = new String[100]; lastName = new String[100]; entryCounter = 0;
Menu option 2:
gibsonrocker800 explained this part.

Menu options 3 to 5: These are algorithms and they should be on the internet.
__________________
If your ship has not come in yet then build a lighthouse.

Last edited by tim : 01-03-2008 at 01:00 AM.
Reply With Quote