Write a method public static int count wordsstring str that


Problem

1. Write a method public static int count Words(String str) that returns a count of all words in the string str. Words are separated by spaces. For example, count Words("Mary had a little lamb") should return 5.

2. It is a well-known phenomenon that most people are easily able to read a text whose words have two characters flipped, provided the first and last letter of each word are not changed. For example, I dn'ot gvie a dman for a man taht can olny sepll a wrod one way. (Mrak Taiwn) Write a method String scramble(String word) that constructs a scrambled version of a given word, randomly flipping two characters other than the first and last one. Then write a program that reads words and prints the scrambled words.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a method public static int count wordsstring str that
Reference No:- TGS02628180

Expected delivery within 24 Hours