Answer:
3)
My pet is a dog
Your pet is a cat
His pet is a cat
4a) int numCharacters = variable.length();
4b) int randomIndex = (int)(Math.random() * (numCharacters - 1));
4c) String newWord = variable.substring(randomIndex) + "completed";
Explanation: