Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago