COMP 110 Spring 2008

Lab 2

25 points

Assigned: Friday, January 25
Due: Friday, February 1 by 3:00pm

Description

Lab 2 will introduce you to Java applets, string manipulation, and type casting. You have been given a skeleton program StringFun.java that can be found on the course webpage. Copy the program into jGrasp, and compile and run the program. (Don't forget to change the header!)

Part 1

Characters are stored as numbers in a computer. This java applet converts the input integer to the unique Unicode character stored as that number. Appendix 3 has a subset of the Unicode character set. Note: the input integer was type cast as a character.
(char)inputInt

Type casting is more commonly done between integers and floating-point numbers. Often when performing arithmetic operations between the two types.

Part 2

For this part of the lab you will modify the code StringFun.java to prompt the user for a string (of characters) and output information about the string as well as manipulate the input string. You will be referencing pages 80-82 of your textbook.

Additional Questions

Grading

How to hand in the assignment