Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

1. Which of the following datatypes are valid in Ruby?
a) Numbers
b) Boolean
c) String
d) All of the mentioned

View Answer

Answer: d [Reason:] Ruby supports all the three (numbers,strings,boolean) data types.

2. What will any variable evaluate to if it is of Boolean data type?
a) True
b) Nil
c) False
d) Either True or False

View Answer

Answer: d [Reason:] Boolean data types will give the value either as True or False depending on the condition.

3. Why can not we use quotation marks (‘ or “) with boolean?
a) It indicates that we are talking about a string
b) It indicates that we are assining a value
c) It indicates that that we are replacing boolean data type with string data type
d) None of the mentioned

View Answer

Answer: a [Reason:] Quotation marks are used only with strings.

4. Ruby is a case-sensitive language.
a) True
b) False

View Answer

Answer: a [Reason:] Ruby differentiates between small and capital letters and their meaning.

5. What is the size of an integer data type in ruby?
a) -230 to 230
b) -230 to 2(30-1)
c) -229 to 230
d) -260 to 261

View Answer

Answer: b [Reason:] Integer ranges from -230 to 229 and lies in object of class Fixnum.

6. Ruby can deal with both numbers and floating point values.
a) True
b) False

View Answer

Answer: a [Reason:] We can assingn a integer and a floating point value to a variable.

7. What is the output of the given code?

boolean_1 = 77<78
   puts(boolean_1)

a) Nil
b) True
c) False
d) Error

View Answer

Answer: b [Reason:] As 77 is less than 78 hence the boolean value will be printed as true.

Output:
True

8. Objects of which class does the integer from the range -2^30 to 2^(30-1) belong to?
a) Bignum
b) Octal
c) Fixnum
d) Binary

View Answer

Answer: c [Reason:] Integer within this range are objects of the class fixnum.

9. What does the notataion b stands for?
a) Escape
b) Space
c) Backspace
d) Newline

View Answer

Answer: c [Reason:] This notataion is used for backspace.

10. What is the sequence of ruby strings?
a) 16-bit bytes
b) 8-bit bytes
c) 10-bit bytes
d) None of the mentioned

View Answer

Answer: b [Reason:] They are simply the sequence of 8-bit bytes.

11. What is the output of the given code?

my_string=Ruby
    puts(my_string)

a) Ruby
b) Nil
c) Error
d) None of the mentioned

View Answer

Answer: c [Reason:] Ruby should be written in double quotes inorder to indicate a string.

Output:
Error

12. Which of the following is not a valid datatype?
a) Float
b) Integer
c) Binary
d) Timedate

View Answer

Answer: d [Reason:] datetime is valid datatype but timedate is not a valid datatype.

13. What is the range of octal notation (nnn)?
a) 0-8
b) 0-7
c) 0-A
d) None of the mentioned

View Answer

Answer: b [Reason:] Octal notation ranges from 0-7.

Synopsis and Project Report

You can buy synopsis and project from distpub.com. Just visit https://distpub.com/product-category/projects/ and buy your university/institute project from distpub.com