• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple program problem

 
Phil Castles
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Phil Castles
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then show us what you've got, like Campbell asked.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic