Category
{
String Name
}
Product
{
String Name
Decimal SinglePrice
Integer Amount
Category Category
}
Order
{
String CustomerName
List Products
}
- Calculate total order price
- Is used when CustomerName is Ivo
- Result must be sorted on CustomerName ASC
- Add $5 to each product price.
- The first three products sorted by product price get a 10% discount!
- All original prices must be stored as well as the results.
- Total price per product.
- The categories should have the total price for all the product they have in the order.
- Is used when CustomerName is Twan
- Result must be sorted on CustomerName DESC
- If product is in
Beer
category, single product price must be multiplied by Pi. - All original prices must be stored as well as the results.
- To calculate the order total: first use all products where the name starts with A, then B,
then C, continue. Within a group (A, B, C...) start with the first group and set the group
price to
TemporaryTotal = sum(p.SinglePrice) * sum(p.Amount))+TemporaryTotal
. The sum of the group prices is the order price. - The categories should have the total price for all the product they have in the order.