• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

A difficult question,who can give me an answer?

Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Test 004
1. A cost-map contains M*N cells, we have the cost rate for each individual cell.
2. The path is defined as a sequence of cells that connect to each other directly.
3. If two cells are in the same row or column, and there is no cell between them, these two cells are defined as directly connected.
4. The cost of a path is the summary of all the cells´┐Ż costs involved.
lYou are required to find out a cheapest path from one specified cell to another.
1. Based on the existing partial system (described below), design and implement your module to solve the problem.
2. Document the API of your module.
3. Draw the relevant UML diagrams for your design.
4. Finish the implementation using language of Java
5. Document your consideration for the performance in your design, because this program may run on devices with limited memory and calculation capabilities.
lThe existing partial system
M: intN: int
getCell(int row, int col): CellgetStartCell(): CellgetTargetCell(): Cell
M: is the row number of the map
N: is the column number of the map
getCell returns the Cell with row and column specified. The start index is 0.
getStartCell and GetTargetCell return the start and end cell of the problem.
row: intcol: int
getCost(): int

getTraceLength(): intgetCell(int n): CellgetCost(): int
getTraceLength returns how many cells are involved in this trace.
getCell returns the number n cell in this trace.
getCost returns the total cost of this trace.

[ February 10, 2004: Message edited by: frank yang ]
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two things...
1st thing:
Here at the JavaRanch we're always more than happy to help. Help you to understand what the question is, help you to understand why your solution won't work, help you to fix bugs, that kind of thing. But, we will NOT do your homework for you.
If you'd like to explain what you've tried, explain how you've gone about trying to solve it yourself... we'd be more than happy to help you along, but we won't just give you the answer, get it?
2nd thing:
I'm moving this to the Java In General (Intermeidate) forum, seeing as though this has nothing to do with Certification.
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic