Fridays from now until the end of ski season will be short, partnerless days. That's not always bad though, it gives me time to catch up to Max, but I don't think that's going to happen any time soon. I moved on to lesson 2, which is about if/else statements. They seem fairly simple and very similar to the if/then statements of Visual Basic, only then gets replaced by cout or cin or some other function. I made the mistake of trying to expand on the example program before actually doing the program first, but I don't think that it means very much. I was testing to see if and was a legal function (example: if (x >= 0 and x <= 10) }). If anyone has any solution, or knows the actual coding for that type of statement, leave me a comment... please. In the meantime I'll be doing the next lessons, so if that pops up before someone tells me, I'll emphasize that.
Now I need to figure out what to do for my two hours...
...and don't we need to write up "proposals" for what we're doing (<-- question for Richard)
The bad pun titles are always going to reflect what I'm doing... and they're not going to stop anytime soon. :P
Saturday, January 26, 2008
Subscribe to:
Post Comments (Atom)
3 comments:
Yeah! For If statements you don't need to write the "then" .. it is already understood by the compiler. Here's the booleans:
AND - "&&"
OR - "||" (key underneath backspace)
NOT - "!"
Without the quotes of course... for example:
If ( !x == 1 ){
//when x doesn't equal 1
If ( x == 1 && y == 1 ){
//both x and y have to equal 1
If ( x == 1 || x == 2 ){
//x can be 1 or 2 but nothing else
I always assumed visual basic was some sort of "C" style coding...
Ok cool, I'll need to try that. And I used "then" as a comparison, I know that it's not used.
I just realized that I if I read just a little bit further I would have found that out X[
Post a Comment