-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathinstructions_and_questions.txt
39 lines (34 loc) · 1.76 KB
/
instructions_and_questions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Instructions for Mid-Term submission and Git Review (10pts):
- Create a git repository for your answers
- Add and Commit as you work through the questions and programming problems
- Your git log should reflect your work, don't just commit after you have finished working
- Use .gitignore to ignore any files that are not relevant to the midterm
- E-mail me your ssh public key
- I will email you back with your repository name
- Add a remote to your git repository: [email protected]:RubyFall2014/YOURREPOSITORYNAME.git
- Push your changes to the remote
- After 6pm Thursday November 13th you will not be able to push to your remote repository (or clone).
Questions (20pts):
- What are the three uses of the curly brackets {} in Ruby?
- What is a regular expression and what is a common use for them?
- What is the difference between how a String, a symbol, a FixNum, and a Float are stored in Ruby?
- Are these two statements equivalent? Why or Why Not?
1. x, y = "hello", "hello"
2. x = y = "hello"
- What is the difference between a Range and an Array?
- Why would I use a Hash instead of an Array?
- What is your favorite thing about Ruby so far?
- What is your least favorite thing about Ruby so far?
Programming Problems (10pts each):
- Write a passing rspec file called even_number_spec.rb that tests a class called EvenNumber.
- The EvenNumber class should:
- Only allow even numbers
- Get the next even number
- Compare even numbers
- Generate a range of even numbers
- Make the rspec tests in wish_list_spec.rb pass by writing a WishList class
- The WishList class should:
- Mixin Enumerable
- Define each so it returns wishes as strings with their index as part of the string
Mid-Term Spec (50pts):
- Make the tests pass.