0

(Age Group) Iā€™m stuck with a section of code on module 3 and need help

I wrote the code for the child age group and it worked but when I added the other code for the other 2 age groups it breaks all of the code and would just like some pointers as to where Iā€™ve gone wrong or whether itā€™s just a bug? if(age <11) Console.WriteLine(ā€œChildā€); //works perfectly on its own //this is what breaks everything else if(age >= 11 && <= 17) Console.WriteLine(ā€œTeenā€); else if(age >= 18 && <= 64) Console.WriteLine(ā€œAdultā€);

28th Dec 2022, 2:17 AM
Will Ross
4 Answers
+ 1
I've found out the hard way that we need to add as tags, the language we need help with šŸ™ˆ Not even sure in what language you are working(im a newb), but it feels like there should be another "age" variable in both cases... Just my assumption... Like: else if (age >= 11 && age <=17) As I said , I'm not sure , cause don't even know the language (tho they all start to look alike after you learn one of them) Try that out,maybe it worksšŸ™ˆ
28th Dec 2022, 2:56 AM
Eugene
Eugene - avatar
+ 1
You are a genius and im stupid šŸ˜‚ you were in fact correct ive spent nearly 2 hours working on this so thank you very much! Its also in C#, again thank you so much! I need to sharpen my eyes šŸ˜
28th Dec 2022, 3:03 AM
Will Ross
+ 1
Will Ross ohh, trust me, I know what you mean. I had trouble when I started also šŸ™ˆ I think my longest one that took me to complete was around 5 hours(and I didn't want to just look up the answeršŸ¤£ was a matter of principle) And it will get harder to learn, but once you get it, it gets easy! I promisešŸ™ˆšŸ¤£ Some tips that helped me : -Don't be shy to go back and re-read the whole course if you need to. -Compare your code to examples given. And -If a topic is hard to understand here at SoloLearn , go on other sites where there's more info on that specific topic/course! Practice everyday and don't give up! We can do it!šŸ’Ŗ
28th Dec 2022, 3:15 AM
Eugene
Eugene - avatar
+ 1
Eugene thank you lol! Such a complex language looking at it as a starter but hoping i can get it integrated into my brain soon! Had no issues since, i just cant believe how simple the solution wasā€¦!
28th Dec 2022, 3:56 AM
Will Ross