Ruby

Ruby

1st Grade

80 Qs

quiz-placeholder

Similar activities

โครโมโซมและสารพันธุกรรม

โครโมโซมและสารพันธุกรรม

1st - 5th Grade

75 Qs

The Life and Works of Rizal

The Life and Works of Rizal

1st - 5th Grade

79 Qs

Chinese Test

Chinese Test

KG - Professional Development

79 Qs

PB & PW

PB & PW

1st Grade

80 Qs

Who Am I?

Who Am I?

1st Grade - Professional Development

75 Qs

Health & Safety plus general topics

Health & Safety plus general topics

1st - 3rd Grade

77 Qs

LATIHAN SOAL INFORMATIKA

LATIHAN SOAL INFORMATIKA

1st Grade

76 Qs

unit 1

unit 1

KG - 5th Grade

75 Qs

Ruby

Ruby

Assessment

Quiz

Education

1st Grade

Hard

Created by

Quang Văn

Used 1+ times

FREE Resource

80 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which variable name is valid in Ruby? (Choose one.)
3y
=FALSE()
_9class
xyz$
Pluto

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Given the following:

MSG = "hello"

MSG.upcase!

p MSG

What is the correct result? (Choose one.)

An error occurs because MSG is a constant.

HELLO is displayed without warning.

A warning apears because MSG is a constant but HELLO is displayed

hello is displayed since MSG is a constant.

3.

MULTIPLE SELECT QUESTION

20 sec • 1 pt

Which of the following statements are true? (Choose two.):
Local variables start with a lower case letter, and are two or more characters in length.
Global variables start with $.
Instance variables start with *.Constants start with an upper case letter.

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Choose one suitable name for the class variable.
@name
@@name
$name
$$name

5.

MULTIPLE SELECT QUESTION

20 sec • 1 pt

Select all correct variable names in Ruby
@s
@@s
@@@s
$$s

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Given the following:

MSG = "hello"

MSG = MSG.upcase

p MSG

What is the correct result? (Choose one.)

An error occurs because MSG is a constant.

HELLO is displayed without warning.

A warning apears because MSG is a constant but HELLO is displayed

hello is displayed since MSG is a constant.

7.

MULTIPLE SELECT QUESTION

20 sec • 1 pt

Which of the following can be inserted into __(1)__ in order to generate the output below? (Choose two.)

$code = "CODE"

__(1)__

puts "i like writing #{$code}"

puts "i like writing #$code"

puts 'i like writing #{$code}'

puts 'i like writing #$code'

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?