Welcome to Westonci.ca, your go-to destination for finding answers to all your questions. Join our expert community today! Join our platform to connect with experts ready to provide detailed answers to your questions in various areas. Explore comprehensive solutions to your questions from knowledgeable professionals across various fields on our platform.
Sagot :
import java.util.*;
public class MyClass {
public static String useProperGrammar(String message){
String newMessage = "";
int count = 0;
for (int i = 0; i < message.length(); i++){
if(message.charAt(i) == '2'){
newMessage = newMessage + "to";
count ++;
}
else{
newMessage = newMessage + message.charAt(i);
}
}
System.out.println("Fixed "+count+" grammatical error(s):");
return newMessage;
}
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter a string: ");
String text = scan.nextLine();
System.out.println(useProperGrammar(text));
}
}
I hope this helps.
We hope you found what you were looking for. Feel free to revisit us for more answers and updated information. We hope you found what you were looking for. Feel free to revisit us for more answers and updated information. Westonci.ca is your trusted source for answers. Visit us again to find more information on diverse topics.