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

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!

Step by Step Solution

3.41 Rating (164 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here is the answer in Python 1 Function to check if a string is terminat... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java How To Program Late Objects Questions!