CCSU Spring, 1999 Project 6 Posting Date: February 2, 1999 Due Date: May 12, 1999 Relevant Demos: Demo 17: MartianTranslatorApplet.java and Demo 18: SearchApplet.java. This project comes in only 1 part. It covers the material covered in Chapter 6 on arrays, especially class Roll_Call. (But use Demo 18 as a guide; it is simpler.) Write a Java Applet to accept text entered by the user and translate it into International Morse Code. (International Morse Code is given below in Appendix A.) Your Applet Panel should contain a TextField, for the user's input and a button labeled "Code" for the user to click on. When the user clicks the Code button, the user's text should be translated into Morse Code and should appear in a vertical column on the Applet Panel. The idea behind the Morse Code translator is simple: Convert a String entered by the user in an input TextField to an ARRAY of chars, as in Demo 17. Then read through the array, letter by letter, and look up each letter in a Morse Code table, as in Demo 18. In fact the table lookup part of this project will be almost line for line like the tableLookUp and linearSearch methods in Demo 18. Store each Morse Code group in an array of Strings. Draw the message translated into Morse Code on the Applet Panel, as described above, to avoid problems converting an array of Strings into a long String for display in a TextField. Since you are going to be drawing directly on the Applet Panel, you will need to override the paint method. You will find the following code useful in drawing a vertical column of Morse Code groups: for(int i = 0; i < outputStrings.length; i++) { g.drawString(outputStrings[i], 50, 100 + 20*i); } Of course, the above assumes your output array of Strings is named outputStrings. Notes: Your Applet file must be called MorseCodeApplet.java, and your html file must be called MorseCodeApplet.html. You may work in teams of two on this project, if you so desire. You may not work in a team of three or more. You may not have the program of another team, or person not on your team, in your possession. The usual documentation standards apply. Each of your programs must begin with a remark box as described in project 1. Each method in your program must begin with a remark box as illustrated in the demos. Due Wednesday, May 12, 1999, at the beginning of class. Appendix A: International Morse Code. A .- F ..-. K -.- P .--. U ..- Z --.. B -... G --. L .-.. Q --.- V ...- C -.-. H .... M -- R .-. W .-- D -.. I .. N -. S ... X -..- E . J .--- O --- T - Y -.--