Program 3 - AsciiArt.ZIP

Program 3 - AsciiArt

Write a noninteractive program titled "YourLastName_AsciiArt" that reads in lines of text from a file then prints out the text with different transformations around the vertical, horizontal, and diagonal axis. The program will accomplish this by reading in the text as a rectangular block of data into a 2D array of characters (char[][]).
The program will create only one 2D array and will not copy from one array to another. The dimensions of the 2D array will be contained in the first line of the input file, row first and then columns.
For example, here is the contents of an input file ready for the program:
5 4
FILE
WITH
SOME
MORE
INFO
After reading in the text from the file, the program will "traverse" the rows and columns of the array (with nested for-loops) and print out the array in the proper order to do the following transformations shown in the example below.
The following shows an example interaction captured in a file by the command “% script AsciiArt.out”:
Script started on Thu Sep 26 10:23:58 2013
% java Diaz_AsciiArt
Original Text:
FILE
WITH
SOME
MORE
INFO
Transformations:
INFO
MORE
SOME
WITH
FILE
ELIF
HTIW
EMOS
EROM
OFNI
OEEHE
FRMTL
NOOII
IMSWF
% exit
script done on Thu Sep 26 10:24:17 2013
Run the program with all different input files provided and capture all interaction in a file using the script command.
What to turn in:
- Soft copy of the script command (using Blackboard)
- Soft copy of the program (submit your .java file using Blackboard
Powered by