Prg 421 Week 2 Individual Assignment Research

Week 1 –Writea Java program (non-GUI preferred) to demonstrate the Singleton pattern.The key parts of the singleton pattern are:A private static variable to store the single instance called the singletonA public static method for callers to get a reference to the instanceA private constructor so no callers can instantiate the object directlyUsingthese key parts, write a Java program that will allow a user of the program to assign only one runner to each of the 8 lanes of running track in a field.Includea brief documentation (in the code or in a separate document) to explain the input (if any), processing and output of the program.Week 2 - Writea Java program (non-GUI preferred) to demonstrate the use of an ArrayList.The program should allow a user to do the following:Add, edit, delete different types of animalsSelect an animal, and the corresponding characteristics will be displayed (such as color, vertebrate or invertebrate, can swim, etc.)The program must use ArrayList(s) to work with these animal objects.

Write a Java program (non-GUI preferred) to demonstrate the use of an ArrayList.
The program should allow a user to do the following:

  • Add, edit, delete different types of animals
  • Select an animal, and the corresponding characteristics will be displayed (such as color, vertebrate or invertebrate, can swim, etc.)
  • The program must use ArrayList(s) to work with these animal objects.

Include a brief documentation (in the code or in a separate document) to explain the input (if any), processing and output of the program.

Submit your assignment using the Assignment Files tab above.



This slideshow requires JavaScript.


This assignment includes a zip file.

  • Attachments
    • PRG421_Week_2_Individual_Assignment.zip (149.31 KB)
      • java code
      • Netbeans project
        • PRG421_Week_2_ArrayList
          • build
            • classes
              • .netbeans_automatic_build
              • .netbeans_update_resources
              • Animal.class
              • PRG421Week2.class
          • build.xml
          • manifest.mf
          • nbproject
            • build-impl.xml
            • genfiles.properties
            • private
            • project.properties
            • project.xml
          • src
          • test
      • PRG421-Week-2-Individual-Assignment-Screenshot-1.png
      • PRG421-Week-2-Individual-Assignment-Screenshot.png

    Preview random excerpt

    }

    xxxxxx xxxxxx(xxxxxx _xxxx, xxxxxx _xxxxx, xxxxxxx _xxxxxxx) {

    xxxxxxx(_xxxx);

    xxxxxxxx(_xxxxx);

    xxxxxxxxxx

    (_canSwim); }

    xxxxxx

    xxxxxx

    getType() {

    xxxxxx

    type; } public String getColor() {

    xxxxxx

    xxxxx

    ; }

    xxxxxx xxxx xxxxxxx(xxxxxx _xxxx) {

    xxxx.xxxx = _xxxx;

    - - - more text follows - - -

    Preview random excerpt

    xxxxxxx xxxxxx xxxx xxxxxxxxxx(xxxxxx x, xxxxxx xxxx, xxxxxx xxxxx, xxxxxxx xxxxxxx) {

    x.xxxxxxx(xxxx);

    x.xxxxxxxx(xxxxx);

    x.xxxxxxxxxx(xxxxxxx);

    }

    xxxxxxx

    static void deleteAnimal(

    xxxxxx

    x

    ) {

    xxx

    index =

    x

    ; for (Animal

    xx

    :

    xxxxxxx

    ) {

    xx

    (an.getCanSwim() == a.getCanSwim() &&

    xx

    .getColor().

    xxxxxx

    (

    x

    .getColor()) &&

    xx

    .getType().equals(a.

    xxxxxxx

    ())) {

    xxxxx

    ; }

    xxxx

    xxxxx

    ++; }

    xxxxxxx.xxxxxx(xxxxx);

    }

    - - - more text follows - - -

    Preview random excerpt

    }

    xxxxxx xxxxxx(xxxxxx _xxxx, xxxxxx _xxxxx, xxxxxxx _xxxxxxx) {

    xxxxxxx(_xxxx);

    xxxxxxxx(_xxxxx);

    xxxxxxxxxx

    (_canSwim); }

    xxxxxx

    xxxxxx

    getType() { return type; }

    xxxxxx

    String getColor() {

    xxxxxx

    color; }

    xxxxxx xxxx xxxxxxx(xxxxxx _xxxx) {

    xxxx.xxxx = _xxxx;

    - - - more text follows - - -

    Preview random excerpt

    xxxxxxx xxxxxx xxxx xxxxxxxxxx(xxxxxx x, xxxxxx xxxx, xxxxxx xxxxx, xxxxxxx xxxxxxx) {

    x.xxxxxxx(xxxx);

    x.xxxxxxxx(xxxxx);

    x.xxxxxxxxxx(xxxxxxx);

    }

    xxxxxxx

    xxxxxx

    void

    xxxxxxxxxxxx

    (Animal a) {

    xxx

    index =

    x

    ;

    xxx

    (Animal

    xx

    : animals) {

    xx

    (

    xx

    .getCanSwim() ==

    x

    .

    xxxxxxxxxx

    () &&

    xx

    .

    xxxxxxxx

    ().equals(a.getColor()) &&

    xx

    .getType().

    xxxxxx

    (a.

    xxxxxxx

    ())) {

    xxxxx

    ; }

    xxxx

    xxxxx

    ++; }

    xxxxxxx.xxxxxx(xxxxx);

    }

    - - - more text follows - - -



Purchasing Instruction
List Price:$15

Buy More Save More
Buy at least TWO items & save up to 30% OFF your ENTIRE order!
Rack up instant rebates in your shopping cart. Simply add items to your cart, and see the savings add up.
Discounts will automatically be applied on eligible orders.

0 comments

Leave a Reply

Your email address will not be published. Required fields are marked *