Java I CS 142 Week 02 Assignment.docx

advertisement
Java I CS 142 Week 02 Assignment
This assignment is due in the OIS drop box by noon, Sunday October 2. You should submit Week02.java
(classname must match)
Write a program that


Asks the user to enter their address, using JOptionPane’s ShowInputDialog three times…
o the numeric part of their street address. Store street number in a long; You will have to
parse a String into a Long to accomplish this.
o the street name of their address. Store the street name in a string;
o the name of their city. Store the city name in a string;
Displays, using JOptionPane’s showMessageDialog only once…
o The number of characters in the city name
o The name of the city in all uppercase letters
o The name of the city in all lowercase letters
o The first character in the name of the city
o The street address that is one higher than the user’s address.
The prompts should be clear and easy to understand what is expected. The output dialog should clearly
label the five items. For example: “Number of characters in city name: 12”. Each of the five items
should be on a separate line in the message dialog.
The program should have, at a minimum, comments that include your name (at the top of the file), and
some description of why you chose some of the code you did.
Sample output:
Number of characters in city name: 6
Name of the city (uppercase): TACOMA
Name of the city (lowercase): tacoma
First character in city: “T”
One Higher Street Address: 3826 Fuller
The above should be the output, assuming the input was “3825”, “Fuller”, and “Tacoma”.
Note: I will put comments in the Drop box for you to see, and transfer the total score to GradeA.
DropBox gives a misleading score: if you do a perfect assignment but no attempt at extra credit, it will
show as 83.3% (100/120), but it will show correctly as 100% in GradeA.
Java I CS 142 Week 02 Assignment
p. 1 of 2
Some extra credit opportunities for the experienced programmers among you:


User you initiative to find topics from Chapter 3, and use them. If you are “fishing for” extra
credit, be sure to include in the title the words “Look for Extra Credit”, and put a description in
the description box of what extra credit you think you should be entitled to, and why. It is
important that you put “Look for Extra Credit” in the title so that I will know to do an extra step
to see your description.
Help other students on the “Bulletin Board” forum. (This is general extra credit, not for this
assignment in particular. You will need to provide me evidence of your help via screenshots or
links in email to get “helping other students” extra credit.)
Java I CS 142 Week 02 Assignment
p. 2 of 2
Download