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

  Understand actual communication with an smtp server

Understand actual communication with an SMTP server can be achieved using TCP Sockets and understand the development of a graphical user interface (GUI) and use of event handling.

  Create an array of size n and fill it

Sketch a high level design of what you want to implement using the UML notation. At the very least, you should have a use case diagram, class diagram and a sequence diagram.

  Calculate and display mortgage payments

Let the user decide on the down payment percentage amount to use. Calculate and display mortgage payments for both a 20-year and a 30-year loan, to allow the user to compare them.

  Create a class diagram that shows an interface

Create a class diagram that shows an interface called Buyer in the Violet UML editor. This interface should declare the methods to perform a buyer's responsibilities

  Days alive calculator

The context for this assignment (all parts) is a ‘Days Alive Calculator' - a small desktop application for calculating the number of days someone has been alive based on the date of birth and a second date, which may be today's date or some other ..

  Create a testing java program

Please create a testing Java program to use this RandomSeq class to create a random DNA sequence and then print it out in a formatted fashion with a specified length for each line.

  Calculate the average number of miles you ran

What is your list length? Calculate the sum of the total miles you spent running over the 10 weeks. Calculate the average number of miles you ran. Write a search to determine whether 4 is on your list

  In this assignment you will be asked to implement a card

in this assignment you will be asked to implement a card game. you will need to make several design decisions for your

  Write a java program that prints the numbers from 1 to 125

Write a Java Program that prints the numbers from 1 to 125. But for multiles of three print "Batman" instead of the number and for the multiples of five print "Superman". For instances which are multiples of both three and five "JusticeLeague".

  Complete and fully test the class characteristic

Complete and fully test the class Characteristic that Exercise explains. Suppose a class Characteristic that will be used in an online dating service to assess how compatible two people are.

  Develop java package comprising of class using encapsulation

Develop the Java package comprising of Class and Student with the given requirements. Encapsulation, Method to print student details alone.

  Create pipe-and-filter network that will read data stream

Create a pipe-and-filter network that will read the data stream in FlightData.dat file, convert the temperature measurements from Fahrenheit to Celsius, and convert altitude from feet to meters - How would this impact the key quality attributes of ..

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