Programming Exercise: Summary
Programming Exercise: Summary
Summary:
The submission should be a class library. You can opt to put a user interface on it if you wish, but
we will only be assessing the library portion of your work.
Your solution should contain some way of running automated tests to prove that it works.
Requirements:
Consider a grocery market where items have prices per unit but also volume prices. For example,
Apples may be $1.25 each, or 3 for $3.
Implement a class library for a point-of-sale scanning system that accepts an arbitrary ordering of
products, similar to what would happen at an actual checkout line, then returns the correct total
price for an entire shopping cart based on per-unit or volume prices as applicable.
Here are the products listed by code and the prices to use. There is no sales tax.
The interface at the top-level PointOfSaleTerminal service object should look something like this,
(written in pseudo-code for illustration purposes)
terminal.SetPricing(...);
terminal.ScanProduct("A");
terminal.ScanProduct("C");
// etc
decimal result = terminal.CalculateTotal();
You are free to define the pricing data model as you see fit.
Here are the minimal inputs you should use for your test cases. These test cases must be shown to
work in your program:
http://www.xe.com