Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

Programming

13/09/2020 Client: sarahhitz Deadline: 24 Hours

1.  A starter solution has been provided to you as zip file. When submitting your own unit test methods, zip the contents of the src directory into a single zipped file. Make sure the zipped file has a .zip extension (not .tar, .rar, .7z, etc.).


ObstaclesWarrior.zip


#2


Obstacle Warrior


Objectives: Create a Java program using programming fundamentals (file I/O, loops, conditional statements, arrays, functions)


Problem: In an effort to win a coding competition, you decided to create an awesome Obstacle Warrior game. The game is played on a 2-dimensional board similar to a Chess board, but the dimensions may be different. The minimum size of the board is 2x2. The board will have a Start square and an Exit square that are not stored on the board. Start and Exit squares cannot be the same. Other board squares may contain obstacles in the form of an integer that will define how the warrior position and score will be affected. The obstacle squares can have values from 0 to -10 only. The Start square is always a clear square. All clear squares are marked with # on the board. The Exit square may contain an obstacle that is not a zero. The size of the board, number of obstacles, and Start and Exit squares are all unknow to your code prior to running. This information is stored in a file that your code will read at the beginning of the game. The board.dat file must be read into a 2-D array.


A warrior must start at the Start square and find their way to the Exit square. The warrior can move on the board in any direction including diagonally, one square at a time. A warrior has a running score (integer) maintained from the start of the game until the warrior exits the board. If the warrior lands on an obstacle square with a value of zero, the warrior is sent back to the starting position and the obstacle square will become a normal square (obstacle removed). If the obstacle square has a negative number, that number will reduce the warrior's score by the value of the obstacle, and the obstacle square will become a clear square (obstacle removed). Each VALID move that the warrior makes without landing on an obstacle will earn the warrior one point. The moves for the warrior are randomly generated by your code in the form of a direction (0-UP, 1-DOWN, 2-LEFT, 3-RIGHT, 4-UPRIGHT, 5-DOWNRIGHT, 6-UPLEFT, 7-DOWNLEFT). If the warrior is at the boundary of the board and your code generates an invalid move, that move will be ignored. Your code will keep generating moves until the warrior exits at the Exit square. Once the warrior exits, your program will store the updated board information to a new file ResultBoard.dat as single-space separated data. The program will also display the total number of valid moves, the total time elapsed in milliseconds since the first move until the warrior exited the board, the final score of the warrior and the formatted board information (right aligned columns with total of 5 spaces).


Output Format:



  • Each column in the final board display must be of total width of 5 spaces

  • Data in each column must be right aligned


Enter the board data file path: C:\board.dat //Repeat prompt until valid file OR show error and exit.


Type "Start" to start the game or "Exit" to exit the game: exit //Your program must exit


Enter the board file path: C:\board.dat


Type "Start" to start the game or "Exit" to exit the game: start //You may display the moves and the running score after each move but it is not required


The warrior made 270 valid moves in 503 milliseconds. The final score is 175 points.


 #  #  #  #  #


 #  #  #  0  #


 #  #  #  #  #


 #  -3  #  #  -4


 #  #  #  #  #


Press any key to exit!


Program Structure: Your code should be modular and easy to understand. In addition to the main method, the following methods are required to be in your code. These methods will be used by the unit testing to test the accuracy of your code.


public static String[][] ReadBoardFromFile(String fileName, Position startPosition, Position exitPosition)


public static boolean WriteBoardToFile(String fileName, String[][] boardArray)


public static int GenerateDirection()


public static boolean MoveWarrior(int direction, String[][] boardArray, Position currentPosition)


public static int CalculateWarriorScore(int currentScore, Position currentPosition, String[][] boardArray)


public static String DisplayResults(int currentScore, int numberOfMoves, int timeElapsed, String[][] boardArray)


Program Flow:



  • Program starts in main() method

  • Prompt user for Board.dat file path

  • Read board from file

  • Generate a direction

  • Move the warrior

  • Calculate new score

  • Check conditions and clear square if needed

  • Repeat until the warrior is at the exit square

  • Display the results

  • Prompt user to exit game


Board.dat file format:



  • The data in the file will be separated by one space

  • Assume that all data in the file is valid

  • Clear and Start squares (no obstacles) will be marked with # in the file

  • The first line of the file contains the dimensions of the board (rows and columns) e.g. 3 7

  • The second line contains the Start square indexes (rowIndex, columnIndex)

  • The third line contains the Exit square indexes (rowIndex, columnIndex)

  • The rest of the lines represent the contents, including obstacles, of a row on the board

  • Example of a Board size 5x5 data file:


5 5


2 2


4 3


# -5 # # #


# # # 0 #


# # # # #


# -3 # # -4


-10 # # # #


**ResultBoard.dat file format: **



  • Data must be separated by a single space


# # # # #


# # # 0 #


# # # # #


# -3 # # -4


# # # # #


Grading:



  • Coding standards, style and comments (10 Points)

  • Unit testing methods x6, one for each of the methods mentioned above (10 Points)

  • ReadBoardFromFile (10 Points)

  • WriteBoardToFile (10 Points)

  • GenerateDirection (10 Points)

  • MoveWarrior (20 Points)

  • CalculateWarriorScore (20 Points)

  • DisplayResults (10 Points)


Notes:



  • The “Position” class has been provided to you. You may add new methods/constructors to this class, but don't change existing methods

  • Part 1 deliverables: Unit Test methods only - Submit on eLearning

  • Part 2 deliverables: Functioning program - Submit on zyBooks (You may resubmit your Unit Test method on eLearning)

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Essay Writing Help
Study Master
Top Academic Guru
Writing Factory
Buy Coursework Help
Top Grade Tutor
Writer Writer Name Offer Chat
Essay Writing Help

ONLINE

Essay Writing Help

I can provide plagiarism-free work for you within your given deadline. My professional writing career started around 5 years back with a local writing company in my city where I have produced 1000+ documents for my clients.

$55 Chat With Writer
Study Master

ONLINE

Study Master

I am highly qualified expert, working from 2008-9 in this industry. I have all relevant skills and expertise related to your project.

$35 Chat With Writer
Top Academic Guru

ONLINE

Top Academic Guru

This project is my strength and I can fulfill your requirements properly within your given deadline. I always give plagiarism-free work to my clients at very competitive prices.

$35 Chat With Writer
Writing Factory

ONLINE

Writing Factory

I can help you with creating a presentation of one slide for The Word of William Hunter. I will be happy to offer you 100% original work with high-quality standard, professional research and writing services of various complexities.

$25 Chat With Writer
Buy Coursework Help

ONLINE

Buy Coursework Help

I can help you with your project. I will make sure to provide you exceptional quality work within the required timeframe. Please message me so we can discuss the further details over chat.

$35 Chat With Writer
Top Grade Tutor

ONLINE

Top Grade Tutor

I am highly qualified expert, working from 2008-9 in this industry. I have all relevant skills and expertise related to your project. To ensure my potential must visit my profile to check my ratings and uploaded samples. Thanks :--)

$40 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

Twice the sum of a number and 8 - Horizontal stabilizer trim actuator - Martin trailer parts catalogue - Management - Red bull case study answers - 2 tim 2 24 26 - CPO2100 - Thick ethernet vampire tap - Re french caledonia travel - Wk 4: Discussion 1: Eating disorders - Billing for laboratory services - How to develop diversity consciousness - Endangered species powerpoint project - Empty filter not allowed jet reports - Lorna bailey grotesque birds - Microeconomics true or false questions - Topic for PowerPoint Presentation4 - Nib extras waiting periods - Creativity and innovation table mgt411 - Finance project needed - Power point - IRCA for one issue and Retained Earnings statement. - The life span human development for helping professionals 4th ed - Dr mark perks adelaide - Swot analysis of groupon - Continuous problem city of monroe - Craig weatherup net worth - Continuous process in operations management - Netsh firewall add portopening udp - Accuair vu2 wiring diagram - Why are Crafting and Executing Strategy Important? - What is overtonal montage - Why is it best to have six or less life-cycle phases in an epm system - Viticulture and oenology courses - Ecovia stop the violence analysis - Solid magnesium plus oxygen gas yields solid magnesium oxide - Imagine that you are the owner of a discount furniture ... - Native cherry tree australia - Human trafficking - Intermolecular forces answer key - Dance mat typing bbc - Is fizzing a chemical change - The council of nicaea in 325 - Worksheet - Dr axe cottage cheese - An acid base titration curve lab answers - Doritos corn chips bold test flavour - British gas home appliance insurance - Gas stoichiometry worksheet answers - Jurassic world alive error 10029 - COMM THEORY - GENDER DIFFERENCES/LISTENING SKILLS - Craigmore south primary school - Sse free appliance scheme 2020 - Comprehension check chapters 1 3 the great gatsby - Pleasantville movie questions answers - Amc backstage associate self service - Please read the case study thoroughly. You may “mark-up” the case study itself. If you do, please send this back along with your written response. Please send the document in Microsoft Word format (not PDF). - Market neutral pure play - Suppose we are analyzing the market for hot chocolate - Gwent crematorium waiting times - Alfa romeo usp - How cost accounting distorts product costs - Assistance with technical writing assisgnment - Den of thieves epub - Percentage error formula chemistry - Research proposal - Ntu add drop period 2018 - What is cost of labor on form 1125 a - How are ms drgs calculated - Major financial decisions in financial management - APA 7TH EDITION (6) - GEN 103 INFORMATION LITERACY - Weekly Application #2 - Princess tormentor under the mattress crossword - Atlas copco zr 55 - Physical assessment school age child - Radiointernetowe.online - My Journey to Online Radio Success! - Possible conflict management and negotiation techniques - Bmaa sigma - Mgp10 floor joist span tables - The brawner rule - The secret life of b - Rate law of iodine clock reaction - Power Point Presentation - Enrolment due date uq - Jane eyre study guide questions and answers - Political science 330 final exam - Provide four examples of powerless verbal communication - Apa referencing guide rmit - I fell into your brown eyes - Service oriented software engineering ppt - WEEK9-DISCUSSION-Enterprise Risk Management - Supportive Psychotherapy Versus Interpersonal Psychotherapy - The stolen party theme - Cambridge gcse computing worksheet answers - Here are the main points for an informative speech about the anatomy of the human ear - Shoretel phone system manual - Louie company has a defined benefit pension plan - All of the poetic devices - Discussion board