HelloWorld.cpp 9 12 expected primary-expression before '=' token
HelloWorld.cpp 10 5 expected primary-expression before 'return'
HelloWorld.cpp 10 5 expected ';' before 'return'
HelloWorld.cpp 14 1 control reaches end of non-void function
If statements need to have their condition parenthesized. For example:
if(x + y > 2)
// do stuff...
Also, == does comparison, while = does assignment. I think you want the former.
Finally, you can't return a string from a function that returns a double (like you are on line 10). You'll need to do something else, like return a bad value (like 0) or throw an exception (though that is advanced).
When you see a line of compiler errors, look at the line number of the first syntax error. That's usually the offending line- everything else is just noise.
Try this for line 9:
if (ls-os == 0)
When you use one equal sign, you're setting it equal to that item. When you use two, you're checking to see. It's sort of the difference between asking and telling.
if(a == b)
vs. a = 5;
also... in line 10, "error" is a word, but your function needs to return a double value. Might want to take a look and see how you can fix that. Maybe you could stop bad data from going into the function instead of trying to throw it out? That might be easier. I hope this helps- good luck!