-
Notifications
You must be signed in to change notification settings - Fork 97
/
diagnostic.js
25 lines (24 loc) · 1.03 KB
/
diagnostic.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/// Ember Object Diagnostic ///
// Use Ember Objects and Classes to represent a shopping cart!
// Your abstractions will be `Cart` and `Order`.
//
// An Order should have
// - a unit price
// - a quantity
// - a computed property called `orderPrice`, equal to price times quantity
//
// A Cart should have
// - an `addToCart` method, which adds a given Item to an array
// called `orders` (HINT: You'll probably need to look through the
// documentation for this one.)
// - a computed property called `totalPrice`, equal to the sum of
// the `orderPrice` values for everything in the cart); it should be
// recalculated any time an Order is added to the cart, removed from the
// cart, or modified.
//
// Once you've created the necessary Ember Classes, create a new Cart instance,
// and fill that cart up with three new product orders having the following
// quantities, product names, and prices:
// - Order 1 : 2 hats ($5 each)
// - Order 2 : 1 desk lamp ($20 each)
// - Order 3 : 3 hand towels ($8 each)