DISC 4372 NAME_________________________________________
Parks Fall 2000
Midterm Exam
 
GL_________ SSN_______________________________

1. (60 points) A user loads an HTML file which returns a form containing: cardnum and qmonth (both integers). The form is submitted to q1.asp to create a report of credit cards charges. Credit card data is stored in a table (named charges). The elements of charges are: (1) cardnum (integer not null); (2) charge-id (integer not null); (3) charge-year (string); (4) charge-month (string); (5) charge-day (string); (6) amount (two digit decimal); (7) vendor (string); (8) city (string); (9) state (string); (10) country (string); (11) and challenge-flag (string). Both cardnum and charge-id values are unique.

Write the q1.asp program that allows credit card charges to be challenged. The first pass produces a report that shows the data from charges for the cardnum during the qmonth provided by the user (i.e., the user provides their cardnum and month, and the asp returns all charges for this cardnum during this desired month). The data should appear in a HTML table. The data appears only as text (not in text boxes) except for charge-id. This field should NOT be displayed -- but stored as a hidden variables named cid1, cid2, cid3,...etc.. The asp should also write two hidden variables to the HTML page: (1) rcount that contains the count of rows returned; and (2) cardnum containing the card-num as a value.

Each charge appearing in the HTML table also has a checkbox appearing in that table row. The checkboxes are named c1, c2, c3, c4,...etc. The form created by the asp program is named bform. A submit button appears after the table. For example:

Cryptic Credit for Card Number 1234567891 for Month 10
Check here to
challenge this charge
Date Amount Vendor City,State,Country
99-10-17 114.46 Harrods New York, NY, USA
99-10-24 1,214.32 Macys Atlanta, GA, USA
99-10-28 413.99 Gallery Furniture Houston, TX, USA

This form submitted by user will therefore contain for each HTML row: (1) a hidden value of charge-id and (2) the result of the checkbox. The cardnum is also returned in the request.

The second pass of q1.asp program will update the charges table with this form data. Specifically, if the user has checked the charge on the report, the value of challenge-flag should be set to "C" for the particular charge-id. If the entry is not checked -- do nothing. Run the update under transaction control.

q1.asp will then return to the user an HTML report that shows ONLY the total number of charges that were challenged (i.e., the number of charges where challenge-flag was set to "C"). Show only the code for the two passes that make up q1.asp. Do NOT WRITE the initial HTML file that collects the cardnum and month. q1.asp can assume that cardnum and month have been validated as integers and that month is between 1 and 12.

2. (40 points) Using the table charges as defined above, write an asp program that produces a report of credit card charges that have been challenged. The report should be in ascending cardnum order. It should report only those cardnum's where charges that have been challenged (i.e., challenge-flag="C"). Show the detail of each challenge charge and produce a sub-total of challenged charges for each cardnum and a grand total of challenged charges at the end.