Question: Objectives: Arrays and Array Lists are both used in java. Using one or the other can be beneficial between what tasks you are trying to

Objectives: Arrays and Array Lists are both used in java. Using one or the other can be
beneficial between what tasks you are trying to achieve. After completing this
assignment, students will be able to:
Declare an Array and Array List
Implement storage of data into Array and Array List
Managing data in an Array and Array List
Task Description: A dictionary company wants to have a program to keep track of all
words in their dictionary that are palindromes. A palindrome is a word or string that is
written the same way forward and backward. Examples of this would be kayak,refer,
rotator, and pop. The company wants to be able to give the program a text file full of
words words.txt and wants a result displayed in the console and a file written with
only palindromes arraypalindrome.txt and arrayListpalindrome.txt.
As a programmer, you want to determine if creating this program will be more efficient
as an array or an array list. You decide to experiment by storing data in an Array and an
ArrayList.
Create 4 methods: readFile(), appendToFile(), determinePalindrome(),
and getSizeFile().
readFile(): Read in the file and store words into both data structures.
appendToFile(): Append palindrome words to the end of each file.
determinePalindrome(): checks if a word is a palindrome or not.
getSizeFile(): Gets the number of lines in the file. Used for array size.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!