Csc241: Lab 1

  1. Log into this account using login/password given to you.
  2. Start the firefox browser (it's on the top panel). Enter the course URL
    http://www.cs.wcupa.edu/rkline/csc241
    
    Bookmark this page for future reference. Open the browser to Array Lists document.
  3. Start up NetBeans: Applications Programming NetBeans IDE
  4. When NetBeans starts up, you'll want to kill all the windows except the Projects window on the left. Any window can be invoked again as needed through the Window menu.
The next steps detail the "working through" of the Array Lists document.
  1. Right-click on the Projects window. Select New Project Java Java Application, then Next. Give it the name AListDemo. Keep all the default settings. Click Finish.
  2. Copy/Paste the code from alistdemo.Main in the ArrayList First Example section into the Main class you just created (overwriting what was there).
  3. Run the project. The green triangle icon will achieve this. Compare the output to the code which generated it to try and fully understand the operations. When you're done, kill the Output window (it will be recreated as needed).
  4. Go to the Strings from a website section. Right-click on the Source Packages line and select New Java Class. Enter the information in the appropriate fields:
    Class Name: DocCatcher
    package:    util
    
    Then Cut/Paste from util.DocCatcher code into the class you just created.
  5. Repeat the previous step for:
    Class Name: WordProcess
    package:    util
    
  6. Scroll down to find the Revised main function subsection and follow the instructions to run the main2 function.
  7. Continue into the AListAdapter and ArrayList Implementation sections. As above, do the create/copy/paste operation in order to create these two implementation classes:
    Class Name: AListAdapter
    package:    alist
    
    and
    Class Name: AList
    package:    alist
    
    Then follow the instructions in the Test Drive subsection to make sure that these classes work.
The next steps try to help you understand how the AList implementation class "really works."
  1. Reset the main function so that it calls main1 and make sure we're using our implementation:
    List<String> L = new AList<String>();
    
  2. Observe the comments at the bottom of AList.java:
    /*
    */
    
    Also observe the position markers, for n = 1, 2, 3, 4, 5:
    // Position n /*
    
  3. One at at time do the following:


© Robert M. Kline