RubybeginnercliAI generated

Grocery Unit Price Comparator CLI

Build a Ruby command-line tool that compares grocery items by normalizing price per unit (per ounce, per liter, etc.) so users can find the better deal between different package sizes. Learners practice basic Ruby classes, method design, and command-line input parsing.

Estimate
~5.5h
Steps
4
Completed by
0
Proposed by
codeseed.app

Standard Library

Project roadmap

  1. 01

    Model a GroceryItem class

    ~1.5h

    Create a class storing name, price, quantity, and unit, with a method that computes price per standard unit.

  2. 02

    Handle unit conversion

    ~1.5h

    Add conversion logic so ounces/pounds and milliliters/liters can be compared on a common base unit.

  3. 03

    Build the CLI input loop

    ~1.5h

    Prompt the user to enter multiple items and store them in a list for comparison.

  4. 04

    Print a ranked comparison

    ~1h

    Sort items by price-per-unit and print a formatted table highlighting the best deal.

Resources

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~5.5h · 4 steps

Tech stack

Standard Library