The file transactions.txt contains rows of transactions. Each transaction (row) consists of a start month, end month and name. Each of these three values is a String. In the following tasks you are asked to read and store the transactions from the file and determine if there are any duplicate transactions. A transaction is a duplicate if all three values are the same as the three values of any other transaction. a. add code to your main method that reads the content of transactions.txt and stores it in a two-dimensional String array. The name of the String array is your choice. Note that you may not assume that the number of rows in transactions.txt will always be the same. However, you may assume that there will always be three String values on a single row. The first dimension of your two-dimensional array must be resized dynamically each time a new record is read (Hint: we did this in class with a single dimensional array and this is very, very similar). Your code will be evaluated with rows in transaction.txt that you have not seen. b. Create a method named checkForDuplicates that returns a boolean and accepts a twodimensional ‘String1 array as an argument. c. In checkForDuplicates check to see if any two rows of the two-dimensinal array provided as an argument to the method are the same. You must use at least one enhanced for-loop in this method. Return true if ANY two equivalent rows are found and false otherwise. d. In the main method call checkForDuplicates with the two-dimensional array containing the transactions data read from transactions.txt. Print a message to the console indicating whether any duplicate transactions exist in transactions.txt.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

The file transactions.txt contains rows of transactions. Each transaction (row) consists of a start month,
end month and name. Each of these three values is a String.
In the following tasks you are asked to read and store the transactions from the file and determine if there
are any duplicate transactions. A transaction is a duplicate if all three values are the same as the three
values of any other transaction.
a. add code to your main method that reads the content of transactions.txt and stores it
in a two-dimensional String array. The name of the String array is your choice. Note that you may
not assume that the number of rows in transactions.txt will always be the same. However, you
may assume that there will always be three String values on a single row. The first dimension of your
two-dimensional array must be resized dynamically each time a new record is read (Hint: we did this
in class with a single dimensional array and this is very, very similar). Your code will be evaluated
with rows in transaction.txt that you have not seen.
b. Create a method named checkForDuplicates that returns a boolean and accepts a twodimensional ‘String1 array as an argument.
c. In checkForDuplicates check to see if any two rows of the two-dimensinal array provided as an
argument to the method are the same. You must use at least one enhanced for-loop in this method.
Return true if ANY two equivalent rows are found and false otherwise.
d. In the main method call checkForDuplicates with the two-dimensional array containing
the transactions data read from transactions.txt. Print a message to the console indicating whether
any duplicate transactions exist in transactions.txt.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education