Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need help fixing errors in line 14, 19, 23, 24, 26, 27, 28, 29, 32, 33, 44, 45, 46, 48, 50, 52, 53, 56,

i need help fixing errors in line 14, 19, 23, 24, 26, 27, 28, 29, 32, 33, 44, 45, 46, 48, 50, 52, 53, 56, 60, and 63? please
image text in transcribed
image text in transcribed
Write a program that reads text from a file. Create a 2-dimensional character array that is 6 7. Store the characters read in your array in row major order (fill row O first, then row 1, etc.). Fill any unused spaces in the 2-D array with the character. - Variables test2.java 3 Breakpoints of Expressions 1 import java.io.File; 2 import java.io.FileNotFoundException: 3 import java.util.Scanner; Sila progran that reads text from a file 6 public class test2 public static void main(String'1 args) { File tale = new File"/users/ranonseto/Desktop/Programming 101/weeke/It was a bright .txt"); 10 // create a 2-dimensional character array that is 6.7 (6h by 7) char array(1 1) = new char [6] [7]; W/ FALL any unused spaces in the 2-0 array with the character. for (int i = 0; i 11 12 13 14 15 Scanner sc = new Scanner(file); String content while (sc. hasNextLine()) { content +sc.nextLine(): > sc.close(); System.out.println("Content in the text file " content); int index = 0; 29 System.out.println(" 6 X 7 Two Dimensional Array "); 30 / Store the characters read in your array in row major order (fili row o first, then row 1, etc.) 31 // If you have more characters than space, ignore the excess characters for (int i = 0; 1 System.out.println(" Extract characters and display new string "); 51 // Extract the characters from your array in column-major order (putt from columne first, then cotumn 1, etc.) 52 for (int i = 0; i 58 // Display the new string. System.out.println("Output string: " + output); 60 catch (FileNotFoundException e) { e.printStackTrace(); } > 43 44 45 46 47 49 49 50 2. Write a program that reads text from a file. Create a 2-dimensional character array that is 6* 7. Store the characters read in your array in row major order (fill row O first, then row 1, etc.). Fill any unused spaces in the 2-D array with the *** character. If you have more characters than space, ignore the excess characters. Extract the characters from your array in column-major order (pull from column O first, then column 1, etc.). Build a new string as you extract the characters. Display the new string. Here is an example for the input string It was a bright cold day in April, and the clocks were striking thirteen. t 1 + Output string: IatdAat apn bcyrdwro i aililtsgdn, h h e

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2019 Wurzburg Germany September 16 20 2019 Proceedings Part 2 Lnai 11907

Authors: Ulf Brefeld ,Elisa Fromont ,Andreas Hotho ,Arno Knobbe ,Marloes Maathuis ,Celine Robardet

1st Edition

3030461467, 978-3030461461

More Books

Students also viewed these Databases questions

Question

4. Show the trainees how to do it again.

Answered: 1 week ago