Develop your programming and problem solving skills


Assignment Overview:

The objective of this assignment is to develop your programming and problem solving skills in a step- by-step manner. The different stages of this assignment are designed to gradually introduce different concepts, such as loops, arrays, and methods. Students may be awarded partial marks for explaining a valid strategy, even if the program is not working.

Develop this assignment in an iterative fashion (as opposed to completing it in one sitting). You can and should get started now as there are concepts from the week 1 lessons that you can incorporate from now itself.

Assignment Criteria:

This assessment will determine your ability to:

1. Follow coding, convention and behavioral requirements provided in this document and in the lessons.

2. Independently solve a problem by using programming concepts taught over the first several weeks of the course.

3. Write and debug Java code independently.

4. Document code.

5. Ability to provide references where due.

6. Meeting deadlines.

7. Seeking clarification from your "supervisor" (instructor) when needed via discussion forums.

8. Create a program by recalling concepts taught in class, understanding and applying concepts relevant to solution, analyzing components of the problem, evaluating different approaches.

Learning Outcomes:

A. Demonstrate knowledge of basic concepts, syntax and control structures in programming

B. Devise solutions to simple computing problems under specific requirements

C. Encode the devised solutions into computer programs and test the programs on a computer

D. Demonstrate understanding of standard coding conventions and ethical considerations in programming.

Assignment Details:

MyBlock is a simple tool which can help one design a block of land. Your task is to write a Java program that implements the design functionality, checks if all the rules are followed, displays the block. The basic structure of the code is provided in the Canvas shell. You need to complete the following tasks. Please use the skeleton code provided to complete your code.

Your program should consist of a MyBlock class. The class has a two dimensional array of integers called block. The class also has a Boolean variable vacant that stores the information of whether the block of land is vacant or not. The methods of this class are: displayBlock(), addHouse(), and clearBlock().

Assignment Task A:

The constructor of the MyBlock class takes 2 parameters: the number of rows of the block, the number of columns of the block. In the constructor of this class, write code to initialize the block with the size of row and column. Initialize each value of the array block with the value 0, which means that block is unused. Initialize the value of vacant to true.

Assignment Task B:

Write a method of the MyBlock class called displayBlock() that prints the block as a two dimensional array. Give a space between each element during printing, and use a line for each row. An example of the output of displayBlock() is shown below, for a vacant block of 4 x 3.

0 0 0 0

0 0 0 0

0 0 0 0

Assignment Task C

Write a method of the MyBlock class called clearBlock()that sets the value of each element of the array 'block' to zero (0). Set the value of vacant to true.

Assignment Task D:

From the main method, the user can enter the row and column of the block. The number of rows and the number of columns should be an integer greater than 2 and less than or equal to 10. If any input is incorrect, show an error message and ask for that input again. If all inputs are correct, create an object of MyBlock class from main method. The row and column values are passed as the parameter of its constructor.

Assignment Task E:

From the main method, show a menu to the user with the following options. If the input is neither 1,2,3,4, show an error message and ask the user for input again.

1. Add a house

2. Display the block

3. Clear the block

4. Quit

Assignment Task F:

Implements the addHouse() method that takes four input parameters: the row position, the column position, the number of rows, and the number of columns of the house. Parameters row position and column position are the house's top left corner position. For example (2, 1) means the house starts from 2 rows down from the top and 1 column from the left edge of the block.

Try our Programming Fundamentals Assignment Help service at least once and give wings to your academic success.

Tags: Programming Fundamentals Assignment Help, Programming Fundamentals Homework Help, Programming Fundamentals Coursework, Programming Fundamentals Solved Assignments

Download:- Programming Fundamentals.rar

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Develop your programming and problem solving skills
Reference No:- TGS03046757

Expected delivery within 24 Hours