Answers:
Note: None of the "style" attributes that appear in the source code are required.
Exam Text Below:
bridge_id bigint identity (1,1),
scout_id int,
scout_first_name varchar(15),
scout_last_name varchar(15),
sales_type_1 int, [this records the number of boxes of "Double Fudge" cookies sold]
sales_type_2 int, [this records the number of boxes of "Mint Fudge" cookies sold]
sales_type_3 int, [this records the number of boxes ofsales of "Cherry Fudge" cookies sold]
sales_type_4 int, [this records the number of boxes ofsales of "Vanilla Fudge" cookies sold]
sales_type_5 int, [this records the number of boxes ofsales of "Raspberry Fudge" cookies sold]
sales_total int, [this records the total number of boxes of sold of ALL cookies]
PRIMARY KEY (bridge_id)
Create a three pass *.asp program named sales_update.asp to record (i.e., update) a scout's sales efforts. Assume the cookmast table exists and has data for each scout in ALL the fields (i.e., no column values are empty or null). The program should:
Roll out ALL the scouts (one per row) to provide a link to the second pass that allows the user to choose a scout to update by clicking on the link. The clickable part of the link should display the scout's last name and first name. The items in square brackets below should be inserted into the string -- but not the square brackets. The link format should be:
<a href='sales_update.asp?token=2&bid=[bridge_id]'>[scout_last_name], [scout_first name]</a>
Update scout's record in the cookmast table with the data from pass2. The FIVE values received are to be ADDED to the existing five values in the scout's table row for the cookie sales (i.e, sales_type_1, sales_type_2, sales_type_3,... etc.). You should also add up the five values submitted and ADD this sum to the scout's sales_total. Be sure to check that the five values submitted have numeric values -- if any textbox was left empty on Pass2 ADD 0 (zero) to that column. An empty textbox also will contribute 0 (zero) to the sales_total field.
2. (50 points) Six prizes are to be awarded for the scout who sold the largest number of boxes of cookies for the five cookie types and for overall sales total. Write a single pass asp program that finds and displays the six winners. The desired output is shown below to the left:
| You MUST use a single recordset with "Select * from cookmast" and gather the all the necessary information on a single pass through the recordset. Assume this array is defined in the program:
labels(1)="Double Fudge" Hint: For loop purposes, the column values for the columns sales_type_1, sales_type_2, ... ,sales_total can also be found by referencing: rs(4), rs(5),...,rs(9) of each row. Do NOT use the SQL "MAX" function. Do NOT consider the issue of ties. |