Java Programming
12-179-01
Assignment 2
Due 18 September 1996
Contact Information
Instructor: John Barr
Office: 402C Williams Hall
Phone: 4-3579
E-Mail:
Barr@icsun.sunnet.ithaca.edu
Instructions
Complete the following requirements. Any written answers should be
put into a text file. Place all of your files into a folder. Label
the folder with your last name and drop it into the CS190/HMWK/Lab2
folder.
Requirements
- Write either an application or an applet that either reads in
two strings from the
user or reads in two strings from the command line. The response of the
program will be as delineated below. You should provide the responces
by throwing and catching exceptions. You must create your own exception
objects in the application.
Responses:
- If the either string is longer than 10 characters reply "Too long"
followed by the string (or strings) that have too many characters
followed by a carriage return.
- If the string is less than 3 characters reply "Too short" followed
by the string (or strings) that have too few characters followed
by a carriage return.
- If the the first string begins with a character that occurs after
the first character of the second string reply with "Incorrect order"
followed by the two strings.
- In any other case concatenate the two strings and print them.
Return to Student Pages
Return to John Barr's Home Page
Last Modified: 28 August 1996
THIS PAGE MAINTAINED BY:
John Barr, Ithaca College