Write methods that accomplish each of the following tasks: a) Check whether the string is terminated by

Question:

Write methods that accomplish each of the following tasks:

a) Check whether the string is terminated by a full stop, and if not, add a full stop.

b) Check whether the string starts with a capital letter, and if not, capitalize the first letter.

c) Use the methods developed in parts (a) and (b) and to write a method beautifyString that receives a string from the user, and then calls the methods in (a) and (b) to make sure that the string is properly formatted, in other words, the string has a full stop at the end, and a capitalized first letter. Make sure you output the string after it has been beautified!

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Java How To Program Late Objects Version

ISBN: 9780136123712

8th Edition

Authors: Paul Deitel, Deitel & Associates

Question Posted: