Lexicographic order is dictionary order, except that all the uppercase letters precede all the lowercase letters. For example b comes before c, but b comes after Y.

computer science

Description

You are to create a single program that collects 5 words from the user and prints them out in various ways.  Store them so you can access them throughout this program.  There are 4 parts to this program - make sure you are commenting your code with descriptions of each section of code and Write my name in Each Part. Also place in PDF Format.

 

Part 1: Ordering

Lexicographic order is dictionary order, except that all the uppercase letters precede all the lowercase letters.  For example  b comes before c, but b comes after Y.  Java uses methods to determine which words come first Lexicographically.

Print the 5 words out in Lexicographic order. 


 

Part 2: Pig Latin

Pig Latin is a language used by kids and annoying adults.  Here are the rules for converting an English word into Pig Latin.  If the word begins with a consonant, move the consonant to the end of the word and add “ay” after it.  If the word begins with a vowel, add “yay” to the end of the word.

 

English

Pig Latin

dog

ogday

Apple

Appleyay

easy

easyyay

Cattle

attleCay

 

 

Print out the first and second words from Part 1 in Pig Latin.


 

Part 3: Reversing letters

Print the 2nd and 3rd words from Part 1 again but switch the first letter with the last letter.  For example, the word computer would become romputec.

 


 

Part 4: Mixing up Words

Take the 4th and the 5th words from part 1 and print out both of their celebrity couple names.  Celebrity couples are made from taking half of the first name and combining it with the other half of the other name.  The first half of the first name combines with the second half of the second name and the first half of the second name combines with the second half of the first name.  Odd length names can be handled any way you wish, but all letters of both original words must be used between the two new words.

For example - Joey and Amanda  would become Jonda and Amaey

 


Example:

 

An example run of this program with the words given as inputs:

Camel Elephant  Alligator Bison  Dog

 

Part 1: Alligator  Bison  Camel  Dog  Elephant

Part 2: Alligatoryay  isonBay

Part 3: nisoB   lameC 

Part 4: Dhant  Elepog


Related Questions in computer science category