
-----------------------------------
lei4848
Mon Jun 19, 2006 9:53 pm

I have a question...
-----------------------------------
If an if statement containing many elsif parts and no else part

a)	Only one of the conditions is allowed to be true; otherwise there is an error.
b)	All the actions corresponding to true conditions are selected.
c)	Only the first true condition (if any ) is selected.
d)	At least one of the conditions is required to be true, otherwise there is a run-time error.
e)	None of the above.

-----------------------------------
TheOneTrueGod
Mon Jun 19, 2006 10:01 pm


-----------------------------------
d)

-----------------------------------
Martin
Mon Jun 19, 2006 10:17 pm


-----------------------------------
No.

The answer is c). Try it out and see


var x := 2
var y := 2
if x = 0 then
  put x
elsif x = 1 then
  put x
elsif x = 2 then
  put x
elsif y = 2
 puts "This isn't called!"
end if


-----------------------------------
Bored
Tue Jun 20, 2006 7:57 am


-----------------------------------
You shouldn't do peoples homework for them. This is obviously either a quiz question or homework question they don't know and are to lazy to check out.

-----------------------------------
TheOneTrueGod
Tue Jun 20, 2006 8:01 am


-----------------------------------
lol, I know, thats why I gave him the wrong answer...  Have more faith in my Turing knowledge :?

-----------------------------------
Bored
Tue Jun 20, 2006 8:02 am


-----------------------------------
I knew you did but it was Martin that was aimed at.

-----------------------------------
upthescale
Tue Jun 20, 2006 2:39 pm


-----------------------------------
No.

The answer is c). Try it out and see


 puts "This isn't called!"


Seems liek Martin is familiar with Ruby...

-----------------------------------
aldreneo
Wed Jun 21, 2006 12:42 pm


-----------------------------------
Or perl...Or was that C

AHHH this is what happens when you lean 5 languages at once
