Objectives: This assignment will assess your mastery of the following objectives Wite a functionally comect program to p

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Objectives: This assignment will assess your mastery of the following objectives Wite a functionally comect program to p

Post by answerhappygod »

Objectives This Assignment Will Assess Your Mastery Of The Following Objectives Wite A Functionally Comect Program To P 1
Objectives This Assignment Will Assess Your Mastery Of The Following Objectives Wite A Functionally Comect Program To P 1 (46.29 KiB) Viewed 38 times
Objectives This Assignment Will Assess Your Mastery Of The Following Objectives Wite A Functionally Comect Program To P 2
Objectives This Assignment Will Assess Your Mastery Of The Following Objectives Wite A Functionally Comect Program To P 2 (46.3 KiB) Viewed 38 times
Objectives This Assignment Will Assess Your Mastery Of The Following Objectives Wite A Functionally Comect Program To P 3
Objectives This Assignment Will Assess Your Mastery Of The Following Objectives Wite A Functionally Comect Program To P 3 (58.65 KiB) Viewed 38 times
Objectives This Assignment Will Assess Your Mastery Of The Following Objectives Wite A Functionally Comect Program To P 4
Objectives This Assignment Will Assess Your Mastery Of The Following Objectives Wite A Functionally Comect Program To P 4 (58.65 KiB) Viewed 38 times
Objectives This Assignment Will Assess Your Mastery Of The Following Objectives Wite A Functionally Comect Program To P 5
Objectives This Assignment Will Assess Your Mastery Of The Following Objectives Wite A Functionally Comect Program To P 5 (50.58 KiB) Viewed 38 times
Objectives This Assignment Will Assess Your Mastery Of The Following Objectives Wite A Functionally Comect Program To P 6
Objectives This Assignment Will Assess Your Mastery Of The Following Objectives Wite A Functionally Comect Program To P 6 (36.02 KiB) Viewed 38 times
Objectives This Assignment Will Assess Your Mastery Of The Following Objectives Wite A Functionally Comect Program To P 7
Objectives This Assignment Will Assess Your Mastery Of The Following Objectives Wite A Functionally Comect Program To P 7 (51.16 KiB) Viewed 38 times
Objectives This Assignment Will Assess Your Mastery Of The Following Objectives Wite A Functionally Comect Program To P 8
Objectives This Assignment Will Assess Your Mastery Of The Following Objectives Wite A Functionally Comect Program To P 8 (62.34 KiB) Viewed 38 times
Objectives: This assignment will assess your mastery of the following objectives Wite a functionally comect program to produce specified console output -Usenested for loop to check the content in the 20 may Operate the fie VO (nputoutput) to read data from and write to file using Scanner cless Follow prescribed conventions for spacing, indentation, naming mathods, and header comments Rules and Explanations: Skyscraper is a puzzle where integer values from 1 through are used to represent the height of skyscrapers on a 4 by 4 city grid, where a building of height 1 is the shortest. The outside of the 4 by 4 grid contain clue v These values a range from 1 through 4 and represent the number of buildings that from a given now or column in the city g can be s 2 Each row and column of the city grid must not contain two buildings that are the same height for a solution to be vald More specifically, each row and column must contain buildings with heights 1 through The rules for the values in the skyscraper and are ae ke those of Sudoku, for those that have played that The image shows below on the left is an empty city grid with clues to the left with a completed city and to 2 the right that satses the clues given on the left Your task is to write a program that mads to an input the whose name is specified as a command In argument. The e will contain data - more complete skyscrapers including cues for each skyscraper must determine the skyscraper properly states the clues You do not have to worry puzzle The solution of the puzzle is also provided in the green about The dala newlinecanage As an example, the input file for the above example 1233 As an example, the input file for the above example looks like this 1235 143214 214323 232141 guaranteed to be well-foed, so no enor checking is required. The festine of data top clues for the 4 columns The second ine will start with the clue for the row right, flowed by the 4 skyscraper haights, flowed by the clue for that row looking Lines 3, 4, and 5 will be formatted as the 2. The final row will contain the bottom clues for vuswil be separated by a single space. Each the of data in the file will and with tum (es There will be no baling fines in the he 3312 Another example that has he skyscrapers the first one is valid but the second one 3221 313241 221432 142314 234322 2133 1234 313241 221432 142313 234122 61 22 1 13 2 3 2 1 N 1. 3-44- 1 no Ar printing the skyscraper you should print either the word VALID the clues for that skyscraper went 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 lowed by a newline/camage retum Or Based on the second example input the above your output should look like this 3223 313241 221432 142315 234322 2:33 VALID Ma --~-34~ 44 *** 2> 23> 2 For each skyscraper read from the input fe your program should first print that syscraper but with a space before the clues for the columns There should NOT be spaces between any of the clues or skyscraper building heights 4 Logout
VALID 3221 313241 221432 142313 234122 2133 NOT VALID 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 three methods as following Method Description public static ingetSkyscrapers public static boolean validateSkyscrapers public static void mainting ag Extra Credit: N/A The method use the Scanner parameter passed in the method to read skyscrapers from standard input into 20 way The method validates the 20 amay that read from standard input. The main method will run the workflow of the program Implementation Guidelines: The program does not compite will receive grade of cer Place your code in a class named Skyscraper and the class The class should contain a main method which should do the following for the Skyscraper 1. Check for the name of the input fie specified as a command line argument it the fe is not there print an amor message telling the program user the program must be run using the name of an input fie that contains skyscraper information as a command line argument. 2. Open the 3. Read from the t as long as there is skyscraper information-for each set of skyscraper data do the following Assion the class and scars at least one te dimensional way of ten Implementation Guidelines: The program does not compile will receive grade of ser Place your code in a class named Skyscraper and the class The class should contain a main method which should do the following for the Skyscraper class 1. Check for the name of the input file specified as a command ine argument. If the fie is not there print an emor message telling the program user the program must be nun using the name of an input the that contains skyscraper information as a commande argument 2. Open the fie 3. Flead from the file as long as there is skyscraper information-for each set of skyscraper dets do the flowing & Assign the clues and skyscraper heights into at least one two-dimensional amay of type in if you would like to have on amey for the clues and another for the skyscraper heights that is fin b. Pass the information just mead to a method called validateSkyscrapers. The method should examine the clues and the skyscraper heights and return true if the heights are valid based on the clue w e Print the skyscraper clues and heights in the format specified above along with a message about whether the heights a vald (as specified above. The code to do this should be placed in a method prekyscrapers which is passed whatever data you feel is necessary to print the required information Note the method printkyscrapers is optional to implement 4. Close the input f 5. Print a message that says "COMPLETED PROCESSING SKYSCRAPERS thout the qu 6. You are welcome to write helper methods to complete the tasks above-modular design is an important part of good software development sogour Be sure your code follows the naming and coding conventions for the class 1. Instance fields of a class should be named starting with y 2. Parameters to methods should be named starting with the 3. Parameters to methods should be specified i 4 Javadoc comments should be used for the class as well as the methods of the class 5. You will lose points for each of these things on every assignment if you do not adhere in th 6.See m
Background: The purpose of this assignment is to review lectures in 2D-array, nested for loops, file input (scanner). This assignment will give you practice working with single and multi- dimensional arrays as well as basic data structures. The students will also be able to develop and implement program involving the fundamental programming constructs such as variables, types, expressions, assignment, simple I/O, conditional and iterative control structures, functions and parameter passing, structured decomposition. Objectives: This assignment will assess your mastery of the following objectives: Write a functionally correct program to produce specified console output. Use nested for-loop to check the content in the 2D array. Operate the file I/O (input/output) to read data from and write to file using Scanner class. Follow prescribed conventions for spacing, indentation, naming methods, and header comments. Rules and Explanations: Skyscraper is a puzzle where integer values from 1 through 4 are used to represent the height of skyscrapers on a 4 by 4 city grid, where a building of height 1 is the shortest. The outside of the 4 by 4 grid contain clue values. These values also range from 1 through 4 and represent the number of buildings that 1 can be seen from a given row or column in the city grid. Each row and column of the city grid must not contain two buildings that are the same height for a solution to be valid. More specifically, each row and column must contain buildings with heights 1 through 4. The rules for the values in the skyscraper grid are a little like those of Sudoku, for those that have played that. The image shows below on the left is an empty city grid with clues to the left with a completed city grid to 2 the right that satisfies the clues given on the left. Vinalin to write r1 Assig.docx A nam that made from an inner fin whare nama in ennillad mo. command linn 2 2 10 3 kam 34 3 1 Bontir 2 4 3 1 2
Your task is to write a program that reads from an input file whose name is specified as a command line argument. The file will contain data on one or more complete skyscrapers (including clues). For each skyscraper, you must determine if the skyscraper properly satisfies the clues. You do not have to worry about how to solve the puzzle. The solution of the puzzle is also provided in the green cells. The data in the file is guaranteed to be well-formed, so no error checking is required. The first line of data for a skyscraper will be the top clues for the 4 columns. The second line will start with the clue for the row looking from left to right, followed by the 4 skyscraper heights, followed by the clue for that row looking from right to left. Lines 3, 4, and 5 will be formatted as line 2. The final row will contain the bottom clues fo the 4 columns. All values will be separated by a single space. Each line of data in the file will end with a newline/carriage return (n). There will be no trailing lines in the file. 2 2 As an example, the input file for the above example looks like this: 1233 143214 214323 232141 221432 3312 Another example that has two skyscrapers (the first one is valid but the second one) 3221 313241 221432 14231 4 234122 2133 1 2 3 4 313241 221432 142313 234122 H 13 B 3 1 14 21 3 2 ↑ 3 B3 KIN 2 لا - IN 3 3 3 2 14 4 3 1 2 1 4 TT 3 1 N 3 41 2
Hi + 2 1231 For each skyscraper read from the input file your program should first print that skyscraper, but with a space bore the clues for the columns. There should NOT be spaces between any of the clues or skyscraper building heights. 1234 313241 221432 142313 234122 2133 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 (n). Based on the second example input file above your output should look like this: 3221 313241 221432 142313 234122 2133 VALID 3221 313241 221432 1423131 234122 2133 NOT VALID 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 three methods as following: Method Description. 12
Method public static int getSkyscrapers(Scanner) public static boolean validateSkyscrapers (int) public static void main(String[] args) Extra Credit: N/A Implementation Guidelines: Description The method use the Scanner parameter passed in the method to read skyscrapers from standard input into 2D array. The method validates the 2D array that read from standard input. The main method will run the workflow of the program The program does not compile will receive grade of zero. Place your code in a class named Skyscraper and the class. The class should contain a main method which should do the following for the Skyscraper class: 1. Check for the name of the input file specified as a command line argument. If the file is not there print an error message telling the program user the program must be run using the name of an input file that contains skyscraper information as a command line argument. 2. Open the file 3. Read from the file as long as there is skyscraper information - for each set of skyscraper data do the following: a. Assign the clues and skyscraper heights into at least one two-dimensional array of type int (if you would like to have one array for the clues and another for the skyscraper heights that is fine). b. Pass the information just read to a method called validateSkyscrapers. The method should examine the clues and the skyscraper heights and return true if the heights are valid based on the clues, false otherwise. c. Print the skyscraper clues and heights in the format specified above along with a message about whether the heights are valid (as specified above). The code to do this should be placed in a method printSkyscrapers which is passed whatever data you feel is necessary to print the required information. Note: the method printSkyscrapers is optional to implement. 4. Close the input file. 5. Print a message that says "COMPLETED PROCESSING SKYSCRAPERS (without the nuntasi
rogram does not compile will receive grade of zero. your code in a class named Skyscraper and the class. The class should contain a main method which should do the following for the Skyscraper class: 1. Check for the name of the input file specified as a command line argument. If the file is not there print an error message telling the program user the program must be run using the name of an input file that contains skyscraper information as a command line argument. 2. Open the file 3. Read from the file as long as there is skyscraper information - for each set of skyscraper data do the following: a. Assign the clues and skyscraper heights into at least one two-dimensional array of type int (if you would like to have one array for the clues and another for the skyscraper heights that is fine). b. Pass the information just read to a method called validateSkyscrapers. The method should examine the clues and the skyscraper heights and return true if the heights are valid based on the clues, false otherwise. c. Print the skyscraper clues and heights in the format specified above along with a message about whether the heights are valid (as specified above). The code to do this should be placed in a method printSkyscrapers which is passed whatever data you feel is necessary to print the required information. Note: the method printSkyscrapers is optional to implement. 4. Close the input file. 5. Print a message that says "COMPLETED PROCESSING SKYSCRAPERS" (without the quotes) 6. You are welcome to write helper methods to complete the tasks above -- modular design is an important part of good software development Be sure your code follows the naming and coding conventions for the class: 1. Instance fields of a class should be named starting with 'my' 2. Parameters to methods should be named starting with 'the' 3. Parameters to methods should be specified as final 4. Javadoc comments should be used for the class as well as the methods of the class 5. You will lose points for each of these things on every assignment if you do not adhere to the rules.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply