In my code is there a way to create a password that prints a mixture of upper and lowercase letters using the methods i wrote? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

In my code is there a way to create a password that prints a mixture of upper and lowercase letters using the methods i wrote?

I tried something at the bottom of my code on line 125, I don't know if I was in the right track or not. https://code.sololearn.com/c126hCzRL0sB/?ref=app

28th Nov 2017, 8:51 AM
jalen
jalen - avatar
52 Answers
+ 1
I know my way of learning is that I code based on what I know and when I run into a problem I ask for help and when they return the code I research based on what was fixed or completed in my code that's what I'm going to do with the code u helped me with, also thanks for helping me with my code. :)
29th Nov 2017, 12:24 AM
jalen
jalen - avatar
+ 1
I will, in the future I'll look for resources online to give me a better understanding so I can learn what is challenging me and learn them 100% and be able to use them in various codes.
29th Nov 2017, 1:23 AM
jalen
jalen - avatar
+ 1
I as well like to look at the trending codes for help and I'll save them and look back at them when ever I need extra help, its always sort of helped and i sometimes even end up teaching myself something new to.
29th Nov 2017, 1:51 AM
jalen
jalen - avatar
+ 1
fixed it now I just need to change the first switch statement so just the 'random case' case recognizes it I was thinking of either using public or private or methods to make this happen.
4th Dec 2017, 7:14 AM
jalen
jalen - avatar
0
@john wells can you please help me I really need your help
29th Nov 2017, 11:01 AM
Zikiamin Mateo
Zikiamin Mateo - avatar
0
this is my number text me WhatsApp please +254720649231
29th Nov 2017, 11:02 AM
Zikiamin Mateo
Zikiamin Mateo - avatar
0
@John Wells I am confused on how the edit you wrote in my code works just so I can get a better understanding of it could you explain it? Some of the stuff you added was new to me and I tried researching it but I couldn't find anything.
29th Nov 2017, 12:01 PM
jalen
jalen - avatar
0
there is something important you to show me please
29th Nov 2017, 2:21 PM
Zikiamin Mateo
Zikiamin Mateo - avatar
0
here's a list of questions: •line 126 - I don't understand what it does or why we need it •128 - to me it looks like this is where it separates the letters into capital to lower case in the outcome like this, AzBh, correct me if I'm wrong though •129 - I understand what the += opperater does with int, I'm just curious of how it works with strings instead. help would be much appricated
29th Nov 2017, 3:28 PM
jalen
jalen - avatar
0
on line 130 what if we wanted to input more than 2 methods in the 'Letters' case would we have to change it to this and add another else statement with another 'Password.sayNumbers'? if(cc%3 == 0)
30th Nov 2017, 2:07 AM
jalen
jalen - avatar
0
Random sounds good but how would I do it, my thought was to use arrays but I don't know if that's the most efficient way or not.
30th Nov 2017, 2:32 AM
jalen
jalen - avatar
0
I'd get random positions before loop. Within loop see if you reached them. If so, call the selected function. If nor, get a random and call that function. u=random.nextInt(n); l=random.nextInt(n); for (int i = 0; i < n; i++) { if (i == u) s += ?.sayUppercase(); else if (i == l) s += ?.sayLowercase(); else { var r = random.nextInt(2); if (r == 0) s += ?.sayUppercase(); else s += ?.sayLowercase(); } }
30th Nov 2017, 2:56 AM
John Wells
John Wells - avatar
0
what does the ? mean in java?
30th Nov 2017, 3:07 AM
jalen
jalen - avatar
0
I'm sitting car waiting for daughter to get off work and didn't lookup your code so I couldn't remember your class name or variables.
30th Nov 2017, 3:09 AM
John Wells
John Wells - avatar
0
There is a ? operator, but that wasn't what I meant.
30th Nov 2017, 3:11 AM
John Wells
John Wells - avatar
0
oh I was just curious because I saw it in one of the comments above u posted about a code and ive never seen it before.
30th Nov 2017, 3:13 AM
jalen
jalen - avatar
0
interesting I'll have to give it a go in a code one of these times.
30th Nov 2017, 3:19 AM
jalen
jalen - avatar
0
I see is it tought in a solo learn course?
30th Nov 2017, 3:38 AM
jalen
jalen - avatar
0
I'll have to take a look around oracle looks like it has some useful info on there thanks for showing me this.
30th Nov 2017, 3:52 AM
jalen
jalen - avatar
0
@ jalen can you help me out please
30th Nov 2017, 3:57 AM
Zikiamin Mateo
Zikiamin Mateo - avatar