• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can somebody help me?  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to do a homework, i have a little code until right now, but if somebody can help me and give me a full code it would be very awesome

A company dedicated to the manufacture of paper has just acquired a robot that will take charge storing rolls in a warehouse, obviously automated. Since it happens habitually the solution was bought and then the problems were looked. Lucky the company is ready to invest time and money in search of a solution orientated to object and using as language of programming Java; for it he has entrusted the development of software to you. The logic to developing appears in the following figure:

Rolls of a certain Geometry enter to the warehouse leaving them of a certain position (x, and, z) .La warehouse supports 50 towers and a maximum height of 7,5 meters. The robot is listening permanently to a request of revenue. Once deposited the roll, it must look for a position (x, and, z) availably to store it (do not forget that the warehouse has a maximum height). In the towers the telescopic effect must avoid, that is to say that rolls of major diameter are on rolls of minor diameter. Initially the warehouse is empty (Empty), and obviously also it is possible to fill (full).

When an office is needed, an operator request to the robot that extracts a roll of a certain geometry, but without indicating the position, only the geometry. Therefore the robot must know which is the most efficient position to extract a roll. Think that the robot is listening always to a request of exit. Design the algorithms and implement a Systemic solution that solves the problem of this paper mill. To avoid the loss of information, these must avoid in a file, so that when a request of office is deposited the information must be rescued from the file.

w0.png
[Thumbnail for w0.png]
 
Sheriff
Posts: 4935
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hitzm ty wrote:I have to do a homework
Agree.

And it is good that you understand the importance of doing homework yourself, as it is the only way to learn.

It appears you wrote quite a lot of code already. Does that program compiles? Produces some expected results? Maybe experiencing some difficulties?
Please tell what these are, so someone could direct you towards solution.
 
andriu joseph
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Liutauras Vilda wrote:
hitzm ty wrote:I have to do a homework
Agree.

And it is good that you understand the importance of doing homework yourself, as it is the only way to learn.

It appears you wrote quite a lot of code already. Does that program compiles? Produces some expected results? Maybe experiencing some difficulties?
Please tell what these are, so someone could direct you towards solution.


I know it for sure, for that I want a full code for look and study about that, because right now I have ideas, but I don't know very well how to write them

I want to create an method that permit me to enter a "n" cilynders, with them width,high and diameter (high * width * diameter))), so, when I enter this cylinders, the max support of the tower have to be 7,5m max.

I have to have a max of 50 towers (for save the cylinders) so I have to order the cylinders by higher to less

I have to have a "x" and "y" position for know the cylinders with the certain geometry and take wich is the best

Sorry for not good answers
 
Liutauras Vilda
Sheriff
Posts: 4935
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably you need to step back a bit and re-think your solution. Java is object oriented language and it requires to write programs in that way in order to get mostly of it.

hitzm ty wrote:I have to have a "x" and "y" position for know the cylinders with the certain geometry and take wich is the best
Here you are. You already gave yourself a 1st hint. Probably would be a good idea to write a class which represents position of the cylinder in the 2 dimensional coordinate grid, which is based on specified x and y axis coordinates.

hitzm ty wrote:...enter a "n" cilynders, with them width,high and diameter (high * width * diameter)...
It seems you're on the right track. 2nd hint by yourself. Another class which represents a cylinder. The cylinder suppose to hold its attributes of high, width, diameter and probably the position in the warehouse.

I'd say start from the first class - Position. Implement methods (getters, setters) to retrieve x and y coordinates.

Do by little steps, compile code often enough (after written 3-4 lines) so you could save time on not fixing them afterwards.
 
andriu joseph
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How I say I've the ideas, but I don't how to do it rightly, if you could help me it would be nice
 
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hitzm ty wrote:How I say I've the ideas, but I don't how to do it rightly, if you could help me it would be nice

This is how you properly write code:

Write down your ideas. I'm serious. there is something about the act of writing/typing things out that really forces your brain to think through things further.

Once you have a list of ideas, pick one. Then refine it. Any single idea will invariably need to be broken out into smaller pieces. Then refine those again. Once you've done that 2-3 times, THEN start writing code to do one piece at a time. compile/test/fix every 2-3 lines of code you write. Create many small methods that each do somethings so simple, it's easy to see what each does by glancing at the code. Once you are sure it is correct, you don't have to worry about it any more - you just use it.


One of the biggest secrets, and hardest things to learn, about programming is that it is about 90% THINKING, and only 10% typing.
 
andriu joseph
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fred rosenberger wrote:
hitzm ty wrote:How I say I've the ideas, but I don't how to do it rightly, if you could help me it would be nice

This is how you properly write code:

Write down your ideas. I'm serious. there is something about the act of writing/typing things out that really forces your brain to think through things further.

Once you have a list of ideas, pick one. Then refine it. Any single idea will invariably need to be broken out into smaller pieces. Then refine those again. Once you've done that 2-3 times, THEN start writing code to do one piece at a time. compile/test/fix every 2-3 lines of code you write. Create many small methods that each do somethings so simple, it's easy to see what each does by glancing at the code. Once you are sure it is correct, you don't have to worry about it any more - you just use it.


One of the biggest secrets, and hardest things to learn, about programming is that it is about 90% THINKING, and only 10% typing.


Yeah I know, but I have too much for study and I would like if anyone help me with this
 
Liutauras Vilda
Sheriff
Posts: 4935
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hitzm ty wrote:How I say I've the ideas, but I don't how to do it rightly, if you could help me it would be nice
We gave you some hints where to start already and we are happy to give you some more in case you need them, but if I understood you correctly from the private message you sent me, you're linking help with written full code for you. I'm afraid this website not working like this. We are here to learn by doing our homework ourselves by discussing about the best practices to accomplish them.

Please let us know if you need more help on this.
 
andriu joseph
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(Reedit) I need help now with calling the cylinders and showing it, i have all the rest of the code but i don't know hot to call the cylinders by objets
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!