__MACOSX/._KivaWorld KivaWorld/sample_floor_map2.txt --------------- | XXXXXXXXXXP *| | ** *| | ** *| | *K D *| --------------- __MACOSX/KivaWorld/._sample_floor_map2.txt...

1 answer below »
Solve both coding related questions , one in Java progframming and other JavaScript


__MACOSX/._KivaWorld KivaWorld/sample_floor_map2.txt --------------- | P *| | ** *| | ** *| | *K D *| --------------- __MACOSX/KivaWorld/._sample_floor_map2.txt KivaWorld/sample_floor_map3.txt ------------------- |K * P * D| | * * | | * ****** | | * | ------------------- __MACOSX/KivaWorld/._sample_floor_map3.txt KivaWorld/sample_floor_map1.txt --------------- |K P D| | | | | | | | | | | | | --------------- __MACOSX/KivaWorld/._sample_floor_map1.txt KivaWorld/RemoteControl.java KivaWorld/RemoteControl.java import edu.duke.FileResource; /**  * This is the class that controls Kiva's actions. Implement therun()
* method to deliver the pod and avoid the obstacles.  *  * This is starter code that may or may not work. You will need to update the code to  * complete the project.  */ public class RemoteControl {     KeyboardResource keyboardResource;     /**      * Build a new RemoteControl.      */     public RemoteControl() {         keyboardResource = new KeyboardResource();     }     /**      * The controller that directs Kiva's activity. Prompts the user for the floor map      * to load, displays the map, and asks the user for the commands for Kiva to execute.      *      * [Here's the method you'll execute from within BlueJ. It may or may not run successfully      * as-is, but you'll definitely need to add more to complete the project.]      */     public void run() {         System.out.println("Please select a map file.");         FileResource fileResource = null;         String inputMap = fileResource.asString();         FloorMap floorMap = new FloorMap(inputMap);         System.out.println(floorMap);         System.out.println("Please enter the directions for the Kiva Robot to take.");         String directions = keyboardResource.getLine();         System.out.println("Directions that you typed in: " + directions);     } } __MACOSX/KivaWorld/._RemoteControl.java KivaWorld/README.TXT ------------------------------------------------------------------------ This is the starter code for the KivaWorld project. Please see the wiki documentation for more information, and to get started tackling your assigned tasks! ------------------------------------------------------------------------ __MACOSX/KivaWorld/._README.TXT KivaWorld/package.bluej #BlueJ package file dependency1.from=FloorMap dependency1.to=FloorMapObject dependency1.type=UsesDependency editor.fx.0.height=722 editor.fx.0.width=800 editor.fx.0.x=580 editor.fx.0.y=175 objectbench.height=164 objectbench.width=776 package.divider.horizontal=0.6 package.divider.vertical=0.6845018450184502 package.editor.height=364 package.editor.width=674 package.editor.x=348 package.editor.y=380 package.frame.height=600 package.frame.width=800 package.numDependencies=1 package.numTargets=5 package.showExtends=true package.showUses=true project.charset=UTF-8 readme.height=58 readme.name=@README readme.width=47 readme.x=10 readme.y=10 target1.height=50 target1.name=IllegalMoveException target1.showInterface=false target1.type=ClassTarget target1.typeParameters= target1.width=160 target1.x=160 target1.y=210 target2.height=50 target2.name=NoPodException target2.showInterface=false target2.type=ClassTarget target2.typeParameters= target2.width=130 target2.x=20 target2.y=210 target3.height=50 target3.name=FloorMap target3.showInterface=false target3.type=ClassTarget target3.typeParameters= target3.width=80 target3.x=70 target3.y=10 target4.height=50 target4.name=FloorMapObject target4.showInterface=false target4.type=EnumTarget target4.typeParameters= target4.width=90 target4.x=170 target4.y=70 target5.height=50 target5.name=IllegalDropZoneException target5.showInterface=false target5.type=ClassTarget target5.typeParameters= target5.width=190 target5.x=320 target5.y=210 __MACOSX/KivaWorld/._package.bluej __MACOSX/KivaWorld/._+libs KivaWorld/+libs/KivaWorld-1.0.jar META-INF/MANIFEST.MF Manifest-Version: 1.0 IllegalMoveException.class public synchronized class IllegalMoveException extends RuntimeException { private static final long serialVersionUID = -1937995197369040270; public void IllegalMoveException(String); } KeyboardResource.class public synchronized class KeyboardResource { private final java.util.Scanner scanner; public void KeyboardResource(); public String getLine(); } InvalidMapLayoutException.class public synchronized class InvalidMapLayoutException extends RuntimeException { private static final long serialVersionUID = 4432921931943498321; public void InvalidMapLayoutException(String); } NoPodException.class public synchronized class NoPodException extends RuntimeException { private static final long serialVersionUID = 5087830688658428714; public void NoPodException(String); } FloorMapObject.class public final synchronized enum FloorMapObject { public static final FloorMapObject EMPTY; public static final FloorMapObject OBSTACLE; public static final FloorMapObject POD; public static final FloorMapObject DROP_ZONE; private static java.util.Map charToEnum; private final String validRepresentations; public static FloorMapObject[] values(); public static FloorMapObject valueOf(String); private void FloorMapObject(String, int, String); public static java.util.Optional fromChar(char); private static java.util.Map registerCharMappings(); public char toChar(); static void (); } InvalidKivaCommandException.class public synchronized class InvalidKivaCommandException extends RuntimeException { private static final long serialVersionUID = -3683467712791191030; public void InvalidKivaCommandException(String); } FacingDirection.class public final synchronized enum FacingDirection { public static final FacingDirection UP; public static final FacingDirection RIGHT; public static final FacingDirection DOWN; public static final FacingDirection LEFT; private edu.duke.Point delta; public static FacingDirection[] values(); public static FacingDirection valueOf(String); private void FacingDirection(String, int, edu.duke.Point); public edu.duke.Point getDelta(); static void (); } InvalidFloorMapLocationException.class public synchronized class InvalidFloorMapLocationException extends RuntimeException { private static final long serialVersionUID = 3490513234138208627; public void InvalidFloorMapLocationException(String); } FloorMap.class public synchronized class FloorMap { private static final char KIVA_REPRESENTATION = 75; private char[][] map; private edu.duke.Point initialKivaLocation; private edu.duke.Point podLocation; private edu.duke.Point dropZoneLocation; public void FloorMap(String); public FloorMapObject getObjectAtLocation(edu.duke.Point); public edu.duke.Point getInitialKivaLocation(); public edu.duke.Point getPodLocation(); public edu.duke.Point getDropZoneLocation(); public int getMinColNum(); public int getMaxColNum(); public int getMinRowNum(); public int getMaxRowNum(); public String toString(); private char[][] populateMap(String); private java.util.List readAndValidateMapRows(String); private boolean foundKivaLocation(int, int, boolean); private boolean foundPodLocation(int, int, boolean); private boolean foundDropZoneLocation(int, int, boolean); } IllegalDropZoneException.class public synchronized class IllegalDropZoneException extends RuntimeException { private static final long serialVersionUID = 1067017088677681647; public void IllegalDropZoneException(String); } __MACOSX/KivaWorld/+libs/._KivaWorld-1.0.jar __MACOSX/._javadoc javadoc/constant-values.html JavaScript is disabled on your browser. Skip navigation links Package Class Tree Deprecated Index Help Prev Next Frames No Frames All Classes Constant Field Values Contents Skip navigation links Package Class Tree Deprecated Index Help Prev Next Frames No Frames All Classes __MACOSX/javadoc/._constant-values.html javadoc/overview-tree.html JavaScript is disabled on your browser. Skip navigation links Package Class Tree Deprecated Index Help Prev Next Frames No Frames All Classes Hierarchy For All Packages Class Hierarchy java.lang.Object FloorMap KeyboardResource java.lang.Throwable (implements java.io.Serializable) java.lang.Exception java.lang.RuntimeException IllegalDropZoneException IllegalMoveException InvalidFloorMapLocationException InvalidKivaCommandException InvalidMapLayoutException NoPodException Enum Hierarchy java.lang.Object java.lang.Enum (implements java.lang.Comparable, java.io.Serializable) FacingDirection FloorMapObject Skip navigation links Package Class Tree Deprecated Index Help Prev Next Frames No Frames All Classes __MACOSX/javadoc/._overview-tree.html javadoc/IllegalDropZoneException.html JavaScript is disabled on your browser. Skip navigation links Package Class Tree Deprecated Index Help Prev Class Next Class Frames No Frames All Classes Summary:  Nested |  Field |  Constr |  Method Detail:  Field |  Constr |  Method Class IllegalDropZoneException java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException IllegalDropZoneException All Implemented Interfaces: java.io.Serializable public class IllegalDropZoneException extends java.lang.RuntimeException Thrown when an attempt is made to drop a pod an a location that isn't a drop zone. See Also: Serialized Form Constructor Summary Constructors Constructor and Description IllegalDropZoneException(java.lang.String message) Thrown when attempting to drop a pod occurs on an invalid location. Method Summary Methods inherited from class java.lang.Throwable addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait Constructor Detail IllegalDropZoneException public IllegalDropZoneException(java.lang.String message) Thrown when attempting to drop a pod occurs on an invalid location. Parameters: message - What went wrong and in which location. Skip navigation links Package Class Tree Deprecated Index Help Prev Class Next Class Frames No Frames All Classes Summary:  Nested |  Field |  Constr |  Method Detail:  Field |  Constr |  Method __MACOSX/javadoc/._IllegalDropZoneException.html javadoc/FacingDirection.html JavaScript is disabled on your browser. Skip navigation links Package Class Tree Deprecated Index Help Prev Class Next Class Frames No Frames All Classes Summary:  Nested |  Enum Constants |  Field |  Method Detail:  Enum Constants |  Field |  Method Enum FacingDirection java.lang.Object java.lang.Enum FacingDirection All Implemented Interfaces: java.io.Serializable, java.lang.Comparable public enum FacingDirection extends java.lang.Enum Enumeration describing which way a robot is facing, containing the delta required to transform the location in that direction when moving forward. It provides more understandable names (e.g. better than (1,0)) for the directions and restricts the robot to the 4 valid orientations. The included Point, called delta, can be added to the robot's current location to move one space in the indicated direction. The Point mathematically indicates a direction on a single axis (the other dimension will always be zero) Enum Constant Summary Enum Constants Enum Constant and Description DOWN  LEFT  RIGHT  UP  Method Summary All Methods Static Methods Instance Methods Concrete Methods Modifier and TypeMethod and Description edu.duke.PointgetDelta() return the current facing direction as a Point. static FacingDirectionvalueOf(java.lang.String name) Returns the enum constant of this type with the specified name. static FacingDirection[]values() Returns an array containing the constants of this enum type, in the order they are declared. Methods inherited from class java.lang.Enum clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf Methods inherited from class java.lang.Object getClass, notify, notifyAll, wait, wait, wait Enum Constant Detail UP public static final FacingDirection UP RIGHT public static final FacingDirection RIGHT DOWN public static final FacingDirection DOWN LEFT public static final FacingDirection LEFT Method Detail values public static FacingDirection[] values() Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows: for (FacingDirection c : FacingDirection.values())   System.out.println(c); Returns: an array containing the constants of this enum type, in the order they are declared valueOf public static FacingDirection valueOf(java.lang.String name) Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) Parameters: name - the name of the enum constant to be returned. Returns: the enum constant with the specified name Throws: java.lang.IllegalArgumentException - if this enum type has no constant with the specified name java.lang.NullPointerException - if the argument is null getDelta public edu.duke.Point getDelta() return the current facing direction as a Point. Returns: Point representation of the facing direction. Skip navigation links Package Class Tree Deprecated Index Help Prev Class Next Class Frames No Frames All Classes Summary:  Nested |  Enum Constants |  Field |  Method Detail:  Enum Constants |  Field |  Method __MACOSX/javadoc/._FacingDirection.html javadoc/InvalidFloorMapLocationException.html JavaScript is disabled on your browser. Skip navigation links Package
Answered 13 days AfterAug 12, 2021

Answer To: __MACOSX/._KivaWorld KivaWorld/sample_floor_map2.txt --------------- | XXXXXXXXXXP *| | ** *| | **...

Swapnil answered on Aug 26 2021
148 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here