” CSC-171程序设计 写作、 辅导java语言Project 2 CSC-171Skyscraper Puzzle3/9/20211 ProblemImagine a city block of skyscrapers whose area is surrounded by streets. Skyscrapers ofvarious heights are evenly Distributed into the rows and columns of the block. A skyscraperpuzzle is one where you are asked to organize the skyscrapers into a valid configuration thatmeets all the criteria for the puzzle.1.1 Puzzle DetailsThese game rules, along with sample puzzles, can be found at: https://www.brainbashers.com/skyscrapershelp.aspFigure 1: Skyscraper Rules1Figure 2: Skyscraper Clues or Looking ValuesFigure 3: Skyscraper Puzzle Solution1.2 WarmupTry to solve the puzzle in the figure below this part is just for fun!22 Project RequirementsAlthough it would be a very fun exercise to write a program to solve skyscraper puzzles, forthis project you are only asked to write a program to verify solutions.You should design a Skyscraper class, with private variables representing the state (i.e., theboard configuration) as well as the following methods:1. public boolean verifyPlacement() this method should return true if the placementis valid (i.e., every row and every column contains each number exactly once.).Otherwise, this method should return false.2. public void loadPuzzle() this method should read a puzzle from standard inputin the format specified below. This method must update the relevant instance variablesfor the object.3. public void print() this method should print the puzzle to standard output followingthe format specified below.4. public void printWithVisibility() this method should print the puzzle alongwith the visibility scores on the outside.5. A very simple main method which loads the puzzle from the user, then checks validityand prints the result. If its Valid, it also prints the puzzle with visibility.Continued on next page.32.1 Input and Output FormatThe loadPuzzle() method reads the configuration from standard input. This is the formatof the input and the required output for basic printing:1. The first line contains the square dimension of the board, DIM, as a single integer.2. The remaining DIM lines will each contain exactly DIM positive integers, separated bya single space, but with no trailing space after the last integer. These lines representthe heights of the skyscrapers in the same layout as the puzzle.3. All subsequent lines should be ignored.For example, the puzzle in Figure 3 is described by the input:44 3 2 11 4 3 23 2 1 42 1 4 32.1.1 printWithVisibility FormatThe printWithVisibility method should output a graphical representation of the puzzle,along with the visibility scores calculated according to the rules described earlier.For the puzzle in Figure 3, the output of this method should be:1 2 3 3——-1|4 3 2 1|42|1 4 3 2|32|3 2 1 4|12|2 1 4 3|2——-3 3 1 22.2 Design and DocumentationYou are required to have Exactly the public methods described in this document. You arealso encouraged (but not required) to have helper methods. (These may be particularlyhelpful when verifying the puzzle and when calculating visibility.) All your helper methodsshould be declared private. If you have any class variables, they must be declared privateas well.Because it complicates Grading, you are not allowed to have any package declarations. Includingpackage declarations in your submission will cause you to lose points.As with all Java programs, your program filename must match the public class exactly,therefore your program must be named Skyscraper.java and your class name must benamed Skyscraper.4Please include a readme in this submission which describes the state of your code. If everythingworks, you can simply write that everything works. Otherwise, describe what does anddoes not work when you submit it. Your readme should be plain text no docx, rtf, or pdffiles please.3 GradingYour grade for this assignment will be based on the following criteria: 25% verifyPlacement 20% loadPuzzle 10% basicPrint 25% printWithVisibility 10% Design and Documentation.3.1 SubmissionZip your solution program, Skyscraper.java, and a readme file and into a zip file namedskyscraper_USERNAME.zip, where USERNAME is replaced with your actual username. Thiswill help us to efficiently grade your submissions.Submit your zip file to Blackboard before April 1 2021 at 1159PM.请加QQ:99515681 或邮箱:99515681@qq.com WX:codehelp
“
添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导。