Hw1: Simple Program

Line 23: Line 23:
=== Solutions ===
=== Solutions ===
*[[Morelli and Smith]]
*[[Morelli and Smith]]
 +
*[[HW1: Sarah Thayer]]

Revision as of 16:05, 22 September 2009

Assignment

Read the notes on WAMP/MAMP and Eclipse and follow the instructions there for installing LAMP and Eclipse on your laptops.

Using whatever programming language you are most proficient in --- Java, PhP, Perl, etc. --- write a well-structured and well-documented program that accepts a String input from the user (as a command line argument or through a GUI interface or a command line interface, whatever you prefer) and removes all non-numeric characters from the string and displays the result.

Your program should use a method (Java) or a function (PhP) to handle the task of removing non-numerics from the string. You can imagine that this method would be used to "clean" an input text field that is expecting to receive a numeric ID number such as 8953480085.

For example, if the input to the program is $43504.00, the output should be 4350400.

Handin Instructions

Post your solutions here, by editing this page, creating an internal link to your solution, and then pasting your solution into the page created for the link. To preserve formatting of your program, embed your source code between <pre>...</pre> tags.

The link should be named with the names of the members of the programming team. See the Morelli and Smith link below as an example. NOTE: Do not upload your solution until noon on the due date. We will look at the solutions in class.

Solutions