Karmen Blake
Agile Developer and Instructor
Categories
- Courses (15)
Archives
- June 2008 (2)
- May 2008 (10)
- April 2008 (16)
- March 2008 (8)
- February 2008 (10)
- January 2008 (14)
- December 2007 (4)
- November 2007 (7)
- October 2007 (25)
Tags
- 206 (10)
- 234 (7)
- 282 (10)
- 283 (29)
- 284 (29)
- agile (1)
- announcements (10)
- articles (2)
- assignments (10)
- contest (1)
- employment (1)
- humor (5)
- linux (5)
- location (1)
- microsoft (1)
- office (1)
- preregistration (1)
- rails (4)
- ruby (14)
- scc (2)
- scripting (4)
- syllabi (3)
- syllabus (1)
- tips (1)
- unix (2)
- video (1)
- videos (7)
- web (2)
- windows (3)
Welcome!
You'll find my course content and collaborative discussion about technology.
I teach as an adjunct faculty in the Computer Information Systems department at Spokane Community College
Presentations/Interviews
RubyLearning.com interviewCourse Technology - Ruby on Rails Presentation
CIS 283 - Modules Assignment
February 7th, 2008 |
18 Responses to “CIS 283 - Modules Assignment”
Sorry, comments are closed for this article.
February 9th, 2008 at 07:45 AM Does anyone remember the package we need to include to be able to use the ask command?
February 9th, 2008 at 11:35 AM I think it was highline. something like require 'rubygems' require 'highline/import' ...not sure about that part.
February 9th, 2008 at 03:07 PM Karmen, can you give us another module example? It's not that I don't understand the one's that's up, I just need something a little closer to the shopping assignment. Like you want all those methods to be in shopify, but your example only uses comments, and only for 1 product or course. I'm pretty much lost atm.
February 10th, 2008 at 09:35 AM The examples I've given as, as well as the one in the book, are conceptually close to what you need to do in the assignment. Also googling for "ruby modules examples" sure comes up with plenty of examples. :) I usually don't give cookie cutter examples that do the assignment for you. You need to take the tools given and solve the problem at hand.
February 10th, 2008 at 10:53 AM if any of you need me to take a peak at what you have so far, feel free to send me an email of your code.
February 10th, 2008 at 11:13 AM make sure you do the stacklike exercise before the shopify exercise. In addition to the provided examples, the stacklike exercise is intended to get you even more familiar with using modules.
February 10th, 2008 at 11:57 AM Wouldn't the "highest" and "lowest" have to be in the Product class rather than the module?
February 10th, 2008 at 01:53 PM when you create the highest and lowest methods in the module, you'll include them into the Product class which makes it a part of the Product class. That is what makes modules cool. :)
February 11th, 2008 at 05:58 PM Does that mean you want us to include Shopify in both the Product and Shopper classes? The directions only say to include it in the Shopper class.
February 11th, 2008 at 07:31 PM Karmen, I am so struggling with this assignment. I googled "ruby modules examples" and I'm still not finding anything similar to what we are trying to do. I'm lost. Any suggestions?
February 11th, 2008 at 08:29 PM Maybe it would help to know what shopify is supposed to BE, not what it is supposed to DO. It could be a store inventory, or it could be a shopping cart. "Shopify" doesn't tell me much! I think I'm going to treat it like a shopping cart.
February 12th, 2008 at 07:48 AM yes, the module is supposed to be included into Shopper as written in the assignment.
The examples I've given are enough tools for you to do the assignment. I mentioned googling for examples to help you understand modules better. Remember, you will not find cookie cutter examples that solve the assignment problem. The assignment problem is for you to solve.
February 12th, 2008 at 01:34 PM Then what is the purpose of the Product class?
February 12th, 2008 at 06:49 PM I looked at Product as just an object that has two attributes that I could use (Product.name and Product.price). In the screencasts and the reading, the module was described is a container that holds objects (i.e., Products). So I looked at Shopify as a "shopping cart" that contains any number of Product objects. I then included Shopify in my Shopper class. This allowed me to using things like "Shopper.total_price" and "Shopper.add_product".
February 12th, 2008 at 07:52 PM The Product class encompasses two attributes name and price. the shopify module then encompasses a collection of objects, in this cased products. so that a shopper, in this case, has a collection of product objects.
February 13th, 2008 at 07:35 AM Do you want us to write a program that gets user input for the shopping exercise?
February 13th, 2008 at 08:24 AM reading from a file would be the most useful but not required. you may manually setup your objects and demonstrate they work.
February 13th, 2008 at 03:09 PM Thanks all of you for your really great comments and help with this assignment!