I’m trying to solve the Leap exercise of the C++ track.
My idea of solving the task is to create a function that takes an integer year as input and returns a boolean depending on whether the year is or isn’t a leap year:
When running the test, I’m getting an error message saying that ‘is_leap_year’ is not a member of ‘leap’.
I wanted to ask for a hint if there is anything wrong with the logic of my code, or if there is anything else I need to pay attention to in order to solve this exercise (e.g. there is also a helper file included, do I need to modify anything in that file as well)?
thank you! After adding bool is_leap_year(int year); to the header file, the code could be compiled.
I was able to solve the exercise afterwards (there was still a logic error in my code though which I had to fix first;)).
Maybe as feedback for this exercise: I think it is nowhere mentioned in the concepts/exercises that the function has to be declared in the header file as well. It would help a beginner to explain this somewhere first. Thanks!
I am a maintainer of the c++ track and I also wrote the syllabus to make it easier for students to grasp the concept of headers. There is a concept exercises in the syllabus for headers: Headers in C++ on Exercism. Do you think it needs any additional hints so that students can better understand the mechanics?
I’ve just skimmed through the headers syllabus and it contains all necessary information!
I think my problem was that I thought I have to go through the concepts in the syllabus from top to bottom, so from more basic concepts to more advanced ones.
Maybe it would help to leave a hint in the if syllabus to the headers syllabus.