Write a program to use a robot to move, Programming Languages

Write a program to use a robot to move the stack of blocks from a source location to a target location, based. Movement of robot arms, picking and dropping, can be controlled using the Robot class methods described below.

The Robot allows the following actions (methods): up(), down(), extend(), contract(), raise(), lower(), pick(), drop(),speedUp(), slowDown(). These are further described in the following descriptions.

• The height (h) of the main arm may be changed by 1 unit, using methods up() and down(). The height (h) of this arm is in the range 2 to 13, and is initially set to 2.

• The second arm may be moved horizontally by 1 unit using extend() or contract(). The width (w) is in the range 1 to 10, and is initially set to 1.

• The depth (d) of the third arm may be changed by 1 unit using lower() or raise(). The depth cannot be less than 0 but must be less than the height of the main arm ( d < h ). In the initial depth of the third arm is set to 0 (that is, the arm is not visible).

• The Robot class has two other methods, slowDown (int factor) and speedUp (int factor) to adjust the time between moves by the amount specified in factor.

• A block can be picked up from the top of the stack of blocks at the source, using pick().

• A block may be dropped at the top of the stack of blocks at one of the two target piles (one for even height blocks, one for odd height blocks) using drop(), depending on the height of the block.

The height of blocks can only be 1, 2, 3 or 4. Blocks of heights 1 and 3 must be dropped on the "odd" target pile in column 1, and blocks of heights 2 and 4 must be dropped on the "even" target pile in column 2.

Posted Date: 3/18/2013 1:26:41 AM | Location : United States







Related Discussions:- Write a program to use a robot to move, Assignment Help, Ask Question on Write a program to use a robot to move, Get Answer, Expert's Help, Write a program to use a robot to move Discussions

Write discussion on Write a program to use a robot to move
Your posts are moderated
Related Questions
Advantages of java stored procedures Transactions Although a saved process contains SQL orders, once collected it will socialize with SQL Hosting server very diversely from

A non-empty string β is called a repeat pre x of a string s if ββ is a pre x of s. Give a linear time algorithm to find the longest repeat prefix of s. Hint: Think of using lca

Abstraction hierarchy of mechanisms Given  the light-sensitive the motor and resistor,  we could  find  several  ways  of interconnecting them, using bits of ceramic and metal

Determine the address accessed by each of the following instruction if DS=1100H, BX=0200H, LIST=0250H AND SI=0500H-: 1) MOV LIST[SI],EDX?0250+0500+11000=11750 2

A number of simple student records are written to a text file. The format of some typical linesshould be - Task (1): Using a text editor, create a file with 10 such reco

An apartment complex has several apartments to rent. The apartments are all similar, and all rent for $750 per month. Currently, all units are occupied. The management, being in bu

A large offshore accommodation barge is to be converted into a floating luxury hotel.  It will be connected to a single point mooring buoy (SPM) in a beautiful inland loch where th

Question: (a) Explain the concepts of Inheritance and Polymorphism in Lingo programming. (b) Write short descriptions on parent scripts and child objects in Lingo object

Define the The if statement - Computer Programming? The if statement is an influential selection statement and is used to control the flow of execution of statements. One of th

what is the difference between class and interface