University of Utah

Highschool Programming Contest

2000


Back to the main page

Q: How do I ask a question?
A: Send mail to hspc@cs.utah.edu

Q (2/28/00): Do you consider the AP libraries (such as apvector.h, apstack.h, and apstring.h) part of the STL Libraries, and if so are they allowed for the take-home problem?
A: No. You the AP libraries are not part of the C++ standard. (Note that you will not have access to the AP classes on the day of the contest, either.)

Q (3/1/00): What is the maximum number of characters that will be in an input line? I.e., what is the maximum length of an expression to be evaluated?
A: 256 characters

Q (3/2/00): Is "log log 5" an allowed input or must it be written as "log ( log 5 )"?
A: It must be written "log ( log 5 )". You may assume that function arguments will always be in parentheses when they consist of more than one word.

Q (3/2/00): Is "negative (five minus three)" allowable?
A: No. The grammar definition doesn't include that construct since "negative" may operate only on a number.

Q (3/4/00): What should be output for an expression that includes a mod by zero?
A: The mod operator involves division, so a number mod zero should give the error message "DIVISION BY ZERO".

Q (3/6/00): Where can we find the STL's and information on how to use their public member functions?
A: The source that we use in our classes is: www.infosys.tuwien.ac.at/Research/Component/tutorial/prwmain.htm

Q (3/7/00): Does "negative five to the power of two" mean (-5)^2 or -(5^2)?
A: Note that "negative" is associated with a number, so that must be applied first. Hence, the first answer is correct.

Q (3/7/00): Does "log five" imply base e or 10? I noticed that in math.h log() is base e and log10() is base ten.
A: Let's go with the math.h definition and make it log base e. You can get log base 10 using other syntax. (I'll change the problem description to include that definition.)

Q (3/7/00): I have a follow up question on log. You said all answers would be integers, but how is that possible with a base of e?
A: Like the value returned from some of the other functions (including lg and log to the base anything else), you'll need to cast the result to an int.

Q (3/8/00): Another followup question. If there are multiple operations, should we cast the result to an int after each one or just at the end?
A: The result of each operation should generate an int.

Q (3/10/00): log 0 is undefined, so what do you want our programs to return?
A: That was an oversite on our part. We won't test log 0.

Q (3/10/00): The Meetamath2000 description states that this take-home problem will be graded out of 150 points, but shouldn't be graded out of 200 points like rules say?
A: Again, an oversite. In the final scoring the takehome will be normalized to match the other problems.

I.e. final_score = takehome_score*(200/150).

Q (3/10/00): I'm not sure about where to place the precedence of the "squared" and "cubed" operators. Do they take precedence before the "to the power of" operator or after, and if before, do they take precedence before or after the logs and roots operators? As examples, does "two to the power of three squared" mean (2^3)^2 or 2^(3^2)? Does "log three cubed" mean (ln 3)^3 or ln (3^3)?
A: "squared" and "cubed" are exponential operators like "to the power of" and thus have the same precedence. (I'll change the precedence list to include this.) These have lower precedence than logs and roots. Equal operators are evaulated left to right.

two the power of three squared = (2^3)^2

log three cubed = (ln 3)^3

Q (3/10/00): If the user just hits Enter, should the program keep waiting for input or should it output "UNKNOWN"?
A: A blank line should be ignored.

Q (3/?/00):
A:


hspc@cs.utah.edu
Last modified: Tues. March 8, 2000