puzzle

We want to make a row of bricks that is X meter long. We have a number of small bricks (Y meter each) and big bricks (Z meter each). Return true if it is possible to make the X meter long row by using a combination of the two kinds of brick. Remember, we have to use both kinds of bricks. We basically need you to create a method which takes 3 integer inputs - X, Y, Z and return a boolean as the result.

You just copy/pasted your assignment without even a moment taken to explain what help you need. That's highly disrepestectful to the many people who give their time to help others here.

There are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in helping you cheat or doing your homework for you.

DaniWeb Member Rules (which you agreed to when you signed up) include:
"Do provide evidence of having done some work yourself if posting questions from school or work assignments"http://www.daniweb.com/community/rules

However, I think you'll find it's not too good - you may need multiple bricks and nowhere in your code can I see anything to handle that.
The solution may require up to y/x of the first bricks and x/z of the other bricks, or any combination of those (it doesn't matter which is larger or smaller, although you could use that info to optimise the algorithm once you have it working). That immediatly suggests two loops (or equivalent) counting from 1..x/y and 1..x/z respectively.

There's no point trying to write code if you haven't first got a solid grasp of the algorithm you are trying to implement. The best thing toi do now is to set the Java aside, get a pen and some paper, and work out a few test cases by hand. That will help you see exactly what the process is, and therefore what you have to code.

ps. The spec syas x,y,z are integers, and you defined them as long. While that is valid, you may ask where will you find a wall longer than 2 billion meters? An int will be big enough methinks.

Thanks, On giving the input as some size y and z, we dont need the number of bricks required of each size,we just need to find if we can cover the size x or not by using both kinds of bricks in any proportion.
i cant understand why we need loop from 1....x/y or 1.......x/z?

Yes, you were not asked for the number of bricks, but you will have to deal with that inside your logic. Suppose we write the number of y bricks and z bricks as a pair of numbers. Then you will need to check lots of possibilities like (1,1), (1,2), (1.3) ... (1, x/z) ... (2,1), (2,2) ... ... (x/y, x/z). It will take two nested loops to run through all those combinations to see if any of them fits.

(That's before optimising the algorithm - you can improve it later to skip some combinations that can't possibly be right. But get it working first.)

Hi. so this is actually a continuation from another question of mine[Here](https://www.daniweb.com/programming/software-development/threads/506795/dynamically-add-values-into-datagridview-cell-from-listbox-vb2010) but i was advised to start a new thread as the original question …

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...