COMP2243 - Programming and Problem Solving

Syllabus Software Installation Assignments Tests
Lectures and Labs
**Back to Full Menu**

Fundamentals HelloWorld.java Basics.java Payroll.java Cartons.java Time.java DollarAmount.java StringPractice.java PayrollGUI.java



StringPractice Program


Description

The program inputs a full name and use String methods to:

a) extract the first name and the last name

b) extract initials

c) get the size of the full name

d) get the upper case letters of the full name

Then the program prints the result.

Associated Concepts:

Use String methods to manipulate String object

Algorithm:

Declare variables to store data items

Read a full name

Find the index of the blank space

Extract the first name and the last name from the full name

Get the size of the full name

Print the result including the full name in upper case

Source Code



Sample Run



Video