CSE 3901 MIDTERM 1 FULL REVISION NOTES
WITH GIT, VERSION CONTROL, AND
DEVELOPMENT WORKFLOW CONCEPTS
◉ Interpreted Program.
Answer: Run a program directly, without compiling
pro:
platform independence
read-eval-print loop (REPL)
reflection
con:
speed
later error detection
◉ Dynamically typed.
Answer: objects have types, variables don't
◉ Objects in Ruby?.
Answer: Everything
,◉ Fixnum Numbers in Ruby.
Answer: 83, 0123, 0x53, 0b1010011, 0b101_0011
◉ Float Numbers in Ruby.
Answer: 123.45, 1.2345e2, 12345E-2
◉ Rational Numbers in Ruby.
Answer: 2/3r
◉ Complex Numbers in Ruby.
Answer: 4+3i
◉ Strings Delimeters.
Answer: " " and ' '
◉ String Interpolations inside " ".
Answer: #{ ... } --> allows executions inside string
◉ Range inclusive.
Answer: 0..4
,◉ Range end exclusive.
Answer: 0...4
◉ Single Line comment.
Answer: # start with hashtag/pound/octothorpe
◉ Multi-line comment.
Answer: =being
words
words word
=end
# MUST appear at beginning of line
◉ Arithmetic Operators.
Answer: + - ** / % ***
◉ Integer / (div) rounds towards.
Answer: negative infinity
◉ .0.
Answer: 0.33333333333333333333333
, ◉ .
Answer: 0
◉ -.
Answer: -1
◉ -1 % 3.
Answer: 2
◉ 25 % 3.
Answer: 1
◉ Bitwise Operators.
Answer: ~ | & ^ << >>
◉ 5 | 2.
Answer: 7
◉ 13 ^ 6.
Answer: 11
WITH GIT, VERSION CONTROL, AND
DEVELOPMENT WORKFLOW CONCEPTS
◉ Interpreted Program.
Answer: Run a program directly, without compiling
pro:
platform independence
read-eval-print loop (REPL)
reflection
con:
speed
later error detection
◉ Dynamically typed.
Answer: objects have types, variables don't
◉ Objects in Ruby?.
Answer: Everything
,◉ Fixnum Numbers in Ruby.
Answer: 83, 0123, 0x53, 0b1010011, 0b101_0011
◉ Float Numbers in Ruby.
Answer: 123.45, 1.2345e2, 12345E-2
◉ Rational Numbers in Ruby.
Answer: 2/3r
◉ Complex Numbers in Ruby.
Answer: 4+3i
◉ Strings Delimeters.
Answer: " " and ' '
◉ String Interpolations inside " ".
Answer: #{ ... } --> allows executions inside string
◉ Range inclusive.
Answer: 0..4
,◉ Range end exclusive.
Answer: 0...4
◉ Single Line comment.
Answer: # start with hashtag/pound/octothorpe
◉ Multi-line comment.
Answer: =being
words
words word
=end
# MUST appear at beginning of line
◉ Arithmetic Operators.
Answer: + - ** / % ***
◉ Integer / (div) rounds towards.
Answer: negative infinity
◉ .0.
Answer: 0.33333333333333333333333
, ◉ .
Answer: 0
◉ -.
Answer: -1
◉ -1 % 3.
Answer: 2
◉ 25 % 3.
Answer: 1
◉ Bitwise Operators.
Answer: ~ | & ^ << >>
◉ 5 | 2.
Answer: 7
◉ 13 ^ 6.
Answer: 11