Question: Design the Capitalize class, which contains one static method: void capitalize ( String in ) . The capitalize method reads a file of sentences (

Design the Capitalize class, which contains one static method: void capitalize(String
in). The capitalize method reads a file of sentences (that are not necessarily line-separated),
and outputs the capitalized versions of the sentences to a file of the same name, just with the .out
extension (you must remove whatever extension existed previously).
You may assume that a sentence is a string that is terminated by a period and only a period,
which is followed by a single space. If you use a splitting method, e.g.,.split, you must remember
to reinsert the period in the resulting string. There are many ways to solve this problem!
Example Run. If we invoke capitalize("file2a.in") into the running program, and
file2a.in contains the following (note that if you copy and paste this input data, you will need to
remove the newline before the "hopefully" token):
hi, it's a wonderful day. i am doing great, how are you doing. it's
hopefully fairly obvious as to what you need to do to solve this problem.
this is a sentence on another line.
this sentence should also be capitalized.
then file2a.out is generated containing the following (again, remember to remove the newline
before "hopefully".):
Hi, it's a wonderful day. I am doing great, how are you doing. It's
hopefully fairly obvious as to what you need to do to solve this problem.
This is a sentence on another line.
This sentence should also be capitalized.
Design the Capitalize class, which contains one

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Programming Questions!