Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a Driver program which: Reads in the data from a file called: numbers.txt The numbers from the file should be stored into an ArrayList...

Create a Driver program which:

Reads in the data from a file called: numbers.txt The numbers from the file should be stored into an ArrayList... A sample version of this file has been provided, but the one being tested with may have between 1 and 10000 numbers.

Generate the same number of random boolean values as the number of integers stored in the ArrayList you just filled. These boolean values should be stored in an array which is the SAME LENGTH as your ArrayList.

Use a loop to go through your data. Consider the elements which share the same index location and update the appropriate counter for each of these four situations (you should have 4 counters):

The number at the current index from the ArrayList is even and the boolean at the current index from the array is true

The number at the current index from the ArrayList is even and the boolean at the current index from the array is false

The number at the current index from the ArrayList is odd and the boolean at the current index from the array is true

The number at the current index from the ArrayList is odd and the boolean at the current index from the array is false

After processing your data, determine which of the above counters is largest and print the EXACT message from below which corresponds correctly to situation (note: in the case of ties, print all of the messages which are tied):

"There is a lot of data which is EVEN at the same index where a True is"

"There is a lot of data which is EVEN at the same index where a False is"

"There is a lot of data which is ODD at the same index where a True is"

"There is a lot of data which is ODD at the same index where a False is"

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

Step: 3

blur-text-image

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

What are the categories protected under copyright laws?

Answered: 1 week ago

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago