COMP 110-001: Introduction to Programming, SSI'15

Lab 2

25 points

Assigned: Wednesday, May 20, 2015
Due: Friday, May 22, 2015 by 11:59pm (EDT)

Description

Lab 2 will introduce you to 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 Eclipse (You will need to create a new Java Project called Lab2 and a new Java Class called StringFun), and compile and run the program. (Don't forget to add the header!)

Part 1

Characters are stored as numbers in a computer. In this part, we convert the input integer to the unique Unicode character stored as that number. Appendix 7 has a subset of the Unicode character set. Note: the input integer is converted to a character via type casting.
(char)inputInt

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

Following is a subset of the Unicode character set known as the ASCII character set. (Character number 32 is the blank). You can also find it in Appendix 7.

The Unicode character

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 83-89 of the textbook.

Additional Questions (in project Lab2 in Eclipse, create a new File called yourlastname_lab2.txt and answer questions in the file)

Grading

How to hand in the assignment