Develop your programming and problem solving skills

Assignment Help JAVA Programming
Reference no: EM131473938

Assignment Objective

The objective of this assignment is to develop your programming and problem solving skills in a step-by-step manner, assisted with visualization.

Visualization helps you to easily identify any problems with your algorithm. Students are expected to devise a strategy before attempting to code any part (trial and error will cause you to go in circles).

Students will be awarded partial marks for explaining a valid strategy, even if the program is not working.

The different stages of this assignment are also designed to gradually introduce different concepts such as loops, arrays, selection, methods and recursion.

Assessment

The assignment is designed to test multiple competencies required for successful software development. Therefore the assessment evaluates all skills required not just the code itself. You will be assessed on your ability to comply with requirements as set out in this document which include developing capabilities in:

1. Programming Style: Adherence to a standard naming convention, documentation of your program and consistency in your style.

2. Refactoring Design and Code: Refining your code making it easier to maintain and understand.

3. Incorporating other Parts of Software Development Lifecycle: Incorporating practices such as test case development covering various configurations and test execution.

4. Algorithm Development: Demonstrate your ability to come up with an efficient strategy. The code should closely resemble your logical solution.

Programming Fundamentals

Progress Marks and Submission

There will be two progress assessment points during the semester each carrying 5 marks. Each assessment will be conducted during your scheduled lab session. You are expected to attend your regular scheduled lab for the progress assessments. Your final submission through WebLearn should include your code, reports and test cases and test results highlighting the number of moves for specific configurations (to be released later).

Assignment Overview ( What you need to do)

Write a program to move the stack of blocks from source to target with specific order and constraints (Some of these constraints will be automatically imposed by the Robot object). Movement of Robot arms, picking and dropping are controlled using the Robot methods described below.

The methods of Robot class:

up(), down(), extend(), contract(), raise(), lower(), pick(), drop(),speedUp(), slowDown()

- The height (h) of the main arm can be changed by 1 unit using methods up() and down(). The height (h) of the this arm must lie in the range 2 to 14, and is initially set to 2.

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

- The depth (d) of the third arm can 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 position depth d is set to 0 (it is not visible).

- The target column for all blocks is in column 1 while source is in column 10. The column 9 can be used as a temporary location for parts D and E.

- An item can be picked from the top of the stack of blocks at source using pick().

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

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.

The following page also provides examples with screenshots to clarify the requirements.

Programming Fundament

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

Note the required order in the target must be a permutation of the block heights specified.

4 Programming Fundamentals

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

Note this part requires block heights to be in descending order.

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

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.

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() ...

}

}

You are required to adhere to all standard java coding conventions, which include correct and consistent indentation of code, use of appropriate identifiers for variables and comments describing the main logic program. However, avoid commenting code that is obvious to the reader (for example, x = 5; // assigning 5 to x). You can also make the program structure clearer by subdividing your code into blocks or methods.

Attachment:- Java Assignment.rar

Reference no: EM131473938

Questions Cloud

Describes the current administrative position in the company : The following unordered list describes the current administrative positions in the company. Works under the Mail Services Manager and processes incoming mail.
What brenda do to become a more consultative salesperson : In thinking about her own selling approaches, she knew that she had been concentrating on the needs satisfaction and problem-solving approaches.
What is the productivity : Describe some of the current trends and challenges in the field of operations management? How might these impact the future of operations Management?
What are your companys likely weaknesses : What are your company's likely weaknesses? Is the competition in your industry segment entrenched? Is your own management team inexperienced?
Develop your programming and problem solving skills : The objective of this assignment is to develop your programming and problem solving skills in a step-by-step manner, assisted with visualization.
What is current value : What is current value of $1,000 bond with 4% coupon rate and 4% comparable rate of interest if it matures after 10 years.
What are the annual cca deductions : What are the annual CCA deductions associated with this equipment for the first five years?
Write essay on contemporary issues in business communication : You are required to write an essay on: "Contemporary issues in professional business communication."
Create a procedure called droplogins : Create a procedure called "dropLogins". In this procedure, include the following code Declare @Roles Table(DbRole varchar(20), MemberName varchar(50), MemberSID

Reviews

len1473938

4/25/2017 7:42:18 AM

The language is Java. I'm using Eclipse Neon.3 to run the files. The zip file contains the startup file in java. The word doc contains full instructions. Reattaching the files via Google Drive for the expert. Just some additional guide for the expert for section D and E .... For task d some of the methods that can be used is : a) int[] mode1.getSourceBlocks(); b) int[] mode1.getTargetBlocks(); c) void model1.moveBlock(intCol1, intCol2); We can use generic methods such as moveBlock(int from, int to) and the need to break the problem into smaller tasks. There are other interesting visual tasks including the Towers of Hanoi in that tool - that we are encouraged to try them to improve problem solving skills. Do advise if there is good progress on the materials.

Write a Review

JAVA Programming Questions & Answers

  Write a program to implement the boyer-moore algorithm

Write a program to implement the Boyer-Moore algorithm - Design a greedy algorithm to solve the activity selection problem. Suppose there are a set of activities: a1, a2, ...an that wish to use a lecture hall. Each activity ai has a start time sia..

  How does a client send a string ti the server using udp

How does a client send a string ti the server using UDP? Show what the client would do to get data from some string, and create a datagram packet destined for a server at "www.google.com", port 12345.

  Design a java application to help the management to

TCS is a full time courier and cargo dispatch agency for corporate companies around the world. It mainly deals with delivering and tracking the package delivered. TCS has its annual budget session during the end of year. With all the information prov..

  This project is designed to exercise all the java tools

This project is designed to exercise all the Java tools that you have learned about this term: classes/objects, variables, decision constructs, loops, arrays, encapsulation, overloading, inheritance, error handling, and application deployment.

  Implement insert sorting algorithm

Write computer program to implement this algorithm and demonstrate the results and what is the machine run time in second for sorting array A?

  Implement a lexical and syntax analyzer

Implement a lexical and syntax analyzer based on the following grammar. Your analyzer should read an input test program from a file and then determine if it contains a syntax error.

  Explain java stack and heap

I am posting the questions as reference, but I am requesting information about how to do these types of questions generally, not to have them done for me.

  What is abstract class and how it differ from regular class

What is an abstract class and how does it differ from a regular class? Why are abstract class constructors defined as protected

  Write a program to calculate the probabilities of collisions

Write a program to calculate the probabilities of collisions for the following: You are asked to write a program to store information for customers for a small local business.

  Create an array that will store temperatures

Create an array that will store 7 temperatures. Populate the array with 7 random temperatures from 1 to 100 degrees. (hint use a for loop and a Random number Generator)

  Write code that will save data to a file

The user will enter a Drexel course code. The course code beings with two capital letters, followed by an optional hyphen, followed by 3 digits, and followed by an optional section number

  How can i maintain a single instance of an object in applet

How can I maintain a single instance of an object in an applet? What is UDP and how does it work?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd