Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 newlinecarriage return
Based on the second example input file above your output should look like this:
VALID
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 getSkyscrapersScanner The public static method use the Scanner parameter passed in the method to read skyscrapers from standard input into D array. The array should be x and each corner should be set to
boolean validateSkyscrapersint The public static method validates the D array that read from standard input.
true if the grid is valid
boolean if the grid is not valid
void printSkyscrapersint grid, boolean validity The public static method validates the D array that read from standard input.
true if the grid is valid
boolean if the grid is not valid
void mainString args The public static main method will run the workflow of the program.
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