Produce a report that totals the number of sales in each city and then in each state.

Please help me with this ASAP.....
Thanks.......................

Here's a method to learn how to do this:
Ask yourself: What is the necessary data above to satisfy your output conditions?
Write it down on paper, the necessary fields from your input file.
Write a test case of sample input data that satisfies the input file requirements.
Using the necessary data, draw a box around your input statements that satisfy what you wrote down in step one.
Draw lines connecting the boxes, label the lines with the actions required to satisfy output conditions, label recursive actions with a separate box and a circular line stating loop conditions if necessary.