Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Programming: Thank you for your help. Code: https://drive.google.com/file/d/1Je1twmWmbinw8Xl7UGJYVV6199WxQ5e4/view?usp=sharing JAVA PROGRAMMING Complete the Robot.java class as specified in the assignment description. Use the Stacklat interface,

image text in transcribed

Java Programming: Thank you for your help.

Code: https://drive.google.com/file/d/1Je1twmWmbinw8Xl7UGJYVV6199WxQ5e4/view?usp=sharing

JAVA PROGRAMMING Complete the Robot.java class as specified in the assignment description. Use the Stacklat interface, as well as the inkedStack class to develop your solution. You can use the RobotTest.java, robot0.txt, and robotl.txt files for basic testing robot0.txt Your task is to simulate a "blocks world in which a robot arm performs tasks involving the manipulation of blocks under certain constraints. Your program will act as a robotic arm that responds to a limited set of commands that instructs the robot arm in how to manipulate blocks that lie on a flat table. Blocks are labeled with lowercase alphabetic characters and arranged in three piles, as showna in the figure. move a over c move f over b pile over e discard a You are to write the Robot class, which will have the following public methods (of course, you may need additional helper methods to aid in implementing the required methods): robot1.txt Robot (String blocka): a constructor that initializes the robot's world. The string argument contains characters representing the blocks in each of the three piles, separated by commas. For each pile, the block at the bottom of the pile is listed first. For instance, the world in the figure above would be represented by the string "a, dcb, fe" as an argument to the constructor. move a over c discard pile b over e discard c boolean readActions (String filename) : a method to read and process commands for the robot to perform. The valid commands for the robot arm are: move XoverY: where X and Y are block labels, puts block X onto the top of the pile containing block Y. Any blocks that are stacked on top of block X should be restored to their original pile in their original order pile Xover Y: where Xand Y are block labels, puts the pile of blocks consisting of block X, and any blocks that are stacked above X, onto the top of the pile containing block Y. The blocks . stacked above block X retain their order when moved. discard X: remove block X from its pile and restore other blocks in their original order e quit in such an action). The method returns true if the file is opened and processed successfully String toString: retum a properly formatted string with the contents of the three piles, one per line. For each pile, the block at the top should be listed first. Your class should be stored in a file named Robot Java and should be tested using the RobotTest.java class and text files provided by the instructor. In addition, use the StackInt.java and LinkedStack.java files provided. Any stack must be dedlared as follows: StackInt Type> myStack-ne LinkedStackO When finished, submit Robot.java to Mimir for testing. Do not submit RobotTest.java. StackInt.iava. Sample input file contents: movea Over c nore f over b Sample toString value: Bile 1: https://drive.google.com/file/d/1JeltwmWmbinw8XI7UGJYVV6199WxO5e4/view? sh JAVA PROGRAMMING Complete the Robot.java class as specified in the assignment description. Use the Stacklat interface, as well as the inkedStack class to develop your solution. You can use the RobotTest.java, robot0.txt, and robotl.txt files for basic testing robot0.txt Your task is to simulate a "blocks world in which a robot arm performs tasks involving the manipulation of blocks under certain constraints. Your program will act as a robotic arm that responds to a limited set of commands that instructs the robot arm in how to manipulate blocks that lie on a flat table. Blocks are labeled with lowercase alphabetic characters and arranged in three piles, as showna in the figure. move a over c move f over b pile over e discard a You are to write the Robot class, which will have the following public methods (of course, you may need additional helper methods to aid in implementing the required methods): robot1.txt Robot (String blocka): a constructor that initializes the robot's world. The string argument contains characters representing the blocks in each of the three piles, separated by commas. For each pile, the block at the bottom of the pile is listed first. For instance, the world in the figure above would be represented by the string "a, dcb, fe" as an argument to the constructor. move a over c discard pile b over e discard c boolean readActions (String filename) : a method to read and process commands for the robot to perform. The valid commands for the robot arm are: move XoverY: where X and Y are block labels, puts block X onto the top of the pile containing block Y. Any blocks that are stacked on top of block X should be restored to their original pile in their original order pile Xover Y: where Xand Y are block labels, puts the pile of blocks consisting of block X, and any blocks that are stacked above X, onto the top of the pile containing block Y. The blocks . stacked above block X retain their order when moved. discard X: remove block X from its pile and restore other blocks in their original order e quit in such an action). The method returns true if the file is opened and processed successfully String toString: retum a properly formatted string with the contents of the three piles, one per line. For each pile, the block at the top should be listed first. Your class should be stored in a file named Robot Java and should be tested using the RobotTest.java class and text files provided by the instructor. In addition, use the StackInt.java and LinkedStack.java files provided. Any stack must be dedlared as follows: StackInt Type> myStack-ne LinkedStackO When finished, submit Robot.java to Mimir for testing. Do not submit RobotTest.java. StackInt.iava. Sample input file contents: movea Over c nore f over b Sample toString value: Bile 1: https://drive.google.com/file/d/1JeltwmWmbinw8XI7UGJYVV6199WxO5e4/view? sh

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions

Question

How do these performance objectives influence each other?

Answered: 1 week ago

Question

List the various types of predictive algorithms.

Answered: 1 week ago

Question

What is meant by Career Planning and development ?

Answered: 1 week ago

Question

What are Fringe Benefits ? List out some.

Answered: 1 week ago

Question

Has the team been empowered to prioritize the issues?

Answered: 1 week ago

Question

b. Does senior management trust the team?

Answered: 1 week ago

Question

c. How is trust demonstrated?

Answered: 1 week ago