Managing Multiple User Input Data in an Array (or ArrayList)

Managing Multiple User Input Data in an Array (or ArrayList)

Hey there! I need to make a code of an employee record. Here's how it should work: (1) Display a menu of choices: a) choice 1 -> add employee a.1) employee name a.2) employee age a.3) employee phone number b) choice 2 -> Delete employee record(s) c) Choice 3 -> Sort employee record alphabetically

(2) If user chooses choice1, the input data is stored in an ARRAY (or ARRAYLIST) until the user chooses to stop inputting data.

Kindly help me. I don't know whether to use multi-dimensional ARRAYS (or ARRAYLIST) for this. Specifically, I don't know how I'm gonna store the STRING (employee name) data with the INTEGER (employee age/phone number) data.

Thank you very, very much in advance!

View Answers

December 13, 2010 at 6:20 PM

I am re-typing my question so our Java Masters out there can understand clearly what I was asking help about.

Hey there! I need to make a code of an employee record.

Here's how it should work:

(1) Display a menu of choices:

a) choice 1 -> add employee 
  a.1) employee name 
  a.2) employee age 
  a.3) employee phone number 
b) choice 2 -> Delete employee record(s)
c) Choice 3 -> Sort employee record alphabetically

(2) If user chooses choice1, the input data is stored in an ARRAY (or ARRAYLIST) until the user chooses to stop inputting data.

Kindly help me. I don't know whether to use multi-dimensional ARRAYS (or ARRAYLIST) for this. Specifically, I don't know how I'm gonna store the STRING (employee name) data with the INTEGER (employee age/phone number) data.

Thank you very, very much in advance!

Additionally, kindly educate me about Parallel Sorting of the data for the Array (Name and phone numbers). I couldn't do it..









Related Tutorials/Questions & Answers:
Managing Multiple User Input Data in an Array (or ArrayList)
Managing Multiple User Input Data in an Array (or ArrayList)  Hey... record alphabetically (2) If user chooses choice1, the input data is stored in an ARRAY (or ARRAYLIST) until the user chooses to stop inputting data. Kindly
Array and input
to input one of the above numbers then i want to print the array without the number user input. how will i do tht...Array and input  if this is my array int briefcases
Advertisements
Save the input data until user get changed
Save the input data until user get changed  I would like to know how to store the give input data and perform the calculations even after re-opening the program. I am developing a college library management system, i would like
Save the input data until user get changed
Save the input data until user get changed  I would like to know how to store the give input data and perform the calculations even after re-opening the program. I am developing a college library management system, i would like
Save the input data until user get changed
Save the input data until user get changed  I would like to know how to store the give input data and perform the calculations even after re-opening the program. I am developing a college library management system, i would like
Remove multiple elements in arraylist
Remove multiple elements in arraylist   how can we remove multiple values in arrayList? only remove method we used for single remove.but i want to delete multiple value in arrayList
escaping user input in php
escaping user input in php  Is it possible to escape the user input while submitting data into database in PHP
How to Convert ArrayList to Array?
How to Convert ArrayList to Array?  Hi, I am trying to learn to Convert ArrayList to Array. How it is possible? How to Convert ArrayList to Array? Thanks   Hi, To Convert ArrayList to array ArrayList.toArray
Creating Multiple ArrayList
Creating Multiple ArrayList   I want to create multiple ArrayList . import java.util.*; class ArrayListNames{ public static void main(String args[]){ //here i want to create 10 arraylists of type string
need help with two dimensional array that takes input from user and bubble sorts and selections sorts
need help with two dimensional array that takes input from user and bubble... how many elements are going to be input by the user?   Here is a code... cannot figure out how i can declare a two dimensional array without knowing how
Convert Array to ArrayList
In this section, you will learn about converting Array into ArrayList
Convert ArrayList to Array
In this section, you will learn about converting ArrayList to Array
Indexed Array in AS3
.style1 { font-size: medium; } Indexed Array in Action Script3:- If user want to store multiple value in a single data structure then it can be used Array for this process. Indexed array is a type of it. Indexed array provides
Java arraylist to array
Java arrayList has method toArray() It converts the given list into the array of Object. It needs to be casted to the required data type. Then it can be used properly. Example of Java Arraylist to Array import
button to accept user input
the radiobutton and spinner.The user input does not show on my Studentinfo.mdb...button to accept user input  private void jButton1ActionPerformed... that accepts firstname, lastname and gender from user and insert to database
Java User Input
Java User Input  I am using Scanner class for user Input. Scanner s = new Scanner(System.in); String name = s.next(); but i am unable to store full name in name variable...how i can store full name plsss reply   use
user input to database
user input to database  /* * Studentinfo2App.java */ package studentinfo2; import java.sql.Connection; import java.sql.DriverManager; import... in my database user input from my applet does not show
user input to database
user input to database  /* * Studentinfo2App.java */ package studentinfo2; import java.sql.Connection; import java.sql.DriverManager; import... in my database user input from my applet does not show
user input to database
user input to database  /* * Studentinfo2App.java */ package studentinfo2; import java.sql.Connection; import java.sql.DriverManager; import... in my database user input from my applet does not show
calculation after if. user input
user input????   My apologies good evening peoples Once again I am...calculation after if. user input  System.out.print ("please select...[]args){ Scanner input=new Scanner(System.in); System.out.print
java user input - Java Beginners
java user input  how to input from keyboard? please give a example.  Hi Friend, There are lot of ways to input data from keyboard.You...:****** try{ System.out.print("Enter String:"); BufferedReader input = new
How to read user input in C++
How to read user input in C++  How can i get an input from the users in C++?   You can use the standard input "cin" to get the input from user.. For example: int age; cin >> age
error in taking input from user.
error in taking input from user.  //i m having problem inputting the array from user.my program is import java.io.*; class bubble { public static...("Sorted Array: "); for(int i=0;i<a.length;i
A connection pool with multiple user ID.
A connection pool with multiple user ID.  Can I set up a connection pool with multiple user IDs? The single ID we are forced to use causes problems when debugging the DBMS
How to take input by user using jDialogue and use that input
How to take input by user using jDialogue and use that input  I am... this button a dialogue box appear which take employee_id as input from user . then that input be used for fethcing data from the database ( desired table in DB
Data input & output Stream
Data input & output Stream  Explain Data Input Stream and Data Output Stream Class.   DataInputStream and DataOutputStream A data input stream lets an application read primitive Java data types from an underlying input
Call an array from multiple functions
Call an array from multiple functions  I am having two methods in this method i am getting array values from another class. i create same array name for accessing the method values(array) but it will access only one method values
Array list in Java - arraylist type error
Array list in Java - arraylist type error  I am using Array list in Java but when i compile i get array list type error. Can anyone please explain what is array list type error and why it occurs
Java arraylist to string array
arrayList can be converted into string array. For this first converts the arrayList into the object array. This is done by  using the toArray() method. Then cast it into the string and assign in the String array
user input in java - Java Beginners
user input in java   i am trying to write a code to compute the average of 5 numbers but i dont know what to do for the program to accept user input  Hi import java.util.*; public class AverageExample { public
How to convert Arraylist into String Array Java
How to convert Arraylist into String Array Java  Hi, I am beginners of Java programming. Can somebody Suggest me how to convert arraylist to string array in Java. Please suggest any online example. Thanks   Hi, I
to read data stored in ArrayList - Struts
to read data stored in ArrayList  this is regarding struts2, i have create one ArrayList object and in that i have stored 4 User class objects taking them from database. Now i want to read the data of all 4 User objects from jsp
Data from multiple ResultSets?
Data from multiple ResultSets?  hello, How can I get data from multiple ResultSets?   Hi,ADS_TO_REPLACE_1 You can iterate the ResultSet separately and get the required data. Thanks
JavaScript Array from Input
JavaScript Array from Input   ... you easy to understand an example of  Array from Input. The example create a HTML Page JavaScript array from input include a text name 'name', a text field
Java get User Input
Java get User Input       In this section, you will learn how to get the user input from... that will communicate with the user at the command line and returns the user input. We have
grouping similar data of array
grouping similar data of array   I have sorted array of integer . how can I define new arrays with similar data . indeed I want to grouping similar data of array . example: input : int num[] = {20,21,21,24,26,26,26,30}; output
ADT ,data structure (ArrayList), sorting
ADT ,data structure (ArrayList), sorting  Write a program... in different arrayList depending on his/her position (cashier or supervisor... a user chooses to display a report.. (adsbygoogle = window.adsbygoogle
Convert ArrayList To Array
Convert ArrayList To Array      ... will learn how to convert an Arraylist into an array.  Code Description...;The package java.util defines the array class. The class array contains various methods
Design a registration.jsp page with input for user registration details
Design a registration.jsp page with input for user registration details  Design a registration.jsp page with input for user registration details like firstname, lastname, choose username, choose password, confirm password. After
Display PHP clock with user input date and time
Display PHP clock with user input date and time  The following PHP code displays a clock with current date and time. I want the clock to receive user input date and time. How can this be done? <?php date<em>
XP Bowling Game User input help
XP Bowling Game User input help  I was asked to do the XP Bowling Example as an assignment. I have the programme passing all tests, but now I need to make the code accept input from a user and display the scores/frames
Insertion of multiple row data for billing purpose.
Insertion of multiple row data for billing purpose.  Hi , I have a hrml page . with 4 input text field as a 4 column and 4-5 rows... the input field data of all row through JSP. any good suggestion please help
Write a program that takes the marks of user as input
Write a program that takes the marks of user as input  Write a program that takes the marks of user as input. If marks are greater then 60 the program should display "Great, you have passed the course", else the program should
Read user input in Java using Scanner
Example of of reading user input in Java using Scanner In this section we... input from console. Our sample program asks user to enter name and then age, user input is read using the scanner class. Information entered by user is printed
ArrayList in JSP
ArrayList in JSP ArrayList is a class and a member of Java Collection Framework. It is the resizable-array and permit all element including the null... there are two file index .jsp and postIndex.jsp. The index.jsp fill take the user
problem of static in jsp page by multiple user access
problem of static in jsp page by multiple user access  hi , i am continuing my online exam project,but i have a Singleton class which i am invoking from my jsp page , ths page can access by more number of users .every user
arraylist
data into an arraylist and display the data of the particular employee according to the id entered by the user. import java.util.*; class EmployeeData... in arraylist, then how can i find out all infomation of class A using emplyee
arraylist
arraylist   Using arraylist class , what type of exception are throws, how can write a java programe   An ArrayList can throw... ArraylistException { void buildAlphabet() { ArrayList list = new ArrayList
loop to input multiple points to calculate final distance and speed
loop to input multiple points to calculate final distance and speed  ...) { Scanner input= new Scanner(System.in); System.out.print(" Enter two...{ System.out.print(" Way point", +n); Scanner input= new Scanner
Java Array Iterator with Example
the elements of the ArrayList can be traversed by the Iterator. There can be array of the Iterator interface to manipulate more than one ArrayList Java Array... Java Array Iterator is an interface in the collection framework. Java

Ads