+ 2
Need some help with this C# code please. New to this.
8 Respuestas
+ 1
Everything works fine except when user is too young.
Seems to repeat it's self infinitely.
Please Halllp 😅
+ 1
You read in an age, if it is less than 18, you do repeat infinitely. You need to either reread the age within the while, if you think they might suddenly have a birthday, or remove the while loop as it doesn't change the age so is infinite.
+ 1
If they are 17, it isn't likely their birthday is in a minute. I'd delete the while and make it so the rest of the code is in the else of the <= 17.
+ 1
Try this:
https://code.sololearn.com/c7aIpCm2XR0I
0
Thanks guys, just have a hard time wrapping my head around it. I've gotten it to work without the Array on on another code on my profile.
So I need to remove the while () and add something to check if they had a birthday?
0
also I've tried adding breaks but it just ends the entire program 😓
0
Thanks Happy.
how would that look if you don't mind me asking
0
Thanks mate