Answer:
Step-by-step explanation:
The following is written in Java and creates only the method3 and returns a new method after doubling all of the 2's and 1's in the input.
public static int method3(int x) {
int finalValue = 0;
String number = String.valueOf(x);
for (int i = 0; i < number.length(); i++) {
if (number.charAt(i) == 1 || number.charAt(i) == 2) {
finalValue += Integer.valueOf(number.charAt(i));
finalValue += Integer.valueOf(number.charAt(i));
} else {
finalValue += Integer.valueOf(number.charAt(i));
}
}
return finalValue;
}