Server-Side Web Programming with Active Server
Create this page in your child web (or move it there if you create it outside of class) in a directory named "Lab02" and name the page "default.asp". Be sure to include your name and student ID as META elements in the page. Use the ASP Template as a start.
This assignment is worth 15 points. Your page should be completed and date stamped no later than Saturday, September 16th by 11:59p.m. When you have completed the page, send an e-mail to Chris Allen indicating you are done (Subject line should be: "CSC123, Lab 2, [Your Name]") and include a URL to your page. Do not change the web page after that time, as the file timestamp will change and the lab will be considered late.
The logic for creating the Bingo numbers is provided below as a function. You should include the function and the declarations in your page (you are welcome to create your own function if you want). You will also need to create a function to determine if a number is odd or even--think about using VBScript's MOD operator or FIX function.
'Page declarations Const cSIZE = 75 'Regulation Bingo is 1 - 75 Const cCARD = 5 '5x5 Bingo Card Const cCNTR = 3 '>>Free<< Const cWIDTH = 45 'Width of Cell Dim sUsedNumbers 'List of Used Bingo Numbers
Function NextNumber() 'As Integer Dim iRET 'As Integer Dim F 'As Boolean Dim i 'As Integer Dim S 'As String F = True S = "" iRET = -1 For i = 1 To cSIZE S = trim(cstr(i)) S = String(4 - Len(S), "0") & S If InStr(sUsedNumbers, S) = 0 Then F = False Exit For End If Next While Not F iRET = Int(Rnd * cSIZE) + 1 S = trim(cstr(iRET)) S = String(4 - Len(S), "0") & S If InStr(sUsedNumbers, S) = 0 Then F = True Wend If iRET > 0 Then sUsedNumbers = sUsedNumbers & S & "." NextNumber = iRET Exit Function End Function
Valtara Digital Design http://www.valtara.com/csc123/
Copyright 1999, 2001, Valtara Digital Design, Blitzkrieg Software