{"id":962,"date":"2016-05-05T18:43:30","date_gmt":"2016-05-05T08:43:30","guid":{"rendered":"http:\/\/casestudyhelp.com\/sample-questions\/?p=962"},"modified":"2018-01-23T22:57:21","modified_gmt":"2018-01-23T11:57:21","slug":"cs-367-java-programming-assignment-help","status":"publish","type":"post","link":"https:\/\/casestudyhelp.com\/sample-questions\/cs-367-java-programming-assignment-help\/","title":{"rendered":"CS 367  JAVA Programming Assignment Help"},"content":{"rendered":"<h2 style=\"text-align: center;\"><span style=\"color: #ff6600;\">CS 367: Introduction to Data Structures<\/span><\/h2>\n<h3>Overview<\/h3>\n<h3>Goals<\/h3>\n<p>The goals of this assignment are:<\/p>\n<ul>\n<li>Understand and implement the Graph ADT<\/li>\n<li>Understand and implement BFS, DFS, and Dijkstra&#8217;s Shortest path graph traversal methods<\/li>\n<li>Complete a class implementations according to their design.<\/li>\n<li>Complete implemenation of an interesting game that can be configured in a variety of ways.<\/li>\n<li>Learn about graph traversals by playing the game.<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><a title=\"Java Progarmming Assignment Help\" href=\"https:\/\/casestudyhelp.com\/computer-assignment\/java-programming-assignment-help.html\" target=\"_blank\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-2410\" src=\"https:\/\/casestudyhelp.com\/sample-questions\/wp-content\/uploads\/2016\/05\/Java-Assignment-Help.png\" alt=\"Java Assignment Help\" width=\"800\" height=\"315\" srcset=\"https:\/\/casestudyhelp.com\/sample-questions\/wp-content\/uploads\/2016\/05\/Java-Assignment-Help.png 800w, https:\/\/casestudyhelp.com\/sample-questions\/wp-content\/uploads\/2016\/05\/Java-Assignment-Help-300x118.png 300w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<h3>Description<\/h3>\n<p style=\"text-align: justify;\">You are the Batman of Madison and you are going to catch the spy moving across our city. If he is not caught within a particular time frame (a number of steps-moves), he will invoke a macroscopic black hole that will suck us all into it. Save Madison!<\/p>\n<p style=\"text-align: justify;\">The spy moves randomly in the city and you move around searching for him. You can also use a limited number of your spycams to catch the spy, since you cannot be everywhere! You win when you catch or surround him before the time expires. If not, the Spy wins.<\/p>\n<p style=\"text-align: justify;\">You will be implementing an interactive game that will allow the player to take various actions by typing a command.\u00a0 If the player lands on the same location as the spy or successfully surrounds the spy before the number of steps is reached, the city is saved..<\/p>\n<div id=\"game_play\">\n<h3>Game Play<\/h3>\n<p style=\"text-align: justify;\">We have coded the <code>Game<\/code> class for you and this will handle much of the game play once you implement the missing classes. At the start of the program, the input files are read and the game parameters and <code>SpyGraph<\/code> are initialized. Next, the player is asked for their name and a brief help instruction is provided.<\/p>\n<pre>java Game config1.txt area1.txt\r\nEnter the name of your player: \r\nBucky Badger\r\nYour random starting location is a\r\nType 'h' at any time for a list of commands.\r\nEnter command:<\/pre>\n<p style=\"text-align: justify;\">Various areas in Madison are modelled as a graph. Each location represents a vertex or node in the graph and the road connecting between the two locations represent the edge between the nodes. In addition, each road has a toll fee (weight) that should be spent in order to use the road. The player and spy start out at a random spots in the city. As a player, enter your name, and then choose your action to wisely to catch the spy before time expires.\u00a0 At each instant of time, the player has the following set of actions to choose from:<\/p>\n<pre>All commands can be activated with the first character.\r\n'budget' prints the money you have remaining to use on moves.\r\n'clock' returns the number of moves remaining.\r\n'drop' places a spycam at your current location if there is one available.\r\n'get NODE' retrieves a spycam from NODE if NODE has a spycam\r\n'location' prints your location\r\n'move NODE' moves you to NODE if possible.\r\n'neighbors' prints all neighbors of your location and the cost to get there.\r\n'onspy' tells you if you are at the same location as the spy and decreases your budget by a prespecified amount\r\n'path NODE' prints three possible paths from your location to NODE using DFS, BFS, and Dijkstra's\r\n'quit' ends the game\r\n'spycams' prints the nubmer of spycams remaining and the locations of placed spycams.<\/pre>\n<p style=\"text-align: justify;\">The spy will periodically reveal their location and this will help you to make a better decision when choosing the next course of action to catch the spy.<\/p>\n<p>If you catch the spy, you&#8217;ll see the win message:<\/p>\n<pre>     GAME OVER, spy is surrounded.\r\n     Bucky Badger wins!\r\n     Spy is at node e\r\n     Player is at node f<\/pre>\n<p>If you don&#8217;t catch the spy, you&#8217;ll see this message:<\/p>\n<pre>     GAME OVER, you did not find the spy, spy wins\r\n     Spy is at node red_gym\r\n     Player is at node gordon_commons<\/pre>\n<\/div>\n<div id=\"Specifications\">\n<h3>Specifications (and files for download)<\/h3>\n<p style=\"text-align: justify;\">There are several files provided to you.\u00a0 They can be found in the provided_src folder.<\/p>\n<p style=\"text-align: justify;\">You must implement the missing classes for the program. See the <strong>javadocs<\/strong> lines for each class for details about the <code>public<\/code> members required for each required class.\u00a0 You may add <code>private<\/code> methods, but not <code>public<\/code> or <code>package<\/code> visibility methods or other classes.\u00a0 You may not edit the classes that have been provided with the exception of the <code>Test.java<\/code> class.\u00a0 You may edit this class in any way you choose for individual unit or other testing.\u00a0 There is no requirement to handin <code>Test.java<\/code> class.\u00a0 There is a DFS and BFS test that you can try on your SpyGraph when you have completed that and the Neighbor class.\u00a0 Be sure to have the <tt>test_area.txt<\/tt> file in the same folder, or change the path name for that test.<\/p>\n<p style=\"text-align: justify;\">You will need to implement:<\/p>\n<h4 style=\"text-align: justify;\">SpyGraph (javadocs) &#8211; represent the game space as a graph with a spy hiding and a\u00a0player trying to find.<\/h4>\n<p style=\"text-align: justify;\">Among other methods, you will need to implement the <em>Breadth-First Traversal<\/em> and <em>Depth-First Traversal<\/em> algorithms. You may also implement Dijkstra&#8217;s Shortest path algorithm, but this is not required.\u00a0 When the player selects <code>path NODE<\/code>, the Game class will call these methods to display different path options from the player current location to the desired node location.\u00a0 Recall and implement the algorithms for these traversals from lecture.\u00a0 Be sure to choose in alphabetical order (of uninvited nodes) when you have a choice.\u00a0 Hint: <tt>Graph Node<\/tt> and <tt>Neighbor<\/tt> are <em>comparable<\/em>, so collections of them can be sorted by calling the <em>sort<\/em> method on the collection.<\/p>\n<h4 style=\"text-align: justify;\">GraphNode (javadocs) &#8211; represent a vertex (node) of the game space where the Player and Spy can be located.<\/h4>\n<p style=\"text-align: justify;\">Instances of this class maintain a vertex name and a list of adjacent vertexes (neighbors) and supporing operations.\u00a0 It is comparable by vertex name (so it can be sorted) and its neighbors are returned in a list that can be iterated through.\u00a0 Our implementation maintains the neighbors in a sorted list to ensure that the &#8220;367 convention&#8221; for picking nodes alphabetically is preserved.<\/p>\n<h4 style=\"text-align: justify;\">Player (javadocs) &#8211; stores information about the player, like name, budget, spycams, etc.<\/h4>\n<p style=\"text-align: justify;\">This is probably a good class to implement first.\u00a0 There is no skeleton provided. You are required to implement the public methods that are described in the javadocs for this class.\u00a0 Try writing some test methods for your <tt>Player<\/tt> class in the <tt>Test.java<\/tt> class<\/p>\n<h4 style=\"text-align: justify;\">Neighbor (javadocs) &#8211; each edge between nodes is represented as\u00a0a Neighbor (of the first node in the pair of nodes).<\/h4>\n<p style=\"text-align: justify;\">The <tt>Neighbor<\/tt> class represents an edge between two nodes.\u00a0 Each <tt>GraphNode<\/tt> maintains a list of its neighbors.\u00a0 When, an edge is found in the area input file, each node becomes a neighbor of the other node.\u00a0 Each edge also has a cost or weight.\u00a0 It is the instance of the <tt>Neighbor<\/tt> class that stores this cost.<\/p>\n<p style=\"text-align: justify;\">Be sure to implement each class as it is described\u00a0in the javadocs.\u00a0 Failure to implement each class according to its specifications willl result in points lost for that class.<\/p>\n<\/div>\n<div id=\"input_files\">\n<h2>Input Files: Used to configure the game<\/h2>\n<p style=\"text-align: justify;\">To configure different game play, the program requires two input data files entered as <em>command-line arguments<\/em>.\u00a0 The names of these two files must be included as command-line arguments in your build process.\u00a0 The configN.txt file is listed first and the areaN.txt file is listed second.\u00a0 We provide the sampel files input files, but you can try your hand at making your own also.<\/p>\n<h3 style=\"text-align: justify;\">area.txt<\/h3>\n<p style=\"text-align: justify;\">A text only file that contains the area information (the graph information), that is, the locations(nodes) and paths(edges).\u00a0 The contents of the area\u00a0file will follow this form.\u00a0 The NODES section lists the node names and the EDGES section lists the edges between nodes that exist.\u00a0 The <code>Game<\/code> class will parse these files for you, but you must have the <code>SpyGraph<\/code> complete before this can by completed correctly. Each line following the line &#8220;NODES&#8221; represent a node in the graph.\u00a0 Each line following &#8220;EDGES&#8221; specifies an edge between the two nodes<\/p>\n<pre>    NODES\r\n    a\r\n    b\r\n    EDGES\r\n    a b 1<\/pre>\n<p style=\"text-align: justify;\">The graph described by this area file has two nodes, &#8220;a&#8221; and &#8220;b&#8221; and one edge, between &#8220;a&#8221; and &#8220;b&#8221; with a cost or weight of 1.\u00a0 That means it will cost 1 unit of your budget to move from a to b or b to a.\u00a0 The graph\u00a0is undirected\u00a0and constructed from <code>GraphNode<\/code> instances that are linked together according to the edge list.<\/p>\n<h3>config.txt<\/h3>\n<p>The <code>config.txt<\/code> file gives information about the parameters required for the gameplay.<\/p>\n<div>\n<pre>REVEALSPY 2\r\nMOVES 10\r\nBUDGET 15\r\nSPYCAMS 3\r\nUNIT pound\r\nCOST 2<\/pre>\n<\/div>\n<ul>\n<ul>\n<li style=\"text-align: justify;\">UNIT specifies the currency type.<\/li>\n<li style=\"text-align: justify;\">BUDGET is the total amount money units you are allowed during the entire gameplay. This budget is used to spend on different moves during game play.<\/li>\n<li style=\"text-align: justify;\">REVEALSPY is the number of time units after which the spy reveals his location. These hints help the player follow the spy.<\/li>\n<li style=\"text-align: justify;\">MOVES is the total number of moves along paths the player has to find the spy during the entire gameplay.<\/li>\n<li style=\"text-align: justify;\">SPYCAMS is the number of spycams the player has available to drop in an effort to surround the spy.<\/li>\n<li style=\"text-align: justify;\">COST is the cost of checking if the spy is in your location or not.<\/li>\n<\/ul>\n<\/ul>\n<p style=\"text-align: justify;\" align=\"center\"><a href=\"https:\/\/casestudyhelp.com\/MyOrder.php\"><img decoding=\"async\" src=\"https:\/\/casestudyhelp.com\/images\/hire-best-assignment-experts-online.gif\" alt=\"Hire Your Assignment Writing Expert for  Collage\/University\" \/><\/a><\/p>\n<\/div>\n<div id=\"sample_runs\">\n<h3>Sample Runs<\/h3>\n<p>To help you understand the game play, we have created several sample runs for you to review.<\/p>\n<p><tt>Sample_Runs<\/tt><\/p>\n<\/div>\n<div>\n<p><a id=\"Steps\" name=\"Steps\"><\/a><\/p>\n<h3>Steps<\/h3>\n<p style=\"text-align: justify;\">After you have read this program page and given thought to the problem we suggest the following steps:<\/p>\n<ol>\n<li style=\"text-align: justify;\">If you are working with a partner, review the rules for pair programming and register your partnership using the 367 Forms before 10 PM ON MONDAY, 5\/2. After this deadline you&#8217;ll need to work individually.<\/li>\n<li style=\"text-align: justify;\">Review these style and commenting standards that are used to evaluate your program.<\/li>\n<li style=\"text-align: justify;\">You may use the Java development environment of your choice in CS 367. <em><b>However, all programs must compile and run on the lab computers for grading.<\/b><\/em> If you are going to use the CS lab computers, we recommend that you use Eclipse. You may want to review the Eclipse tutorial to learn the basics. Note: On the Linux lab computers, enter &#8220;<tt>eclipse&amp;<\/tt>&#8221; to launch Eclipse at the prompt instead of what is described in the tutorial.<\/li>\n<li>Download the files from the following link for your programming assignment 5. The files are in pairs, one config and one area file for each type of Spy game you can try.\n<ul style=\"text-align: justify;\">\n<li><tt>provided_src files<\/tt> : the source\u00a0files we provide and a skeleton for SpyGame.java (you must write your own Player.java and Neighbor.java source files)<\/li>\n<li><tt>input files<\/tt> : several config.txt and area.txt pairs for different game play. May add more.<\/li>\n<li><tt>sample runs<\/tt> : showing the program&#8217;s user interface<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">Do <b>not<\/b> use a package name for your program.<\/p>\n<\/li>\n<li style=\"text-align: justify;\">If you are not using the lab computers to develop your program, make sure you compile and run your program to ensure that it works on the Linux lab computers. You can compile your Java source using <tt>javac<\/tt> in a terminal window as in this example:<dir><tt>javac *.java<\/tt><\/dir>and then run your program with the input files listed as command-line arguments as in:<dir><tt>java Game &lt;Config(number).txt&gt; &lt;Area(number).txt&gt; <\/tt><\/dir><\/li>\n<li>Submit your work for grading.<\/li>\n<\/ol>\n<\/div>\n<div>\n<p><a id=\"Submission\" name=\"Submission\"><\/a><\/p>\n<h3>Submitting Your Work<\/h3>\n<p>Make sure your code follows the style and commenting standards used in CS 302 and CS 367.<\/p>\n<p><span style=\"color: red;\">All submitted classes should belong to the default package.<\/span><\/p>\n<p>If you are working with a partner, only one partner needs to submit.<\/p>\n<p>Submit the following files by the due date and time (or refer to the late policy) using the 367 Forms:<\/p>\n<ul>\n<li>&#8220;<tt>Neighbor.java<\/tt>&#8220;<\/li>\n<li>&#8220;<tt>Player.java<\/tt>&#8220;<\/li>\n<li>&#8220;<tt>SpyGraph.java<\/tt>&#8220;<\/li>\n<li>&#8220;<tt>GraphNode.java<\/tt>&#8220;<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><em><strong>Please CHAT WITH LIVE Assignment Advisor to know more about Referencing styles and Citations.<\/strong><\/em><\/p>\n<p style=\"text-align: center;\">Chat with our 24 x 7 Online Agents CLICK CHAT NOW<\/p>\n<p style=\"text-align: center;\"><strong>Ask Your\u00a0<a title=\"Java Assignment Question\" href=\"https:\/\/casestudyhelp.com\/computer-assignment\/java-assignment-help-from-java-expert.html\">JAVA\u00a0Assignment Question<\/a>?<\/strong><br \/>\n<strong>Check out our\u00a0<a title=\"Java Programming Assignment Service\" href=\"https:\/\/casestudyhelp.com\/computer-assignment\/java-programming-assignment-help.html\">Java Programming Assignment\u00a0Services<\/a><\/strong><br \/>\n<strong>Find Your\u00a0<a title=\"Assignment Experts\" href=\"https:\/\/casestudyhelp.com\/assignment-expert-help-in-australia-uk-us.html\">Assignment Experts<\/a><\/strong><\/p>\n<\/div>\n<script type=\"text\/javascript\" charset=\"utf-8\" src=\"http:\/\/w.sharethis.com\/widget\/?wp=6.2.9\"><\/script>","protected":false},"excerpt":{"rendered":"<p>CS 367: Introduction to Data Structures Overview Goals The goals of this assignment are: Understand and implement the Graph ADT Understand and implement BFS, DFS, and Dijkstra&#8217;s Shortest path graph traversal methods Complete a class implementations according to their design. Complete implemenation of an interesting game that can be configured in a variety of ways. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[191],"tags":[652,181],"_links":{"self":[{"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/posts\/962"}],"collection":[{"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/comments?post=962"}],"version-history":[{"count":7,"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/posts\/962\/revisions"}],"predecessor-version":[{"id":2414,"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/posts\/962\/revisions\/2414"}],"wp:attachment":[{"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/media?parent=962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/categories?post=962"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/tags?post=962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}