Add,Get,Remove in linked lists

I need to be able to add, get and remove items from the linked list and I can't seem to be able to get any of it to work. Ignore the coments, that's just where I was experimenting with other ways of doing it. I keep getting an error from inside case1 of Menu. Any ideas appreciated.
import cs1.Keyboard;
import StaffMember;
import Employee;
import java.util.*;
public class Staff
     LinkedList myList = new LinkedList();
     public Staff ()
          //StaffMember staffList = new StaffMember[1];
          //private Employee[]firm;
          //private int currentSize;
          //private int count;
          public static void main (String[] args)
               Menu();
               Employee[] staffList = new Employee[1];
               for (int i=0; i<1; i++)
                    //staffList[i] = setNewEmployee();
                    //System.out.println (staffList); (NOT NEEDED)
                    //myList.add(staffList[i]);
                    //myList.size();
                    //myList.toArray();
               for (int count=0; count<staffList.length; count++)
                    System.out.println (staffList[count]);
                    System.out.println ("- - - - - - - - - - - - - - - - -");
          public static int Menu()
               System.out.println("To add a new staff member press 1");
               System.out.println("To find a staff member press 2");
               System.out.println("To remove a staff member press 3");
               int choice = Keyboard.readInt();
               int effect = choice;
               switch(effect)
                    case 1:
                         System.out.println("Adding new staff member");
                         setNewEmployee();
                         myList.add(new Employee);
                         myList.toArray();
                         break;
                    case 2:
                         System.out.println("Finding staff member");
                         break;
                    case 3:
                         System.out.println("Removing staff member");
                         break;
                    default:
                         System.out.println("invalid entry!");
               return choice;
          private static Employee setNewEmployee()
               String name, address, phone;
               int staffID;
               System.out.print("Input ID: ");
               staffID = Keyboard.readInt();
               System.out.print("Input Name: ");
               name = Keyboard.readString();
               System.out.print("Input Address: ");
               address = Keyboard.readString();
               System.out.print("Input Phone: ");
               phone = Keyboard.readString();
               Employee s = new Employee(name, address, phone, staffID);
               return s;

This should get you going:
case 1:
                      System.out.println("Adding new staff member");
//                      setNewEmployee();  // this returns an object but there is nothing to store it in
                      myList.add(setNewEmployee);  // use the returned object as a direct argument
//                      myList.toArray();  // this returns an array of objects but nothing to store the array in
                      break;As you continue by uncommenting the code in the other sections of your program, you will find similar type of erros.
V.V.

Similar Messages

  • How to add SharePoint 2013 Promoted link list view web part in page programatically with Tiles view using CSOM.

    How to add SharePoint 2013 Promoted link list view web part in page programatically with Tiles view using CSOM. I found that it can be
    done by using XsltListViewWebPart class but how can I use this one by using shraepoint client api.
    shiv

    Nice, can you point me to the solution please ?
    I'm  trying to do this but I get an error : 
    Web Part Error: Cannot complete this action. Please try again. Correlation ID: blablabla
    StackTrace:    at Microsoft.SharePoint.SPViewCollection.EnsureViewSchema(Boolean fullBlownSchema, Boolean bNeedInitallViews)     at Microsoft.SharePoint.SPList.GetView(Guid viewGuid)   
    All help really appreciated.

  • Hide ,add or remove button in LIST MANAGER ITEM

    Hi,
    How i can hide ,add or remove button in LIST MANAGER ITEM.
    Thanks & Regards
    Vedant

    I figured out the VO and CO object and the page.
    PersonSitPG.xml
    SpecialInformationDetailsVO
    SitMainPageCO
    And after going through the forum form Anil passi, it mentions there are three ways of doing it and the SPEL example given
    extends a VO object.
    I created a boolean variable based on IdflexNum as isIdflexNum in SpecialInformationDetailsVO
    That is if Idflexnum = 2356 then
    retrun true
    else return false.
    And use this in the HrSitDeleteButton and HrSitUpdateButton---?property rendered --->SPEL. But there is no SPEL in the rendered property when I clicked on the button property.
    So I doubt if this approach is right . Can you please let me know. I am new to OA framework, I have done only personalizations before.

  • Question repost: Add Methods in a Linked List.

    Please excuse my reposting of this question. The previous question had a lot of unformatted code.
    Here, I'll just have the two methods that I need help with. If more information is needed, I have it by the buttloads.
    They are add methods for a List class:
      public boolean add(E o)
      Node newNode = new Node();
      newNode.data = o;
      if (first == null)
          first = last = newNode;
      else {
      last.next = newNode;
      } // end if
      size++;
      return true;
    public void addLast(E o)
      Node newNode = new Node();
      newNode.data = o;
      newNode.previous = last;
      if (first == null)
          first = last = newNode;
      else {
      last.next = newNode;
       size++;
      }Can anybody help me with these? Duke points will be rewarded.

    Once again: continue to ask for help in your original post. Include your up-to-date code and provide as much details as possible, such as error messages (copy and paste the entire message, do not paraphrase) or for incorrect behviour describe what is happening and what is supposed to happen.
    Do this in your original post. I don't want to see another post here!

  • Addition in a linked list

    Hi,
    I want to add numbers in a linked list. For example when i pass in the string 123456789, i reverse it so that it appears as 987654321 in the linked list. If i add this to the string 954 which appears as 459 in the linked list, i am supposed to get 123457743 but i get 1743. How do i rectify this from my code.
    import java.util.LinkedList;
    import java.util.ListIterator;
    public class LargeInteger {
    /** Constructs a new LargeInteger object from the specified String.
    * The String parameter will contain the digits comprising the number
    * to be represented by this LargeInteger object. The number may be
    * either positive or negative, so be sure to check for a sign.
    * You should throw an IllegalArgumentException if the string which is
    * passed in does not contain a valid number. An invalid String would
    * be one which contains any character other than a digit (however the
    * first character may be a negative sign).
    * @param value A String representing the number to be represented.
    &nbs! p; * @throws IllegalArgumentException This exception is thrown if the
    * parameter doesn't contain a valid number.
    LinkedList digits = new LinkedList();
    public LargeInteger(String value) throws IllegalArgumentException {
    //Declare variables
    boolean neg = false;
    int num = 0;
    int start = 0;
    char ch = ' ';
    Integer tempObj = new Integer(num);
    //If the first character is not a - sign or it is less than the character 0
    //or it is greater than the character zero, then throw
    //IllegalArgumentException
    //else add digits into linked list as integers
    if(value.startsWith("-")) {
    neg = true;
    start = 1;
    } else if ( !Character.isDigit(value.charAt(0)) ) {
    throw new IllegalArgumentException();
    for (int j = value.length()-1; j >= start; j--) {
    ch = value.charAt(j);
    if (Character.isDigit(ch)) {
    num = Character.getNumericValue(ch);
    tempObj = new Integer(num);
    digits.add(tempObj);
    } else {
    throw new IllegalArgumentException();
    } // end Constructor
    public static void main(String[] args) {
    LargeInteger a = new LargeInteger("954");
    LargeInteger b = new LargeInteger("123456789");
    LargeInteger c = a.plus(b);
    System.out.println( c.toString() );
    System.out.println( a.toString() );
    System.out.println( b.toString() );
    /** Calculates the sum of this LargeInteger object with the one passed
    * as a parameter.
    * @param other The number to add to the current value.
    * @return The sum of this LargeInteger and the value passed as a
    * parameter.
    public LargeInteger plus(LargeInteger other) {
         int i = 0;
    LargeInteger result = new LargeInteger("0");
    int carry = 0;
    ListIterator onfiltered = digits.listIterator();
    ListIterator two = other.digits.listIterator();
    //Add digits in linked list
    for (; i < digits.size() && i < other.digits.size(); i++) {
    result.digits.addFirst(
    new Integer(
    (((Integer) digits.get(i)).intValue()
    + ((Integer) other.digits.get(i)).intValue()
    + carry)
    % 10));
    carry =
    (((Integer) digits.get(i)).intValue()
    + ((Integer) other.digits.get(i)).intValue()
    + carry)
    / 10;
    onfiltered.next();
    two.next();
    //Append any remaining digits from this value to the result's
    //left
    for(; i < digits.size();i++){
         result.digits.addFirst(new Integer((((Integer)digits.get(i)).intValue() + carry) % 10));
         carry = (((Integer)digits.get(i)).intValue() + carry) / 10;
         onfiltered.next();
    //Append any remaining digits from the other value to the result's
    //left
    for(; i < digits.size();i++){
         result.digits.addFirst(new Integer((((Integer)other.digits.get(i)).intValue() + carry) % 10));
         carry = (((Integer)other.digits.get(i)).intValue() + carry) / 10;
         two.next();
    if(carry != 0){
         result.digits.addFirst(new Integer(carry));
    return result;
    } // end plus

    Use a debugger.
    Or put in some debugging statements.

  • Add and Remove rows

    Hi,
    I have 2 tables, and I needed to add/remove some rows from the first table to the second.
    I've followed the tutorial: Link: [Add and Remove from a List|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/927d8c3c-0a01-0010-57b4-e89f505e2bff] and it works great!
    But the user can add two or more times the same row, so I need to avoid that. The user should be able to add every row only once!!
    I thought about some condition on button Add (for example, disable the ADD button if the same row is present in both tables, but it didnt work).
    Any ideas to achieve that?
    Thanks in advance!
    Best Regards
    Marcelo.

    Hi again Ahmed
    I've solved my problem, but now I'm facing a new issue about the same topic. 
    Following your tips, I've found a solution, but now, I need to copy a complete field of a table to the data store.
    For example, my table has 4 field (country, key, name and city), and I need to copy ALL the key values to the data store. So, if I have 4 rows in the table, let's say "key1", "key2", "key3", "key4"
    I've reached a solution, but it involves to walk throught the entire table, selecting every row automatically (I use a spinner) and "copying" every key field of every row to the data store. When I say "copying" I mean adding it to the same virtual field of the data store, that is to say, concatenating the key values one after another.
    The problem arises when the table has more than 100 records, because 100 is the top value that a spinner can reach.
    Any ideas about can bypass that limit?
    Thanks in advance, your help is really appreciated.
    Best regards
    Marcelo

  • Help on Linked List

    Hey people, i need a small help on my linked list.
    Ok, what i'm trying to do is have a search function with a linked list using strings. First i will have a string, i will then compute the ASCII value for that and take MOD 71 lets say. For example, a string has an ASCII value of 216, MOD 71 of this gives me 3. I will then have an array of 71, and each array will point to a linked list. There will be as many linked list as there are of arrays (71). I will then store this string at index [3] in the linked list in which the array points to.
    My problem for now is, how do i for example create 71 linked list? So far i can create only 1. To create another is easy, but if i have 71 the code will be too much. Is there an iterator i could use that easily creates 71? Sorry about this, i'm not really good with linked list with Java. Anyway, here is what i have now :).
    public class MyLinkedListElement {   
            String string;
            MyLinkedListElement next;
            public MyLinkedListElement(String s) {   
                string = s;
                next = null;   
            public MyLinkedListElement getNext() {
                return next;       
            public String getValue() {
                return string;
    public class MyLinkedList {
        public static MyLinkedListElement head;
        public MyLinkedList() {   
            head = null;
       public static void addToHead(String s) {
            MyLinkedListElement a = new MyLinkedListElement(s);
            if (head == null) {
                head = a;
            } else {
                a.next = head;
                head = a;       
        public static void main(String[] args) {
              String[] arr = {"Bubble", "Angie", "Bob", "Bubble", "Adam"};
              for (int i = 0; i < arr.length; i++) {
                          addToHead(arr);
    MyLinkedListElement current = head;
    while (current != null) {
    System.out.println(current.getValue());
    current = current.next;
    }I can have an array of strings and easily add them to a linked list.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I am very confused now, i just need to store a string value inside an array of linked list. But i can't somehow do it. I am very close, i can store the value in a linked list but the array of linked list, this is what i have.
    public class MyLinkedListElement {   
            String string;
            MyLinkedListElement next;
            public MyLinkedListElement(String s) {   
                string = s;
                next = null;   
            public MyLinkedListElement getNext() {
                return next;       
            public String getValue() {
                return string;
    public class MyLinkedList {
        public MyLinkedListElement head;
        public MyLinkedList() {   
              head = null;
        public void addToHead(String s) {
             MyLinkedListElement  a = new MyLinkedListElement(s);
             MyLinkedList[] arrayOfLinkedLists = new MyLinkedList[71];
             for(int i = 0; i < arrayOfLinkedLists.length; i++) {
                 arrayOfLinkedLists[i] = new MyLinkedList();
             if (head == null) {    
                 head = a;
             } else {
                 a.next = head;
                 head = a;       
        public void print(MyLinkedListElement current) {
              while (current  != null) {
                    System.out.println(current.getValue());
                    current = current.next;
        public static void main(String[] args) {
              String[] arr = {"Bubble", "Angie", "Bob", "Bubble", "Adam"};
              MyLinkedList listInstance = new MyLinkedList();
              for (int i = 0; i < arr.length; i++) {
                    listInstance.addToHead(arr);
    MyLinkedListElement current = listInstance.head;
    listInstance.print(current);

  • Help with Library link lists ..

    Hi ,
    I am working with Scott Mazur on a incorporating 8.1.7 in our code bace for our next product release. I am having problems with defining the library link list needed for builds. In the documentation it makes referance to $ORACLE_HOME/precomp/demo/proc which I cannot find. I have installed the 8.1.7 on 3 platforms (Solaris, AIX and NT ) and none of the system have this information. Can you please point me to where I may find some help in this area. We are in a critical path right now so I would appreciate any help you could give me. The sooner the better.
    Thank you for your time and help ,
    Cheryl Pollock
    Lockheed Martin Global Telecommunications .
    Formtek
    Pittsburgh office .
    (412) 937-4970
    null

    You actually shouldn't try to get the library link lists directly. Rather, you should use the $ORACLE_HOME/rdbms/demo/demo_rdbms.mk makefile like this:
    make -f $ORACLE_HOME/rdbms/demo/demo_rdbms.mk build EXE=yourexecutable OBJS="object list"
    where yourexecutable is the name for your executable and the OBJS= includes a quoted list of all your object and library files.
    null

  • Linked lists understanding help

    Hi I am having problems trying to understand linked lists.
    For example in the following code:
    public class LinkDouble
       private double dData;               // data item
       private LinkDouble next;                  // next link in list
       private LinkDouble previous;              // previous link in list
       public LinkDouble(double d)
                    dData = d;
       public void setDData(double dData)
                    this.dData = dData;
       public double getDData()
                     return dData;
       public void setNext(LinkDouble next)
                     this.next = next;
       public LinkDouble getNext()
                     return next;
       public void setPrevious(LinkDouble previous)
                     this.previous = previous;
       public LinkDouble getPrevious()
                     return previous;
       public void displayLink()
                     System.out.print(dData + " ");
       }For example this part:
    private LinkDouble next;
    How can you create an object next using the object its in?
    Edited by: The_One on Sep 3, 2008 6:24 AM
    Edited by: The_One on Sep 3, 2008 6:25 AM

    The_One wrote:
    I tried playing around and changed the this and used a variable and the program works just fine. so there would be no point in using this, unless it just saves memory?
    You really need to read those tutorials I linked to some time ago.
    >
    Yes i get how a linked list works. So a node has data, a previous and next. But in my example why create the next and previous out of LinkDouble. Is that saying that for example:
    next contains a data item of the object LinkDouble, and same for previous?It's saying that the next and previous attributes are of type LinkDouble. The intent is to have the next attribute for the current instance refer to the next LinkDouble in the list, and the previous attribute for the current instance refer to the previous LinkDouble in the list.
    >
    Edited by: The_One on Sep 3, 2008 7:35 AM
    Edited by: The_One on Sep 3, 2008 7:44 AM

  • List used to add permissions to InfoPath form updated, but people removed from the list still getting permissions.

    I have a list that gives users Contribute permission to an InfoPath form during a workflow action. This list has changed, and I have added and removed users from it. The people who I've added are getting permissions, but the people I removed are STILL getting
    permissions, even though they are nowhere on the list. What could be happening? I would greatly appreciate any help!
    Thank you,
    -Lyssa Prince

    I must not be explaining this very well, and I apologize for that.
    These are time sheets we're working with, so each user needs a certain set of people to approve and review his/her time sheets. The workflow we have running on each time sheet created reads which department the user is in, matches them with the row that
    contains the field "department" that matches their department, and gives permission to all of the users in the remaining fields TS Approvers and TS Reviewers. If I update these fields at all, the new users in these fields get permissions for that department's
    time sheets, but the people I removed from these fields do not stop getting permissions. It's as if there is a cached copy of the list which is being used by the workflow to assign permissions. This list will fluctuate, so it is not a viable solution to keep
    running powershell scripts to remove people from each of these items after they have been removed from the list.

  • Report ID94 specific software registered with Add or Remove Programs = requested software not listed

    Hi All,
    Our company uses SCCM 2007 and we don't really have an SCCM officer here. I kind of try to get things done by googling a lot but for this i can't find a a solution so i open a thread.
    I'm a newbie to SCCM 2007 so I don't know if i'm about to ask a dumb question but here I go.
    I'm trying to pull out a report for the count of computers that run a desktop version of our Ticketing Tool.
    I found the perfect standard report for this in SCCM 2007 which is: Count of instances of specific software registered with Add or Remove Programs.
    in there i have to set two values: 1) the software that i'm willing to count, 2) the collection in which to search.
    for value number 2 I have no problems.
    my problem is in value number 1. When I click the value button to list all known software, he lists all software in a alphabetic way. problem is that it stops at letter "I"... the software i'm looking for starts with an O so it's not listed.
    also if I type the software and then click Values... it replies that it couldn't find the software.
    am I doing something wrong?

    it sound like you are using the filter option with in the old and "crappy" ASP reports. first you should stop using then and only  use the SSRS reports. secondly the filter option will only show the first 1000 rows, there is a reg key to
    allow it to show more.
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

  • How do you add and remove links to websites in folders on Safari?

    How do you add and remove links to websites in folders on Safari?

    For clarification, works like a bookmark of website only it is listed in toolbar with "Most Visited", "Latest Headlines", "News", and "Popular".  I have done it before but can't find it for the life of me.
    Thanks!

  • Add/remove view links at runtime !?

    Hi,
    how can i add/remove a view link to an already published RowSet and make the RowSet adapt to the new condition ??? (without loosing it's own linked Details)
    The scenario: I have lot's of details which are linked to the same master. I remove the details from the session (sessionInfo.removeRowSet) when I don't need them to keep the active number of views in the session as small as possible ! When removing the Details from the Session I also have to remove their links to the master (to avoid exceptions). Further I want to establish the links again when the detail is added to the session again !?
    I add links before publishing:
    ViewLinkInfo view_12aLink = new ViewLinkInfo(master, "package1.LinkDef");
    view_12a.addMasterLink(view_12aLink);
    I can remove links after publishing with:
    view_12aLink.removeViewLink(sessionInfo1.getApplicationModule());
    but how to establish the link again ?:
    ApplicationModule appMod = ....;
    ViewObject vo = appMod.findViewObject(view_12a.getQueryInfo().getName());
    view_12aLink.createViewLink(appMod,vo);
    doesn't work !
    if (view_12a.isOpen())
    view_12a.close();
    view_12a.addMasterLink(view_12aLink);
    works !, but all the links where view_12a is master are broken !!!!
    So what to Do ????
    Thanks for every answer !
    null

    Your results are as expected per the imlementation. Basically you've established (two) ViewLinks between two sets of two instances of VOs.
    Now you try and get an accessor to return a set of details. You need to establish a link between that detail set and it's details to use the accessor on the second detail to get the desired results. Basically you've to establish the chaining between appropriate instances of VOs and not just the outer VOs or VO members of your AM.

  • How to remove Java Applications from "Add and Remove Programs" list?

    I have deployed my Java applications (both JWS and Applet) via JNLP with allow-offline option enabled and without installer-desc option specified.
    My questions are:
    1. An entry is added to the Add and Remove Programs list after launching the application via JNLP. Is it due to the specification of JNLP or JWS? Is there anyway to prevent this behavior?
    2. I removed my application by clearing the cache via Java Control Panel but the entry for the application is still listed in Add and Remove Programs. How can I remove the entry in the Add and Remove Programs?
    I have tried following methods but neither works:
    1.Go to Add and Remove Programs, and click [remove] button to the right of my application.
    *Warning message like 'Application cannot be uninstalled completely' is thrown.
    2.Follow instructions listed @ [Microsoft Online Support site|http://support.microsoft.com/kb/314481/en-us] to remove my application manually via Windows registry.
    *Couldn't find appropriate registry entry to delete.
    Thanks in advance!

    Hi, guys!
    This issue has been officially approved as a new bug (Bug Id: 6946221) for the JDK 1.6_20(might include any release below) release.
    It will take a couple of days for it to be shown up in the external Bug database. However, once it becomes available for viewing on external Bug database.I would like to encourage your valuable participation to vote on this bug to get it fixed ASAP by the SUN developer teams.
    Java Bug Database @
    [http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6946221|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6946221]
    Voting for the bug @
    [http://bugs.sun.com/bugdatabase/addVote.do?bug_id=6946221|http://bugs.sun.com/bugdatabase/addVote.do?bug_id=6946221]
    Thank you for your cooperation!
    Edited by: Jay-K on Apr 23, 2010 12:14 AM

  • Remove "(More Links...)" from List View Webpart if the list view shows all items

    Hi, I currently have 5 links lists out of which 4 links lists have around 30 odd list items and the rest 1 have just 3 list items. All of this links list are added as ListViewWebPart on a wiki page. All these listview web parts are configured for "Summary
    Toolbar"  and show all the items within the list. 
    My question is, even if the listview web parts are configured to show "All Items" why is it that the ListViewWebPart shows "More Links" on the bottom of the web parts? Is there any OOB way to remove it. I don't want to customize using SPD nor i want to export
    web parts. 
    Thanks, Mayur Joshi

    This, right here, is an example of one of the most annoying things about Microsoft. On the one hand, Microsoft keeps pushing code-free solutions; they want to make it easier and easier for "Content Managers" to manage their own SharePoint sites, Excel spreadsheets,
    etc. etc. without having to bother developers. I am with them on this, to a point. However, they also want to HARD-CODE their options so you HAVE TO USE an OOTB solution to hide it! What is wrong with letting us change the settings of the Web Part, or the
    View, to turn off "More Links"? Why do I have to go to JQuery, or SharePoint Designer? WHY??? Give us an OOTB solution for things like this!
    UPDATE: Here is a fix, but it does require CSS. Add a Content Editor Web Part with this code. The (More Links...) and (More Announcements...) tags both use the id "onetidMoreAnn". You can then export the CEWB as a Web Part and drop it on every page. 
    Again, I would like an OOTB solution, but this will have to do.
    <style>
    #onetidMoreAnn
    DISPLAY: none
    </style>

Maybe you are looking for

  • I just upgraded an old Imac from Leopard to Snow Leopard, now it won't work

    I just upgraded my 2003 imac from leopard to snow leopard and after restart all I get is a blue screen.  Nothing happens.  How can I get back to the old leopard.  I use this computer for research just because of the 23'' screen.  Help

  • Reading DVDs but not CDs

    I'm having the same problem. I have tried repairing disk permissions, as well as a cleaning disc... but to no avail. Someone please help. I can't afford to replace my optical drive.

  • Update TOC, with .eps files connected in the same TOC

    HI, I want to update TOC, and i am unable to do it as .eps files are followed by main TOC. if the TOC is already created - which file to be added to pragraph tag in add table of content dailogue box. How to recongize which paragph tags were previousl

  • Please help me with my phone, i am willing to pay you.

    I have like 200 games and programs as total on my phone.. And it lags very much when i start it.. and i cannot delete any games or program becaouse it have duplicated to 2 or very many programs!!!! its on my memory card.. and i dont know how to forma

  • Adding and deleting music via itunes

    i recently bought a 4 gig nano after using sandisk mp3 players for years and im trying to get use to itunes. how do i delete and add music via itunes?