• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Code Generator

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey guys, i'm new to Java. I need some help with this program.
What i need it to do is to make the number of codes the user sets, with upper-case and lower case letters and numbers, the number of chars the code has, the limits he inputs( for ex. 1st char a~f, 2nd char 1~9, etc) and at the end show the chars of each code all together.



So lets say the user wants 10 codes, with 5 chars each, 1st char a~d, 2nd 1~9 etc
And get something like a6ed4.

Thanks in advance.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does the code do now? What difficulties are you having in making it do what you want it to do?
 
Rafael Lopz
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It generates the code,limits it but doesnt get it all together in the end. I can't get it to do that.
I was trying to do an array there and at the end but it didn't work o:
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'll need to be more specific; what does "get it all together in the end" mean? What's the output now, and what should the output be? What have you tried to get it to do that?
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Part of being a programmer is learning how to communicate with users, programmers, and machines in a VERY precise way. saying "it doesn't work" is useless and meaningless. Saying "When I run it, i expect output 'A', but get output 'B'" explains a LOT and helps others understand what you are talking about. The easier you make it for someone to help you, the more likely someone will.
 
Rafael Lopz
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry for not answering sooner but my internet connection hasnt been too good lately.

Meanwhile, i've been working on it and it's like this now:



Here's the output:

How many chars?
3
1º Pos letter[1] or number[2]?
1
Char Limit 1 - Start
a
Char Limit 1 - end
z
2º Pos letter[1] or number[2]?
2
Number Limit 2 - Start
1
Number Limit 2 - End
9
3º Pos letter[1] or number[2]?
1
Char Limit 3 - Start
a
Char Limit 3 - end
z
How many codes do you want?
5
pw - c3
pw - v1
pw - b9
pw - d4
pw - b7


Supposedly it should show a 3 chars password. Something like:

How many chars?
3
1º Pos letter[1] or number[2]?
1
Char Limit 1 - Start
a
Char Limit 1 - end
z
2º Pos letter[1] or number[2]?
2
Number Limit 2 - Start
1
Number Limit 2 - End
9
3º Pos letter[1] or number[2]?
1
Char Limit 3 - Start
a
Char Limit 3 - end
z
How many codes do you want?
5
pw - c3(letter)
pw - v1(letter)
pw - b9(letter)
pw - d4(letter)
pw - b7(letter) etc etc.


Can you guys understand it?

Thanks
 
Ew. You guys are ugly with a capital UG. Here, maybe this tiny ad can help:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic