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
OOPS Concepts Object-oriented programming (OOP) is a computer science term used to characterize a programming language that began development in the 1960’s. The term ‘object-orient

Write an interactive C program which prompts the user with the following options on the opening menu: 1) Student information 2) Theory counselling batch-scheduling

program for pyramid in shell script

MVC Architecture Model/view/controller (MVC) is a program structure, currently regarded an executive design used in program technological innovation. The design isolates "domain lo

Write a Prolog predicate remove_nth(N,L1,L2) that is true if list L2 is just list L1 with its Nth element removed. If L1 does not have an Nth element then the predicate should fail

Task .Task 1 Database design This task will allow you to demonstrate the following Learning Outcomes (LOs): LO 2. Justify the design and development of the application and critica

what is a microprocessor? types of microprocessors? advantages disadvantages

Explain the Comma Operator- Computer Programming? The comma has two utilization and the most common use is as a parameter separator for data types and function parameter lists. H

You have been employed by a bounty hunter to create hit list (yes... you better do this right). Create a Hit List program that can records the name, bounty, and difficulty for ten

Genetic Diseases Problem Description Many human diseases could be controlled by the knowledge of the gene's structure and pattern. The human gene could be represented by fou