Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
quiz 3 questions
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Giselle  
View profile  
 More options Sep 29 2009, 6:43 pm
From: Giselle <gg.se...@gmail.com>
Date: Tue, 29 Sep 2009 15:43:04 -0700 (PDT)
Local: Tues, Sep 29 2009 6:43 pm
Subject: quiz 3 questions
question 2
a =10
(a < 100) && true && (puts "Made it here!")

my answer: (no output)
correct answer: "Made it here!"
answer according to irb: "Made it here" with =>nil right below it.

i'm confused. what's the difference between =>nil and (no output)?

question 3
a=10
(a>=0) || (puts "Greater than or equal to")

my answer: true
correct answer: (no output)
answer according to irb: true

what's going on here?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Julian Hartline  
View profile  
 More options Sep 29 2009, 6:50 pm
From: Julian Hartline <julian...@gmail.com>
Date: Tue, 29 Sep 2009 15:50:05 -0700 (PDT)
Local: Tues, Sep 29 2009 6:50 pm
Subject: Re: quiz 3 questions
Your quiz is asking you for the OUTPUT of the code snippet.
What IRB gives you is the output AND the return value.

In IRB if you type puts "Hello World" the output will be "Hello World"
but the return value will be nil.
If you type 1 + 2 there will be no output (because you don't have a
puts statement) but IRB will show you the return value which is 3.

-Julian

On Sep 29, 5:43 pm, Giselle <gg.se...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »