Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hello, i am currently swarmed with a whole bunch of work and have an assignment that is fairly simple to do, but because of all this other stuff i can't seem to think straight on it, or i over think it. Here is the assignment given to me:
----------------------------------------------------------------------
>Write an application that prompts a user for a full name and street address and constructs an ID as follows: the first 3 letters of the user's street name reversed, the numeric part of the address, the first letter of the the user's first name and the last letter of the user's last name.

For example, the user William Harrison who lives at 34 Elm would have an ID of mlE34Wn, whereas the user Addison Mitchell who lives at 1778 Monroe would have an ID of noM1778Al.<<br mode="hold" />----------------------------------------------------------------------

Now if someone can start it off for me, or even just do a poor version of it and have comments to help me understand it, that would be greatly appreciated. Although i know the requirements for a question on this site is to be specific with a problem, i can't be specific without even having the right mindset to start. Please don't have this taken down and help me out!
Posted
Updated 15-Jan-13 14:51pm
v2
Comments
PIEBALDconsult 15-Jan-13 20:46pm    
First off; that's not really what we do here. And it sounds rather easy anyway. But I do have a question... by "prompts a user for a full name and street address" do you mean it's all in one string? Or in separate strings?

This actually reminds me of a task on a job many years where I had to define and implement a way to make an ID kinda like that for high schools; as I recall I wound up with the two letter state abbreviation, maybe four letters of the town, and the first, oh, six letters of the school name after making certain other abbreviations, like ST for Saint, etc. Somehow it worked.


And it wasn't Java; it was VAX BASIC. I'll take the BASIC. :D
PIEBALDconsult 15-Jan-13 21:56pm    
Then you're hosed. But start with String.Split.

1 solution

We do not do your homework because the reason is- It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Further check these links this will help you to do your assignment
java program to reverse a string[^]

Combine String example[^]
get first & last letter of string-
Java
public class test {
 public static void main(String args[]) {
  String string = args[0];
  System.out.println("last character: " +string.substring((string.length() - 1));
System.out.println("first character: " +string.substring(string.charAt(0));
 }
}

get integer from this
char c = string.charAt(string);
isDigit = (c >= '0' && c <= '9');

but before going through this please think yourself about the question
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900