What is definition of value mentioned in, for example, string(variableName | value)? Are value and expression same? It looks like that value can take the form 32 * 12 * multiplier.
What can be value of right hand side of arithmetic = operator?
Form the examples I would infer that its a general expression.
The string function can take as inputs a value, an expression and a variable name. Hope this clarifies.
Hey Minh-Nhut Hong,
The following calls to string were provided as examples in the problem definition:
var str3 = string(35 + 12);
string(32 * 12 * multiplier);
var str4 = "result: " + string(50 / 2);
output("srq: " + string(sqrt(30)));
output("Value for a: " + string(a));
output("Value for b: " + string(b));
var message = "a / b = ";
message = message + string(a / b);
This code is correct?
var a = 1+-5;
var b = -+-a + 5;
a = -4;
b = 1;
It is my understanding that unary operators aren't support so things like 'a=1+-5' and b=-+-a+5' would be invalid.
Once again I'd like to be able to implement a general unary expression or special-case leading negative and be assured that problem set will not explicitly require syntax error on input like:
var c = -(a+b);
I want to support thegeneral unary expression
What's the point of unary negation? Why add more complexity to this already out of hand syntax when there is so little time left to implement a solution?
My vote goes for 0 - 1 style negation. It gets the job done without changing the spec.