Think back to week one when you learned how to use terminal. In a short time, you mastered the Ruby basics (data types, variables, methods, data structures, etc.) and laid the foundation for the rest of your career as a Rubyist. Today you'll put that knowledge to the test.
In groups of 3-5 students, you must build a command line calculator.
1 You must spend the first 5 minutes as a group with laptops down mapping out the features you want to build and how you want a user to use your calculator.
Things to think about:
-
Do you want your user to enter a math problem like you would write it on paper (
1 + 1
) or do you want to take in each piece of data individually? -
Do you want your user to enter a
+
oradd
oraddition
or all three? -
What math problems do you want to solve? Just the basics? What about square roots?
-
Do you want a basic calculator or do you want it themed? (Students in the past have done a tip calculator to make eating out easier, or a average income generator, feel free to get creative!)
Once you have the big ideas settled, try using pseudo code to plan out methods you will want for your calculator. As an example, if we were building a method that is supposed to add a city to a list of cities it might look like this:
def add_city(city, list_of_cities)
add a city to a list or array of cities
end
Sure, you already know how to do this with an array, but if you didn't, writing out what you want the method to look like allows you to focus on what you are going to build so that writing the actual code becomes a separate step. This also allows all group members to participate in the planning process. You don't have to know the code you will use right away. Focus on describing the action you want the method to perform. With your group now, spend some time writing out pseudo code for each method you want in your calculator.
2 Keep in mind MVP (Minimum Viable Product). Remember, MVP is the smallest program you can build that offers value to the user. That is, make an app that has the minimum amount of features while offering a usable product. In terms of a calculator, maybe your app will only allow users to make calculations with the basic math operations. You might not want to include trig functions like cosine or the square root function in the MVP.
3 Every design decision has a trade-off. Focusing on one thing means you won't have time to focus on another.
4 You have two hours and 15 minutes to build your calculator.
5 Make sure your final project is hosted on github.com and that every group member has collaborator access to the repository.
-
Every group must present and every group member must contribute to the presentation.
-
Presentation should include a demo of your application, a description of the hardest technical challenge you faced, and a comment on the most fun part of building your application.