Question: For each skyscraper read from the input file your program should first print that skyscraper, but with a space before the clues for the columns.

For each skyscraper read from the input file your program should first print that skyscraper, but with a space before the clues for the columns. There should NOT be spaces between any of the clues or skyscraper building heights.
After printing the skyscraper you should print either the word VALID if the clues for that skyscraper were met or the words NOT VALID otherwise. VALID or NOT VALID (ALL CAPS REQUIRED) should occur on the line immediately following the skyscraper and should be followed by a newline/carriage return (
). Based on the second example input file above your output should look like this:
3221
313241
221432
142313
234122
2133
VALID
1234
313241
221432
142313
234122
2133
NOT VALID
COMPLETED PROCESSING SKYSCRAPERS
Note: the first and last line of each skyscraper have a space in front.
In the Skyscraper class, you will need to provide at least four public static methods as following:
Method Description
int[][] getSkyscrapers(Scanner) The public static method use the Scanner parameter passed in the method to read skyscrapers from standard input into 2D array. The array should be 6 x 6, and each corner should be set to 0.
boolean validateSkyscrapers(int[][]) The public static method validates the 2D array that read from standard input.
true if the grid is valid
boolean if the grid is not valid
void printSkyscrapers(int[][] grid, boolean validity) The public static method validates the 2D array that read from standard input.
true if the grid is valid
boolean if the grid is not valid
void main(String[] args) The public static main method will run the workflow of the program.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!