Assignment 1

Due date: Thursday, September 12, in the lab.
NOTES:
This is a warm up assignment, to get back into JAVA. No object oriented techniques are required in this assignment.

Problem description

Develop a command line program that performs the following tasks:
  1. It starts by displaying the message "Welcome to Word File Scrambling" along with a menu with 3 (three) items: a) read file from disk; b) read file from Web and c) exit.
  2. When a user presses the keystroke "a" your program prompts the user to input the name of the file. The program then reads the text file from the local drive and scrambles the words in the file and prints the new file. The new file is stored on the local drive under a different name. The menu is again shown so that the user can do another word scrambling.
  3. When a user presses the keystroke "b" your program prompts the user to input the URL of a Web page. The program then reads the Web page, scrambles the words in the Web page and prints the new file. The new file is stored on the local drive under a different name. The menu is again shown so that the user can do another word scrambling.
  4. The scrambling operation is as follows: For each word in the file/Web page keep only the first and last letters at their position and scramble the rest of the letters in the word.
  5. If the user gives a wrong file name or URL the program must show a message and prompt the user to insert a new file name/URL.
  6. When a user presses the keystroke "c" the program exits.
  7. If a user presses on any other keystroke your program must ignore it.
Possible helpful pointers: