Would this be both a semantic error and a logic error?
23:42 15 Nov 2022

I am an AP computer science teacher.

I gave my students this question:

Imagine that you are building a program to automate the process of buying tickets for a concert. This is pseudocode for your program:

  1. Take user input ("How old are you?")

  2. If user age >= 18, print "You can enter the concert but you cannot buy alcohol."

  3. Else if user age >= 21, print "You can enter the concert and buy alcohol."

  4. Else, print "You may not go to the concert at all."

I asked them whether this was a syntax error, logic error, or semantic error.

My intention was that they choose logic error, but the students were saying that they should be given credit if they chose semantic error.

What are your thoughts?

I was really expecting logic error, because all they had to do is reverse the positions of the first and second Boolean conditions.

pseudocode