Convert the String to an array of characters (look the java String API)
Loop the array and for every third element set its value to X (array = 'X')
Then convert that array of characters to a new String (look the java String API)

This is what I have now. Is still have not figured out how to replace every third character in the input string (I just put in replace all 'a' that appear in the string to make the program work). Can you please help with how to count every third character and replace?

That code has nothing to do with what I suggested. Also why do you loop until length-1 and not length?
Use my suggestions to create an array of characters and loop it. In order to change every third character in the loop have an if statement that checks if that index of the array can be divided by 3. Use the '%' operator:

14%2 = 0
14%7 = 0
3%3 = 0
6%3 = 0
9%3 = 0

If it returns 0 then it can be divided:

int a = 5;
int b = 2;
int mod = a%b;

If the index of the array can be divided then change it with the 'X' as explained in my first post. Then convert that char array to a String. Look at those methods at the String API

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 ...