Reference no: EM13161517
Write a program that prompts the user for a paragraph and prints the number of sentences in it. (Assume all sentences end with a period.)
Hint: split method splits a string into substrings and returns an array. The delimiter period/dot character (.) is a special character for regex. Therefore when splitting instead of using a dot. use the regex [.] such as .split("[.]").
Hint #2: To read a complete line from the console. use nextLine() method of Scanner.
Example Run #1:
Enter a paragraph:
Eat. Sleep. Repeat.
Sentence count: 3
Example Run #2:
Enter a paragraph:
Facilisis, lacinia, curabitur egestas, lorem, risus. Class Ac amet laoreet parturient, quam justo interdum hendrerit erat faucibus, facilisi scelerisque commodo, odio. Ligula conubia potenti, per praesent est egestas felis a facilisis potenti vehicula pellentesque quis enim hac odio, etiam lobortis bibendum cum faucibus fames vulputate, id dolor interdum torquent, dolor sodales, arcu fermentum massa. Volutpat vestibulum conubia justo in. Tortor curabitur est fames posuere iaculis lobortis, hendrerit, hymenaeos sollicitudin pharetra at montes vitae proin aliquam lobortis facilisi mi pede vivamus ipsum blandit taciti. Primis sapien ante proin libero semper quam sollicitudin laoreet lacinia diam. Nulla hymenaeos odio placerat. Aliquam litora.
Regular expression that selects lines
: Write a regular expression that selects lines containing the html BR tag. The rules for this tag are that, like all html tags, it starts with . In between are the letters b and r in that order
|
Microsoft project tool easy
: Did you find the Microsoft Project tool easy to use? What is your best feature of the tool
|
Explain why pollan asserts that was a bad idea
: The biggest nutrition campaign of the last thrity years has been to eliminate fat from our diets. Explain why Pollan asserts that was a bad idea. Also describe the consequences of switching from the fats at the top of the food pyramid to the carbo..
|
How does the blood clot to prevent pathogens from entering
: When the skin is broken, how does the blood clot to prevent pathogens from entering? A brief and simple overview would be nice.
|
Acilisis, lacinia, curabitur egestas
: Acilisis, lacinia, curabitur egestas, lorem, risus. Class Ac amet laoreet parturient, quam justo interdum hendrerit erat faucibus, facilisi scelerisque commodo, odio. Ligula conubia potenti, per praesent est egestas felis a facilisis potenti vehicula..
|
Find the optimal crude oil allocation
: Find the optimal crude oil allocation in the preceding example if the profit associated with fiber were cut in half, that is, fell to $.375 per square foot.
|
Find all nash equilibria in pure strategies
: Find all Nash equilibria in pure strategies and what is the Pareto Optimal outcome under collusion? Show that this outcome is not sustainable.
|
Write a function that will take in an array of integers
: Write a function that will take in an array of integers, sum up all the values in the array, and return the result to the calling function.
|
Which phyla have fewer than 3 germ layers
: Which phyla have fewer than 3 germ layers? Which phyla have 3 germ layers?
|