CSE 3901 – MIDTERM 1 // ORGANIZED PRACTICE
QUESTIONS // EXPERT-CRAFTED LEARNING
MATERIAL // COMPREHENSIVE STUDY GUIDE //
BRAND NEW EDITION!!!!!
a pointer to a commit - THE CORRECT ANSWER -github: what is
a branch?
git branch nameOfBranch - THE CORRECT ANSWER -github:
command to create a new branch
git checkout fix - THE CORRECT ANSWER -github: change to
branch titled 'fix'
git add --all . git commit - THE CORRECT ANSWER -github: add
and commit changes to local store
http://web.cse.ohiostate.edu/~giles/3901/lectures/lecture0
2.pdf - THE CORRECT ANSWER -github: problem on slide 42
http://web.cse.ohiostate.edu/~giles/3901/lectures/lecture0
2.pdf
0, 1, 2, 3, 4 - THE CORRECT ANSWER -ruby: what is the
following range 0..4
0, 1, 2, 3 - THE CORRECT ANSWER -ruby: what is the following
range
0...4
,Returns -1/0/1 if LHS is smaller/equal/larger than RHS - THE
CORRECT ANSWER -ruby: what does the <=> operator do?
-1 - THE CORRECT ANSWER -ruby: what does "cab" <=> "da"
return?
1 - THE CORRECT ANSWER -ruby: what does "cab" <=> "ba"
return?
i = 34, j = 35 - THE CORRECT ANSWER
-i = 34 j = i # i and j are aliases j = j +
1 # does this increment i too? what is
the value of i and j?
prints 0 to 24 - THE CORRECT ANSWER -what does the following
statement do?
i = 10
25.times { | i | puts i }
"tania".length - THE CORRECT ANSWER -ruby: write a statement
that returns the length of your name
"exam".reverse - THE CORRECT ANSWER -ruby: write a
statement that reverses the word "exam"
, puts "Tania".upcase - THE CORRECT ANSWER -ruby: write a
statement that prints "Tania" in uppercase
puts "Tania".downcase - THE CORRECT ANSWER -ruby: write a
statement that prints "Tania" in lowercase
puts "What is your first name?" name
= gets.chomp
puts "Your first name is #{name.capitalize!}" - THE CORRECT
ANSWER -ruby: write a statement that asks for the users first
name and prints the result in the following format: Your first
name is (name). The name should be capitalized
for i in 1..20
next if i % 2 != 0
puts i
end - THE CORRECT ANSWER -ruby: write a for loop that prints
all even numbers between 1 and 20
num = 1 until
num > 10
puts num
num += 1
end - THE CORRECT ANSWER -ruby: write a looping using until
that prints numbers 1 to 20
Start of method
QUESTIONS // EXPERT-CRAFTED LEARNING
MATERIAL // COMPREHENSIVE STUDY GUIDE //
BRAND NEW EDITION!!!!!
a pointer to a commit - THE CORRECT ANSWER -github: what is
a branch?
git branch nameOfBranch - THE CORRECT ANSWER -github:
command to create a new branch
git checkout fix - THE CORRECT ANSWER -github: change to
branch titled 'fix'
git add --all . git commit - THE CORRECT ANSWER -github: add
and commit changes to local store
http://web.cse.ohiostate.edu/~giles/3901/lectures/lecture0
2.pdf - THE CORRECT ANSWER -github: problem on slide 42
http://web.cse.ohiostate.edu/~giles/3901/lectures/lecture0
2.pdf
0, 1, 2, 3, 4 - THE CORRECT ANSWER -ruby: what is the
following range 0..4
0, 1, 2, 3 - THE CORRECT ANSWER -ruby: what is the following
range
0...4
,Returns -1/0/1 if LHS is smaller/equal/larger than RHS - THE
CORRECT ANSWER -ruby: what does the <=> operator do?
-1 - THE CORRECT ANSWER -ruby: what does "cab" <=> "da"
return?
1 - THE CORRECT ANSWER -ruby: what does "cab" <=> "ba"
return?
i = 34, j = 35 - THE CORRECT ANSWER
-i = 34 j = i # i and j are aliases j = j +
1 # does this increment i too? what is
the value of i and j?
prints 0 to 24 - THE CORRECT ANSWER -what does the following
statement do?
i = 10
25.times { | i | puts i }
"tania".length - THE CORRECT ANSWER -ruby: write a statement
that returns the length of your name
"exam".reverse - THE CORRECT ANSWER -ruby: write a
statement that reverses the word "exam"
, puts "Tania".upcase - THE CORRECT ANSWER -ruby: write a
statement that prints "Tania" in uppercase
puts "Tania".downcase - THE CORRECT ANSWER -ruby: write a
statement that prints "Tania" in lowercase
puts "What is your first name?" name
= gets.chomp
puts "Your first name is #{name.capitalize!}" - THE CORRECT
ANSWER -ruby: write a statement that asks for the users first
name and prints the result in the following format: Your first
name is (name). The name should be capitalized
for i in 1..20
next if i % 2 != 0
puts i
end - THE CORRECT ANSWER -ruby: write a for loop that prints
all even numbers between 1 and 20
num = 1 until
num > 10
puts num
num += 1
end - THE CORRECT ANSWER -ruby: write a looping using until
that prints numbers 1 to 20
Start of method