Our Services

Get 15% Discount on your First Order

[rank_math_breadcrumb]

This assignment lets you build a set of classes to support a program to find paths through a cave. By the end of Unit 4, you will have a program that can read a 2-dimensional cave layout from a fil

This  assignment lets you build a set of classes to support a program to find  paths through a cave. By the end of Unit 4, you will have a program that  can read a 2-dimensional cave layout from a file, search the layout to  find a path to a mirror pool, then print the path to take. This unit,  you will build the infrastructure for this project, including  storing  data in a two dimensional structure, searching the data structure for a  simple path from start to finish and reading data from a text file.

Preparation

See the announcements for the link to the GitHub repository for this assignment. 

Directions

Write a class CaveExplorer, that has the following methods:

  1. Constructor  with no parameters. It should create the two-dimensional structure  shown below, where the characters in the layout are ‘R’ for rock, ‘.’  for a clear path, ‘M’ for mirror pool, and ‘S’ for self. This  constructor hardcodes the cave without reading from a file.
  2. toString  – no parameters, returns a string (including new lines) showing the  current state of the cave exploration. For the initial configuration,  this string would be”RRRRRR\nR..SRR\nR.RRRR\nR.MRRR\nRRRRRR\n”
  3. solve  – no parameters, returns a boolean true if there is a path to the  mirror pool, and false if there is not. This method is where you will  spend some time figuring out the logic. Even though there is only one  path, you still have to search in four different directions and make  sure you don’t get caught in an infinite loop. How you do this is up to  you.
  4. getPath – no parameters, returns a String showing the path  taken to get to the mirror pool. In the example, this path would be the  string of directions “wwsse” for West, West, South, South, East. The  method should return the empty string if there is no path.
  5. Constructor  with one String parameter – the name of a text file with the cave  layout. The file has a line with two integers, the number of rows and  columns of the cave layout, followed by the layout itself.  For  exampleYou will have to modify the text file with the cave data using  your favorite editor. Your cave layout should contain a path requiring  at least 4 moves in two different directions. There must be exactly one  path through the cave, that is, from any location, there is only at most  one location to move to next that hasn’t already been visited. If you  need help reading from a file, there are many resources on the web  regarding using the Scanner class to read text data. A short one is the   section on Scanners at to an external site.)
  6. main  – test your class by writing a main method that creates at least 2  CaveExplorer objects, solves each one, then prints the starting layout,  the final layout, and the path taken, if it exists, for each one. Be  sure to follow this order of operations.

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Hello This is XP Cyberrange Challenges twe need to complete the challenge by reading a conversaation between the people dicussing on cyber topics. We need to resolve the issues by working on each task

Hello This is XP Cyberrange Challenges we need to complete the challenge by reading a conversaation between the people dicussing on cyber topics. We need to resolve the issues by working on each task which are discussed in that conversation meet. Please pay attention to the instructions below. Finish the

● NCP- NICE Challenge Project ● VM- Virtual Machine ● VMRC- Virtual Machine Remote Console ❖ NICE Framework- This is shorthand for the NICE Cybersecurity Workforce Framework. ❖ Webportal- The web appl

Hello friends this is the step by step guidance to work on task these are not the questions don’t be panic ./ ● NCP- NICE Challenge Project ● VM- Virtual Machine ● VMRC- Virtual Machine Remote Console ❖ NICE Framework- This is shorthand for the NICE Cybersecurity Workforce Framework. ❖

Course : Analyzing and Visualizing Data Textbook Used: Title: Data VisualisationISBN: 9781526468925Authors: Andy KirkPublisher: SAGE Publications LimitedPublication Date: 2019-10-07Edition: 2nd ED.

Course : Analyzing and Visualizing Data Textbook Used: Title: Data VisualisationISBN: 9781526468925Authors: Andy KirkPublisher: SAGE Publications LimitedPublication Date: 2019-10-07Edition: 2nd ED. Practical Connection Assignment At UC, it is a priority that students are provided with strong educational programs and courses that allow them to be servant-leaders in their disciplines and communities, linking research with practice and

Hello Students, As discussed in class, the Workspaces and Challengesare now active. Required Challenges for Full Credit To earn full credit (30% of the assignment), you must complete 6 challenges from

Hello Students, As discussed in class, the Workspaces and Challengesare now active. Required Challenges for Full Credit To earn full credit (30% of the assignment), you must complete 6 challenges from the following list: Interns & HR on the Domain Controller Help Desk Fun: User Workstation Nightmares Dangerous Drives Preventative Protection: Thwarting the Imminent Threat Security

Part 1Title: Computer Hardware Using bullet points, briefly describe a computing device you use often, such as your desktop, laptop, tablet, or smartphone. Identify the make and model, and at least th

Part 1Title: Computer Hardware Using bullet points, briefly describe a computing device you use often, such as your desktop, laptop, tablet, or smartphone. Identify the make and model, and at least three other components of the computing device. In the speaker notes, discuss in detail what you use the device

Network Threats and Attacks You have now learned about recognizing security threats, vulnerabilities, and how to mitigate them. Almost every day, there are reports of an intrusion, breach of confident

Network Threats and Attacks You have now learned about recognizing security threats, vulnerabilities, and how to mitigate them. Almost every day, there are reports of an intrusion, breach of confidentiality, or some other high-profile attack. Find a news article about a recent network attack (no more than one year ago).

I am doing IFSM 300 Information Systems in Organization. the instructions The Stage 4 case study project is due as shown in the schedule. The assignment instructions and vendor brochure are attached.

I am doing IFSM 300 Information Systems in Organization. the instructions The Stage 4 case study project is due as shown in the schedule. The assignment instructions and vendor brochure are attached. The Case Study is posted under Course Resources. Use the Case Study and weekly readings to develop your assignment and understand the concepts

Find 5 student organizations that interest you. For each organization: Why are you interested in this organization?Describe some of the activities of the organizationWhen and where is the next meeti

Find 5 student organizations that interest you.  For each organization: Why are you interested in this organization? Describe some of the activities of the organization When and where  is the next meeting? If you have questions about the organization, how would you contact them?CSE1106 – Intro to Computer Science and

Network Threats and Attacks You have now learned about recognizing security threats, vulnerabilities, and how to mitigate them. Almost every day, there are reports of an intrusion, breach of confident

Network Threats and Attacks You have now learned about recognizing security threats, vulnerabilities, and how to mitigate them. Almost every day, there are reports of an intrusion, breach of confidentiality, or some other high-profile attack. Find a news article about a recent network attack (no more than one year ago).