We're Open
+44 7340 9595 39
+44 20 3239 6980

WRITE TO CONTROL THE ROBOT MOVES

  100% Pass and No Plagiarism Guaranteed

WRITE TO CONTROL THE ROBOT MOVES

The Assessment Tasks

The specification for each task is set out below. Note these are requirements B to D are inclusive , i.e., the requirement set for Part D automatically meets all previous requirements from Parts A – C.

Standard Tasks

Part A The height of bars are pre-determined and set at 4.The height of the blocks are predetermined and set at 2.

Part B The user provides the heights of bars at runtime, but values supplied must be in the range 1 – 8.

Part C The user also provides the heights of blocks at runtime, but values supplied must be in the range 1 – 4. In addition the total height of all the blocks cannot exceed 12.

Part D The user can also specify and order in which the blocks should be placed at the destination.

Additional Task (Bonus marks)

Part E Part E requires you to specify the blocks in descending order of heights at the source. These blocks should be moved to the target with the limitation that a larger block cannot be placed on top of a smaller block.

 

Program Screenshots for Parts A to D

Part A: All blocks at source are of size 2 and all bars are of size 4.

Part B: All blocks at source are of height 2 as before but the bar heights may vary.

Part C: Block sizes can be specified in the range 1-4 Bar sizes can be specified in the range 1 to 8. Example Input: java Robot 543623 34121

Part D: This part allows user to specify the bar heights and block heights as well the order in which blocks must be placed in the Target. Example Input: java Robot 23456 2341 1234

Part E: This part specifies an additional ordering constraint which prevents a larger block being placed over a smaller block. Example Input: java Robot 543623 43321 ordered

Standard Requirements (20 marks in total)

A.Assume all the bars are of height 4 units and the blocks are of height 2 units respectively. Complete the control() method of the RobotControl class to move all the blocks to the respective targets.

(No input needed).

B.Allow the user to supply the heights of the 6 bars as command line arguments where the heights of the bars may vary from 1 to 8.

Complete the control() method of the RobotControl class to move all the blocks to the respective targets.

Sample input (bar heights): 734561. Based on these inputs, int array barHeights[] will be automatically set as in: barHeights[0] = 7; barHeights[1] = 3; …. barHeights[5] = 1;

C.Allow the user to supply the heights of the 6 obstacles as well as the height of the four blocks as command line arguments. Complete the control() method of the RobotControl class to move all the blocks to the respective targets.

Sample Input bar heights and block heights : 876054 2312.

Based on these inputs int arrays barHeights[], blockHeights[]) will be automatically set as in . barHeights[0] = 8; barHeights[1] = 7; …. barHeights[5] = 4;

blockHeights[0] = 2; blockHeights[1] = 3; … blockHeights[3] = 2;

D.Allow the blocks to be placed in the specified order. The required order will be passed as the array argument required[] which you can make use in the program.

Sample Input bar heights and block heights : 876054 2312 3221 barHeights[0] = 8; barHeights[1] = 7; …. barHeights[5] = 4;

blockHeights[0] = 2; blockHeights[1] = 3; … blockHeights[3] = 2; required[0] = 3; required[1] = 2; … required[3] = 1;

Bonus (5 Marks)

E.Allow the blocks to be moved such that a block cannot be placed over a smaller block. The block heights input therefore must therefore be in descending order.

Sample Input bar heights and block heights : 876054 3221 ordered

Up to half the marks can be earned by explaining the strategy for solving each section.

 

The code you need to write to control the Robot moves

For all four sections you are required to complete the control() method of the RobotControl class shown below. The control() method will be automatically called when the program is run. RobotControl class has a reference r set to refer to the Robot object. You are free to make use of other methods of your own.

class RobotControl

{private Robot r;

public RobotControl(Robot r)

{this.r = r;

}

public void control(int barHeights[], int blockHeights[],int required[], boolean ordered)

{// write your code and comments here

// to control robot using r.up(); r.extend() …

}

}

Arguments Passed to the control method

This method is also passed three arrays containing the heights of the bars (barHeights), the blocks (blockHeights) and the required order (required) (based on user input or default values). If the instructions you specify for the Robot result in hitting an obstacle or going beyond the limits, program will terminate immediately with an appropriate Error Message. The ordered variable (required only for part E) is set to true if the restriction requiring block to be placed to be smaller than the one underneath is to be enforced.


100% Plagiarism Free & Custom Written,
Tailored to your instructions


International House, 12 Constance Street, London, United Kingdom,
E16 2DQ

UK Registered Company # 11483120


100% Pass Guarantee

STILL NOT CONVINCED?

View our samples written by our professional writers to let you comprehend how your work is going to look like. We have categorised this into 3 categories with a few different subject domains

View Our Samples

We offer a £ 2999

If your assignment is plagiarised, we will give you £ 2999 in compensation

Recent Updates

Details

  • Title: WRITE TO CONTROL THE ROBOT MOVES
  • Price: £ 109
  • Post Date: 2018-11-10T06:51:41+00:00
  • Category: Assignment
  • No Plagiarism Guarantee
  • 100% Custom Written

Customer Reviews

 WRITE TO CONTROL THE ROBOT MOVES WRITE TO CONTROL THE ROBOT MOVES
Reviews: 5

A masterpiece of assignment by , written on 2020-03-12

Very professional and effective assignment writing service.
Reviews: 5

A masterpiece of assignment by , written on 2020-03-12

Now I am happy that I made the right decision of coming to Insta Research for help. My term paper was so technical and analytical at the same time. I got really confused about what to do but got relaxed when I was given such a humble writer. He clarified my concepts with the best explanations and discussions. I almost interacted with him on daily basis within the writing process. The best feature of this site is quick delivery as I got the work before my deadline. Additionally, the term paper is written skillfully and handled quite professionally. Now I am able to take a deep sigh of relief and thank you all for such speedy help. The quality of the work made my day.