Westonci.ca makes finding answers easy, with a community of experts ready to provide you with the information you seek. Get the answers you need quickly and accurately from a dedicated community of experts on our Q&A platform. Connect with a community of professionals ready to provide precise solutions to your questions quickly and accurately.
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.
Thanks for stopping by. We strive to provide the best answers for all your questions. See you again soon. Thank you for your visit. We're dedicated to helping you find the information you need, whenever you need it. Discover more at Westonci.ca. Return for the latest expert answers and updates on various topics.