profile

Categories

Tags

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

Email

kblake DOT scc AT gmail DOT com

Presentations/Interviews

RubyLearning.com interview
Course Technology - Ruby on Rails Presentation



CIS 283 - Modules Assignment

February 7th, 2008 |

Get Modules Assignment

18 Responses to “CIS 283 - Modules Assignment”

  1. Karl M Kettelhut Says:
    Does anyone remember the package we need to include to be able to use the ask command?
  2. Angie Says:
    I think it was highline. something like require 'rubygems' require 'highline/import' ...not sure about that part.
  3. Angie Says:
    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.
  4. Karmen Says:
    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.
  5. Karmen Says:
    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.
  6. Karment Says:
    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.
  7. Lisa Says:
    Wouldn't the "highest" and "lowest" have to be in the Product class rather than the module?
  8. Karmen Says:
    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. :)
  9. Erica Says:
    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.
  10. Lisa Says:
    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?
  11. Warren Lewis Says:
    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.
  12. Karmen Says:
    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.
  13. Lisa Says:
    Then what is the purpose of the Product class?
  14. Sara Says:
    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".
  15. Karmen Says:
    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.
  16. Angie Says:
    Do you want us to write a program that gets user input for the shopping exercise?
  17. Karmen Says:
    reading from a file would be the most useful but not required. you may manually setup your objects and demonstrate they work.
  18. Lisa Says:
    Thanks all of you for your really great comments and help with this assignment!

Sorry, comments are closed for this article.