Instructions for Part 2 In part 2 (and probably in every part) I'm going to use "matrix" and "two-dimensional array" interchangeably. In part 2 we will read in the data from file, prepare ThreadOperation for part 3 by adding inputs, and add another helper method to verify we can access the submatrices accurately. 1. Modify Threadoperation to take as input (through the constructor) two matrices and a quadrant indicator. The indicator could be a String, an int, an enum or a set of indexes. It's up to you. 2. Modify the main method to instantiate the four ThreadOperation objects with placeholder values to confirm that the code still runs without error. The placeholders are just example matrices and a quadrant indicator. 3. Write a static method named printSubmatrix that takes four integer indexes and a matrix and prints out the submatrix indicated by the indexes. 4. Create a matrix and use it to test printSubmatrix in main. Your print2dArray method from part 1 should come in handy for this. 5. The filename should be given through the command prompt and passed into main via String[] args 6. Open and connect to the file using a Scanner. 7. Read in the number of rows and columns and save these in local variables in main. 8. Read in the first and second matrices (two-dimensional arrays) from the file. I recommend writing a method to accomplish this task and calling the method twice (once for each matrix). Consider using this method header:
Instructions for Part 2 In part 2 (and probably in every part) I'm going to use "matrix" and "two-dimensional array" interchangeably. In part 2 we will read in the data from file, prepare ThreadOperation for part 3 by adding inputs, and add another helper method to verify we can access the submatrices accurately. 1. Modify Threadoperation to take as input (through the constructor) two matrices and a quadrant indicator. The indicator could be a String, an int, an enum or a set of indexes. It's up to you. 2. Modify the main method to instantiate the four ThreadOperation objects with placeholder values to confirm that the code still runs without error. The placeholders are just example matrices and a quadrant indicator. 3. Write a static method named printSubmatrix that takes four integer indexes and a matrix and prints out the submatrix indicated by the indexes. 4. Create a matrix and use it to test printSubmatrix in main. Your print2dArray method from part 1 should come in handy for this. 5. The filename should be given through the command prompt and passed into main via String[] args 6. Open and connect to the file using a Scanner. 7. Read in the number of rows and columns and save these in local variables in main. 8. Read in the first and second matrices (two-dimensional arrays) from the file. I recommend writing a method to accomplish this task and calling the method twice (once for each matrix). Consider using this method header:
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter18: Stacks And Queues
Section: Chapter Questions
Problem 16PE:
The implementation of a queue in an array, as given in this chapter, uses the variable count to...
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
Knowledge Booster
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.Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning