CISC 1115
Introduction to Programming Using Java
Lab #16
Strings

How to Develop and Submit your Labs

Lab 16.1 — String Processing (StringProcessor)

Write a program that reads in a sequence of strings (using nextLine and a header value) from the file strings.text, and prints out various properties and manipulations of the individual strings. The program should also sort the strings and print them out in sorted order. (This exercise is similar to Lab 14)

As each string is read in, you should print out:

Once the strings have been read in, they should be sorted and the result printed.

Sample Test Run

For example if the file strings.text contains:

8
The quick brown fix jumped over the lazy brown dog.
Hello world!
CISC 1115 is and introduction to Java
just...
some ...
words
madam im adam
madamimadam
the program should produce the following output:
original string: The quick brown fix jumped over the lazy brown dog.
reversed       : .god nworb yzal eht revo depmuj xif nworb kciuq ehT
vowels removed : Th qck brwn fx jmpd vr th lzy brwn dg.
plural         : The quick brown fix jumped over the lazy brown dog.s
isCapitalized  : true
containsBlanks : true

original string: Hello world!
reversed       : !dlrow olleH
vowels removed : Hll wrld!
plural         : Hello world!s
isCapitalized  : true
containsBlanks : true

original string: CISC 1115 is and introduction to Java
reversed       : avaJ ot noitcudortni dna si 5111 CSIC
vowels removed : CSC 1115 s nd ntrdctn t Jv
plural         : CISC 1115 is and introduction to Javas
isCapitalized  : true
containsBlanks : true

original string: just...
reversed       : ...tsuj
vowels removed : jst...
plural         : just...s
isCapitalized  : false
containsBlanks : false

original string: some ...
reversed       : ... emos
vowels removed : sm ...
plural         : some ...s
isCapitalized  : false
containsBlanks : true

original string: words
reversed       : sdrow
vowels removed : wrds
plural         : wordses
isCapitalized  : false
containsBlanks : false

original string: madam im adam
reversed       : mada mi madam
vowels removed : mdm m dm
plural         : madam im adams
isCapitalized  : false
containsBlanks : true

original string: madamimadam
reversed       : madamimadam
vowels removed : mdmmdm
plural         : madamimadams
isCapitalized  : false
containsBlanks : false


Initial array: {
	The quick brown fix jumped over the lazy brown dog.
	Hello world!
	CISC 1115 is and introduction to Java
	just...
	some ...
	words
	madam im adam
	madamimadam
}

Sorted      : {
	CISC 1115 is and introduction to Java
	Hello world!
	The quick brown fix jumped over the lazy brown dog.
	just...
	madam im adam
	madamimadam
	some ...
	words
}

Notes:

Lab 16.2 — Finding Area Codes in a Phone Book (AreaCodeFinder)

Write a program that reads in a pairs of lines (using nextLine) from the file black_book.text. The first line consists of a name; the second line the phone numbers associated with that name. The program prints out the name followed by the area codes of all the numbers listed for that name.

Sample Test Run

For example if the file black_book.text contains:

Smith, Mary 
work: (456) 765-0987 iPhone: (456) 321-9812 home: (876) 123-4567
Jones, Dave
(345) 567-7564
the program should produce the following output:
Smith, Mary: 
456
456
876
Jones, Dave: 
345
Notes: