It seems you are stuck because you are not familiar with the modelisation effort of going from the assignment statement to a solution design. This is a difficult task for everybody, not just beginners. But in your assignment you already got some guidelines.
First you have to understand what do you get as input and what should you output. In this case it is coordinates…
The first part of the assignment is some kind of story from which you have to extract the algorithmic problem.
As a result all coordinates have to be shifted by (1, 0).
This is the transformation you have to do to your inputs to get the desired output.
Then you need to understand the format of your input and outputs, and how you are going to represent them in java. The guidelines already requires one so you should ask yourself:
- What is a
Coordinate
? - What is a
CoordinateRow
? What is in the class material or java api I can use to implement it? - How do I go from the string
"5,4"
to aCoordinate
? - How do I go from the string
"5,4 4,5 8,7"
to aCoordinateRow
? - Ok how do I go from a
Coordinate
to a string such as “5,4”? - Ok how do I go from a
CoordinateRow
to the program output? - What are the methods of
Coordinate
andCoordinateRow
explicitly specified? - What are the other methods I will definitely need? Hint : remember the transformation above
At this point you already have a class structure with methods defined and just need to fill them.
solved I need help in java programming assignment please