the question was of a low quality, in my opinion. the OP needed to read the assignment and then look at the code. the code satisfies the assignment.
this question is not Code Review.
No Offence, but the OP needs to have faith in themselves and their ability to follow directions (and read).
the OP is looking for confirmation that they did it right. they should turn it in, if it is wrong the teacher will be able to tell them what they did wrong and teach them the right way to do it.
I know that we do review code from homework assignments, but this isn't an instance where we can review the code.
the question asks a
yes or no question. which is covered in this FAQ
What types of questions should I avoid asking?
Some subjective questions are allowed, but “subjective” does not mean >“anything goes”. All subjective questions are expected to be constructive. >What does that mean? Constructive subjective questions:
inspire answers that explain “why” and “how”
tend to have long, not short, answers
have a constructive, fair, and impartial tone
invite sharing experiences over opinions
insist that opinion be backed up with facts and references
are more than just mindless social fun
(emphasis added by Malachi)