Question
1. Create a new text file called assignment4data.txt in your c:Temp directory (or anywhere else that is convenient). 2. Copy the following matrix to the
1. Create a new text file called "assignment4data.txt" in your c:\Temp directory (or anywhere else that is convenient).
2. Copy the following matrix to the file, then save and close it.
2 5 -3 9 6 12 -7 0 4 6 13 -3 0 0 7 18
3. Write a program that uses a Scanner and PrintWriter to read and write to this file.
4. Open the text file and read the data from the file into a 4x4 integer array.
5. Find the transpose of the array.
6. Print the original and the transposed array on the console.
7. Print the original and then the transposed array to the text file.
After executing the program your text file should look like this:
2 5 -3 9 6 12 -7 0 4 6 13 -3 0 0 7 18
2 6 4 0 5 12 6 0 -3 -7 13 7 9 0 -3 18
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started