• 1. 
    Ruby can deal with both numbers and floating point values.

  • True
  • False
  • 2. 
    The Ruby method for getting input from the user.

  • puts
  • print
  • gets
  • .chomp
  • 3. 
    A dynamic, reflective, object-oriented, general-purpose programming language. NOT to be confused with Ruby on Rails.

  • Java
  • Ruby
  • Javascript
  • C++
  • 4. 
    Print - takes whatever you give it and prints it to the screenExample:print "Hello World!"

  • Multi-Line Comments
  • Single Line Comment
  • Puts
  • Print
  • 5. 
    What is the output of given code?puts "what is your first name?" name=gets.chomp puts "what is your surname?" surname=gets.chomp

  • Error in compilation
  • What is your first name?xyz(enter any name)What is your surname?wtu(enter your surname)
  • Name=xyz
  • None of the mentioned
  • 6. 
    Ruby is a case-sensitive language.

  • True
  • False
  • 7. 
    What is the output of the given code?boolean_1 = 77<78 puts(boolean_1)

  • Nil
  • True
  • False
  • Error
  • 8. 
    Puts - adds a new (blank) line after the thing you want to print. NOT used with print, use puts rather than print.Example:puts "Hello World!"

  • Puts
  • Print
  • Method
  • Line Comment
  • 9. 
    What is the extension used for saving the ruby file?

  • .ruby extension
  • .rb extension
  • .rrb extension
  • None of the mentioned
  • 10. 
    What is the output of the given code?print "What's your address" city,state,pin=gets.chomp,gets.chomp,gets.chomp puts "Iam from #{city} city, #{state} state, pincode: #{pin} "

  • Error in compilation
  • Give your address
  • What’s your address? ChennaiTamil Nadu600048I am from Chennai city, Tamil Nadu state, pincode: 600048
  • None of the mentioned
  • 11. 
    For getting an input from the user which method is used?

  • get
  • gets.chomp
  • get-s
  • chomp
  • 12. 
    Ruby can be used for developing internet and intranet applications.

  • True
  • False
  • 13. 
    Which of the following is supported by Ruby?

  • Multiple Programming Paradigms
  • Dynamic Type System
  • Automatic Memory Management
  • All of the Mentioned
  • 14. 
    What will any variable evaluate to if it is of Boolean data type?

  • True
  • Nil
  • False
  • Either True or False
  • 15. 
    What is the output of the the given code? puts "My name is #{Name}"

  • Error in compilation
  • Name variable not defined earlier
  • My name is #{Name}
  • Undefined Error
  • 16. 
    Why can not we use quotation marks (‘ or “) with boolean?

  • It indicates that we are talking about a string
  • It indicates that we are assigning a value
  • It indicates that that we are replacing boolean data type with string data type
  • None of the mentioned
  • 17. 
    Which of the following datatypes are valid in Ruby?

  • Numbers
  • Boolean
  • String
  • All of the mentioned
  • 18. 
    Why is the library function ‘puts’used for?

  • Prints whatever is given and print it to the screen
  • Prints whatever is given and insert a new(blank) line
  • Gets input from the user
  • None of the mentioned
  • 19. 
    What does the notation \b stands for?

  • Escape
  • Space
  • Backspace
  • Newline
  • 20. 
    Which of the following is not a valid datatype?

  • Float
  • Integer
  • Binary
  • Timedate
  • 21. 
    The ability of a computer program to examine and modify the structure and behavior (specifically the values, meta-data, properties and functions) of the program at runtime.

  • Object Oriented Programming
  • Programming Paradigm
  • Reflective Programming Langauge
  • Methods
  • 22. 
    What is the output of the given code?print "Hey" puts "Everyone!" print "We are learning Ruby"

  • Error
  • Hey everyone we are learning Ruby
  • Hey everyone
  • Hey EveryoneWe are learning Ruby
  • 23. 
    We use semicolon or parentheses after every print or puts statement.

  • True
  • False
Report Question
warning
access_time
  Time