At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
It' s computer science, sweeties. tag @e.mccormick. He is the right one. (computer science student)
Does i ← 0 mean i=0? and i ← i + 2 mean i = i + 2?
Seems like some sort of meta language or logic description, and not really programming. However, the principal should be the same. A while loop continues as long is the condition is true. Therefore, because x is any positive, odd integer, and i starts at 0, the first time through i will become 2. If x is 1, this all ends right there. If x is not 1, then it is still greater than 2 and the loop starts over. Now i becomes 4. Again, is x 3? If so, the loop condition is met and it ends. Otherwise it repeats. This happens as many times as needed until i passes x, but it stops as soon as i passes x. Therefore.... can you see what i would have to be at that point?
seems like the answer is not that simple..but thx for ur input
hahaaha why do you say thank you to me? e.mccormick helps you, right?
wrong address, sweeties.!!
hmm... What language is it in. The ← may have a different meaning. Otherwise, \(i=x+1\) is the postcondition.
I don't know what language it is..
I know loser66, but u hooked it up lol
e.mccormick asks you about the program you study in C, C++ or java?
Not just those. I feel malia667 got the question. Like I thought, it sounds like it is just a meta language or something manufactured for the course. Here is a reference to the sort of pre-post analysis I did to come up with my answer. It should be correct, so I don't know why it would fail to follow the same rules they describe there. http://cs.engr.uky.edu/~lewis/essays/algorithms/correct/correct1.html
ok lemme take a look..yes its more of a general question
@oldrin.bataku any ideas on this one?
I can handle any CS or programming questions as well
Note that since \(x\) is odd and \(i\) is even, we end up with the smallest even \(i\) that is greater than our odd \(x\) -- which happens to just be \(i=x+1\).
ok just like what e.mccormick said..got it thanks :) let me see if that works
It should make intuitive sense that repeatedly adding \(2\) to \(0\) gives you successive even integers, and the loop terminates once we reach an even number greater than or equal to \(x\) -- it'll always \(>\) since \(x\) is odd and thus we see it is necessarily \(i=x+1\)