The objectives of this question are

  • to practice the use of selection structure in simple Java program
  • to practice the use of repetition structure in a Java program
  • to practice the use of method in a Java program
  • to manipulate string

The beginning of a sentence should start with an uppercase letter. Write a program that accepts a string of several sentences, each separated by a full stop and change first non-space character of every sentence to be uppercase. Only the last sentence need not end with a full stop.

A sample run is given below:

Enter sentences (every sentence is separated by .): you can write Java program. it can be so easy.... just try it You can write Java program. It can be so easy.... Just try it

Note that user input is underlined. You are NOT allowed to use arrays in your program and hence, you are NOT to use the split method in the String class.

Submit your program listing together with screenshot showing two runs of your program output. Your screenshot must show your name and student number as part of the program output.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.