The short definition for a function states that for every input there is EXACTLY one output. There doesn't even have to be a formula. Here, the input is the number of hours, and the output is the cost. If you assume that there will not be multiple charges for the same 3hours of class, then yes, this is a function. If you want to argue that, based on student loans, scholarships, and other financial aid, different students pay different rates, then this is NOT a function. Since we have no numbers or context, it's unclear.