aspose file tools*
The moose likes Beginning Java and the fly likes Simple program problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Simple program problem" Watch "Simple program problem" New topic
Author

Simple program problem

Phil Castles
Greenhorn

Joined: Mar 08, 2009
Posts: 2
Hi guys, having abit of trouble getting the login box goin. Could you please provide me with correct code for the below?

I need to:

prompt for and input user name
prompt for and input user number
while the user number is not between 1 and 500 inclusive
warn the user the number is not in the correct range
prompt for and input user number
set identifier to first letter of username, followed by hyphen, followed by user number
write out the user name
write out user number
write out identifier

Many Thanks
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39400
    
  28
Welcome to JavaRanch

We don't supply "answers" like that, but you are obviously half-way there, so please show us what you have got so far, and we shall be happy to discuss it.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19719
    
  20

You already wrote the pseudo-code, so all you need to do is translate each line to actual code. Console (since Java 6) and Scanner (since Java 5.0) can help you out a lot.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Phil Castles
Greenhorn

Joined: Mar 08, 2009
Posts: 2
It's the actual code that im having issues with. im just trying to create this for my business but am failing miserably.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19719
    
  20

Then show us what you've got, like Campbell asked.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple program problem