• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 3 out of 29 pages
Exam (elaborations)

CSE 3901 Final Exam WITH CORRECT ANSWERS

Document preview thumbnail
Preview 3 out of 29 pages

CSE 3901 Final Exam WITH CORRECT ANSWERS

Content preview

CSE 3901 Final Exam WITH CORRECT |\ |\ |\ |\ |\ |\




ANSWERS


in ruby, objects... - CORRECT ANSWERS ✔✔have types, but
|\ |\ |\ |\ |\ |\ |\ |\ |\


variables don't |\




ruby is an interpreted program, list advantages and
|\ |\ |\ |\ |\ |\ |\ |\


disadvantages - CORRECT ANSWERS ✔✔Advantages |\ |\ |\ |\




- platform independence
|\ |\




- read-eval-print loop
|\ |\




- reflection
|\




Disads
- speed
|\




- later error detection at run time
|\ |\ |\ |\ |\ |\




List examples of number literals in Ruby - CORRECT ANSWERS
|\ |\ |\ |\ |\ |\ |\ |\ |\ |\


✔✔83, 0123, 0x53, 0b1010011, 0b101_0011, 123.45, 1.2345e2,
|\ |\ |\ |\ |\ |\ |\


2/3r


string literals in ruby - CORRECT ANSWERS ✔✔" " and ' ' are
|\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\


delimeters, interpolation of #{ } occurs inside " " |\ |\ |\ |\ |\ |\ |\ |\




%Q" ... " custom delimeters or q
|\ |\ |\ |\ |\ |\




ranges in ruby... - CORRECT ANSWERS ✔✔0..4 is end inclusive (0,
|\ |\ |\ |\ |\ |\ |\ |\ |\ |\


1, 2, 3, 4)
|\ |\ |\ |\

,0...4 is end exclusive (0, 1, 2, 3)
|\ |\ |\ |\ |\ |\ |\




single line comment in Ruby, multi line looks... - CORRECT
|\ |\ |\ |\ |\ |\ |\ |\ |\ |\


ANSWERS ✔✔#This is a comment |\ |\ |\ |\




=begin
...comment
=end


what does ** do? what about %? - CORRECT ANSWERS ✔✔power
|\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\


so 2**2 is 2 squared
|\ |\ |\ |\




% is modulus not remainder
|\ |\ |\ |\




difference between 1/3r / 1/2r and (1/3r) / (1/2r)... - CORRECT
|\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\


ANSWERS ✔✔first one is 1/6r since it is basically (1/3r)/2r and the
|\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\


second one is 2/3r actual division
|\ |\ |\ |\ |\ |\




what is <=>? - CORRECT ANSWERS ✔✔spaceship
|\ |\ |\ |\ |\ |\ |\


operator...returns -1/0/1 if LHS is smaller/equal/larger than RHS |\ |\ |\ |\ |\ |\ |\




what is self and nil? - CORRECT ANSWERS ✔✔self is the receiver
|\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\


of the current method and nil is nothingness
|\ |\ |\ |\ |\ |\ |\




nil evaluates to... - CORRECT ANSWERS ✔✔false
|\ |\ |\ |\ |\ |\

, local variables start with - CORRECT ANSWERS ✔✔lowercase or _
|\ |\ |\ |\ |\ |\ |\ |\ |\




global variables start with... - CORRECT ANSWERS ✔✔$
|\ |\ |\ |\ |\ |\ |\




instances start with... - CORRECT ANSWERS ✔✔@ |\ |\ |\ |\ |\ |\




class variables start with... - CORRECT ANSWERS ✔✔@@
|\ |\ |\ |\ |\ |\ |\




conditional syntax in ruby... - CORRECT ANSWERS ✔✔if-elsif-else- |\ |\ |\ |\ |\ |\ |\


end


basic iteration syntax - CORRECT ANSWERS ✔✔while (condition)
|\ |\ |\ |\ |\ |\ |\ |\


do...
until (condition) do... |\ |\




begin i = i+1 end while i < max |\ |\ |\ |\ |\ |\ |\ |\




keyword def for definition |\ |\ |\




- no types for parameters
|\ |\ |\ |\




- no return type
|\ |\ |\




all functions return something
|\ |\ |\




def foo(x, y) |\ |\




|\ x + y (last statement is returned)
|\ |\ |\ |\ |\ |\




end - CORRECT ANSWERS ✔✔
|\ |\ |\ |\

Document information

Uploaded on
August 25, 2025
Number of pages
29
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$22.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
EXAMSTUDYPLUG
4.5
(242)
Sold
386
Followers
107
Items
20954
Last sold
1 day ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions