jeudi 5 mars 2015

2D String Array as Individual Characters



I am new programming and for the most part have been able to figure everything out but this one has me stumped.


Write a java method that embeds (hides) a message inside a two dimensional character array. Assume that the following pieces of information are given to the method: A two dimensional array A A string message Starting row and column where the writing begins Delta row and delta column These two values determine the row and column differentials between two consecutive characters.


The message is to be written character by character starting at the specified staring location and then following the delta row and delta column differentials to the end.


Characters are to wrap around both horizontally and vertically. For example suppose the 2D array is 10 X 12 and: Delta row 2.. Delta column 1.. start Row 1.. start Column 6..


Should the array be set up as 2D string array or 2D Char Array? How do I separate the string into individual characters then produce an array out of them? Sorry for not having any code listed but I'm stumped on how to even begin writing the method. Once the method is complete I also need to write a method to retrieve the original String message.




Aucun commentaire:

Enregistrer un commentaire