Development ideas, coding, tutorials, war stories, app reviews and everything between.
Saturday, May 12, 2012
iOS Design Decisions - Part 2
With Mobile Register I'm performing a static list of calculations that only differs by what the user inputs and the choices they make.
Again I'm looking at the grocery store checkout process for the basis of my app.
First the app will total the list of items
Item1 $3
Item2 $3
Item3 $4
3 + 3 + 4
Total = $10
Tax Rate
Now that we have a total from the items the customer wants to buy we need to do a few checks.
Is there sales tax where the item is being sold?
Yes = Total * SalesTaxRate = NewTotal
No = Total
This is a good spot to mention something that new indie developers overlook. For the basic calculation we're performing it would look something like:
(total) * (salesTaxRate) = (salesTaxAmount)
10 * .05 = .50
What if the user inputs .5 instead of .05 for the sales tax rate?
The formula is now wrong and the customer is now being taxed $ 4.5 as opposed to $.45
You need checks and balances to determine how the values are being inputted and either correct the data or pop up a message indicating how the data needs to be entered.
The idea here is check if the number is already in the proper decimal form, if it is leave it alone, if it's a whole number divide it by 100.
Discounts
Is a discount being offered?
No = process the total amount due
Yes = calculate the discount with the process below
At some point the user will want to offer a coupon or sale wide discount. You could get fairly complex here and only apply it to certain items in the cart, we opted to just apply a discount to the total amount. It simplifies the interface and the user can just specify the amount when totaling up the customer items.
We offer two forms of discounts % or $ amount.
When the user selects discount it opens a separate view and lets them choose % or $ and then the amount.
We'll talk about the dollar one first because it's fairly straight forward, they enter the amount they want and it's just subtracted from the subtotal of the cart.
Cart Total = 10.50
Discount = .50
Total Amount Due = $10.00
When working with percentage discounts it's similar to the tax rate, you allow the user to input the amount. You then have your checks and balances to see how they entered the discount rate and adjust it accordingly so you can process your discount.
Cart Total = 10.50
Discount = .05 %
Total Amount Due = $10.00.
Qty
When the user is adding items to the cart they might sell more than 1 of each product so we need to calculate a qty against the sale price of the item. We do this before we start the total amount due calculation.
Summary
This really is a simple example, but I hope it shows the underlying message here. You can't assume the user knows how to use your app. You need to account for all situations and handle user input accordingly, this will ensure your apps success when the user doesn't have to think about how they input values into your app, "it just works".
Cheers,
Corey
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment