Discussion on Arrays and Lists

The program is designed to iteratively capture the name of students. The program makes use of an ArrayList data structure that implements the List interface to allow the user to enter an arbitrary number of students into the program. Through using a loop, the program allows a user to perform the same operation a given number of time (Langsam, Augenstein & Tenenbaum, 2003). In this specific instance, the loop allows the entry of the student name the specified number of times. The program allows the user to specify the number of students, after which a counter is set and the program performs the operations necessary to capture the specified number of users. This is a good coding practice since it eliminates the possibility of errors in code.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

The second good coding practice seen in this code lies in the use of an ArrayList. This data structure allows for the storage and manipulation of data collections without prior need for establishing the length. If an array had been used in a similar instance, then the array length would have had to be predetermined (Riley, 2003). In this instance, the use of an array to store student names would have necessitated the declaration of the number of elements the array was to hold. This would have been fine for say a class with a known number of student, but an inherent limitation emerges. The limitation arises from the fact that the code would not be used for any other class, except if it had the same number of students (Sierra & Bates, 2005). The code might be applied to cases where the number of students was less than that of the length of the array which case it would waste memory. Evidently, the use of ArrayLists presents a good coding practice.

References

Langsam, Y., Augenstein, M., & Tenenbaum, A. (2003). Data structures using Java. Upper Saddle River, N.J.: Pearson Prentice Hall.

Riley, D. (2003). The object of data abstraction and structures using Java. Boston: Addison Wesley.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Sierra, K., & Bates, B. (2005). Head first Java. Sebastopol, CA: O’Reilly

Place your order
(550 words)

Approximate price: $22

Homework help cost calculator

600 words
We'll send you the complete homework by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 customer support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • 4 hour deadline
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 300 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more