Make to program for a Cash register at a store:

advertisement
Make to program for a Cash register at a store:
1. Rewrite the question before you proceed into the wrong direction.
It is easy to misinterpret what the customer wants.
They may have no programming knowledge.
They may ask for too much
May not tell you all you need to know
Create the program for a Cash Register in a store. The program will accept a till at the start of the day.
As customers come in and make purchases it will calculate how much they buy. The Tax will be
calculated and a Total sale will result. The customer will then give a payment amount and change will be
given back.
Total sales for the day will be calculated and Total tax for the day will be calculated
2. Create a list of Inputs, Outputs, Processing and Storage needs
Input:
Till at the start of the day
Purchase price of one item
When the customer is done with purchase (FLAG = -99 or button)
Customer Payment (cash)

Output:
Change owed to customer
 Total Tax
Total for the end of the day
Total for each customer
Processing
 Total for the purchase (add all items for customer purchase) (Accumulator)
 Change to the customer( Cash given - Total)
 Tax (Total *.15)
 Total for the day (Accumulator)
 Total Tax for the day (Accumulator)
End of the day Till (Start of the day till + Total for the day)

Storage:
 Start of the day Till
Total Sales for the day
change
total purchase
Tax
Total Tax
3.Programmers must set parameters as to what will work and what will not work
Assume:
 Cash only
Limits:
 No bills larger than Purchase + Till
4.Break the problem down into main parts
Starting point info loaded
One customer
Repetition for next customer
End of day status
5.Break each step in 4 into parts
Starting point info loaded
Input cash on hand
Download