Cash Register Page
Assignment 4
How to enter quantities and prices in this program:
- Click on the button to start entering prices and amounts.
-
In each input dialog, enter data in the format
"3 @ $4.95",
which would mean "3 items at $4.95".
The Cents values must be exactly 2 digits.
-
The prices may be integers, with no decimal point:
"10 @ 15".
-
The dollar sign may be omitted, but the @ sign is
necessary.
-
A blank entry or 0 amount will terminate entry.
This program uses regular expressions to validate the input strings
and to extract values from them. This made it easy to allow the users
to enter both the quantity and the price of each item on the same
line, which I think is less confusing.
This page passes the W3C XHTML Validation test!