Marking Period 2

Click for Instructions
Click on the date to open the details.
Click date again to close the details.
Day Date   Discussion
1 11/21/05 Monday - Math, Guest Speakers from NJIT
  1. Classroom Discussion -
    1. Ms. Verde & Math Matrices (Matrix - plural)
    2. Guest speakers, Professors Joan Kettering & Morgan Benton from NJIT
  2. Lab Assignment - None
    1. Math worksheet

2 11/22/05 Tuesday - Computer Vocabulary, VB Arrays, "vbMatrix"
  1. Classroom Discussion -
    1. Computer Vocabulary - a Daily Process
    2. Definitions from Dictionary.com
      1. Matrix (math) - Rectangular array of numeric or algebraic quantities subject to mathematical operations
      2. Matrix (computers) - Network of intersections between input and output leads in a computer, functioning as an encoder or a decoder
      3. Matrix (anatomy) - Formative cells or tissue of a fingernail, toenail, or tooth
      4. Matrix (geology) - Solid matter in which a fossil or crystal is embedded
      5. Array (verb) - Set out for display or use; dress in finery
      6. Array (nown) - Orderly, imposing arrangement; an impressively large number of persons or objects
      7. Array (math) - Rectangular arrangement of quantities in rows and columns, as in a matrix
      8. Array (computer) - An arrangement of memory elements
      9. Cypher (noun) - Cryptographic system in which units of plain text of regular length, usually letters, are arbitrarily transposed or substituted according to a predetermined code
    3. Matrix Math - Easynet.co.uk - Online Tutorial
    4. Matrix Math & Game Programming - Direct3D Programming Kick Start - Online Text
    5. Visual Basic Arrays - vbexplorer.com - Online Tutorial
      1. Array = one variable name, many values
      2. Declare an array: Dim arrayName(integerNumber) as dataType
      3. Initialize an array in a loop: arrayName(sentinelVariable) = someValue
      4. Use an array in a loop: msgbox arrayName(sentinelVariable)
    6. Two-Dimensional Arrays -
      1. Declare a two-dimensional array: Dim arrayName(intNum1, intNum2) as dataType
      2. Initialize a two-dimensional array in a loop: arrayName(intSent1,intSent2) = someValue
      3. Use a two-dimensional array in a loop: msgbox arrayName(intSent1,intSent2)
  2. Lab Assignment -
    1. Visual Basic practice program "vbMatrix" - create a demo program using two 2x2 matrices & perform the math we learned today
      1. Create a new standard exe "frmMatrix" & "vbmatrix"
      2. Add & code a command button to exit
      3. Add a picture box for output
      4. Add & code a command button to clear the output picture box
      5. In the Global section at the top, add two array variables to represent two 2x2 matrices:
        Dim matOne(1, 1) As Integer
        Dim matTwo(1, 1) As Integer
        
      6. In the Global section at the top, create other variables as needed:
        Dim intRow, intCol, intCount As Integer
        
      7. In the Form_Load(), write code to initialize both matrix arrays with known numbers:
        intCount = 1
        For intCol = 0 To 1
            For intRow = 0 To 1
                matOne(intCol, intRow) = intCount
                matTwo(intCol, intRow) = intCount + intCount
                intCount = intCount + 1
            Next intRow
        Next intCol
        
      8. Add & code a command button to show the contents of both matrix arrays:
        picOutput.Print "Matrix One    Matrix Two"
        For intCol = 0 To 1
            For intRow = 0 To 1
                picOutput.Print matOne(intCol, intRow);
            Next intRow
            picOutput.Print "        ";
            For intRow = 0 To 1
                picOutput.Print matTwo(intCol, intRow);
            Next intRow
            picOutput.Print
        Next intCol
        
      9. Add & code an add button to add the two matrix arrays & display the result:
        picOutput.Print "Addition Results:"
        For intCol = 0 To 1
            For intRow = 0 To 1
                picOutput.Print matOne(intCol, intRow) + matTwo(intCol, intRow);
            Next intRow
            picOutput.Print
        Next intCol
        
      10. Add & code an subtract button to subtrace the two matrix arrays & display the result:
        picOutput.Print "Subtraction Results:"
        For intCol = 0 To 1
            For intRow = 0 To 1
                picOutput.Print matOne(intCol, intRow) - matTwo(intCol, intRow);
            Next intRow
            picOutput.Print
        Next intCol
        
      11. Add & code a multiply button to multiply both matrix arrays by 2 & display the result:
        picOutput.Print "Scale by 2 Results:"
        picOutput.Print "Matrix One    Matrix Two"
        For intCol = 0 To 1
            For intRow = 0 To 1
                picOutput.Print 2 * matOne(intCol, intRow);
            Next intRow
            picOutput.Print "        ";
            For intRow = 0 To 1
                picOutput.Print 2 * matTwo(intCol, intRow);
            Next intRow
            picOutput.Print
        Next intCol
        

    3 11/23/05 Wednesday - Career, VB Arrays, "vbAscii"
    1. Classroom Discussion -
      1. Internet Job Search - some examples of valuable web sites
      2. A simple substitution cypher example, replacing each letter of the alphabet with another
    2. Lab Assignment -
      1. Visual Basic program "vbAscii" - create a simple program to display the ASCII number for a sentence of input text:
        1. Create a new standard exe "frmAscii" & "vbAscii"
        2. Add variables:
          1. "i" for a loop sentinel
          2. "intTextLength" to hold the numerical length of the text input
          3. "strChr" to hold the input string character to be converted to ASCII
          4. "intAsc" to hold the resulting ASCII number after conversion
        3. Add & code a command button to exit
        4. Add a large textbox for input of a sentence or paragraph to be converted to ASCII numbers
        5. Add a large label for output
        6. Add & code a command button to clear the textbox & label & set the focus back to the input testbox
        7. Add & code a command button to convert from text to ASCII numbers:
          1. Only if the input textbox is not empty
          2. Convert each character to ASCII, one character at a time
          3. Determine the length of the text input & save it:
            intTextLength = Len(txtInput.Text)
            
          4. Get one letter from the intput textbox using:
            strChr = Mid(txtInput.text, i, 1)
            
          5. Convert to ASCII using:
            intAsc = Asc(strChr)
            
          6. Add to the output label using:
            lblOutput.Caption = lblOutput.Caption & intAsc & " "
            
        8. Save & Test
        9. Add & code a command button to convert from ASCII numbers back to text:
          1. Only if the input textbox is not empty
          2. Convert a series of integer numbers between 0 & 255 separated by a blank space
          3. Find the first blank space:
            intSpace = InStr(1, strInput, " ")
            
          4. Save the first number to a temporary string variable:
            strTemp = Mid(strInput, 1, intSpace)
            
          5. If numeric and between 0 & 255 convert to an integer then convert to a character & add to the output label:
            If IsNumeric(strTemp) Then
            	lblOutput.Caption = lblOutput.Caption & Chr(CInt(strTemp))
            End If
            
          6. Remove the number just converted by getting the remainder from the right side:
            strInput = Right(strInput, intLength - intSpace)
            
          7. Repeat until no more blank spaces
          8. Remember to convert the last number
        10. Save & Test

    11/24/05 Thursday - Thanksgiving - No School
    11/25/05 Friday - Friday After Thanksgiving - No School

    4 11/28/05 Monday - Computer Vocabulary, "vbCypher"
    1. Classroom Discussion -
      1. Computer Vocabulary - a Daily Process
      2. Microsoft PowerPoint Tutorial
    2. Lab Assignment -
    3. Choose one of the Microsoft PowerPoint Tutorials and read 1/5th
    4. Visual Basic program "vbCypher" - create a simple offset replacement cypher using a single one-dimensional array:
      1. Statement of use: this program will create a simple cypher by using offset replacement to replace uppercase alphabetic characters from "A" to "Z" with other uppercase alphabetic characters. Numbers, punctuation, spaces, & other special characters will not be changed
      2. Specifications & requirements:
        1. The user will enter a phrase to be encyphered into a large textbox
        2. The user will enter a number between 1 & 26 to represent the offset amount into a second textbox
        3. The offset number may not be zero -- this would create an encyphered message that reads exactly like the original
        4. The user will click a command button to perform an encoding process
        5. The encoding process will take each alphabetic letter from the input & replace it with an alphabetic letter offset by the offset number
        6. If the offset is 1: ABC would be encyphered as BCD
          If the offset is 5: ABC would be encyphered as FGH
          If the offset is 10: ABC would be encyphered as KLM
          If the offset is 3: XYZ would be enchphered as ABC
          If the offset is 5: XYZ would be enchphered as CDE
          
        7. Use all uppercase letters
        8. Do not encypher numbers or punctuation or spaces or other special characters
        9. The output will be displayed in a large output label
        10. There will be a command button to clear the output label
        11. There will be a command button to clear the input textbox
        12. There will be a command button to exit
      3. Create the program:
        1. Create a new standard exe "frmCypher" & "vbCypher"
        2. Add & code a command button to exit
        3. Add a large textbox for input of a sentence or paragraph to be encoded & set the multiline property to true
        4. Add a textbox for input of offset number
        5. Add a large output label to display the results of the encoding
        6. Add & code a command button to clear the output label
        7. Add & code a command button to clear the input textbox & set the focus
        8. Add an array variable "strAlphabet()" with 26 positions as datatype string & initialize in Form_Load() with 26 uppercase letters of the alphabet
          For i = 1 To 26
              strAlphabet(i) = Chr(i + 64)
          Next i
          
        9. Add & code a command button to code the input text & display the result on the output label:
          Convert the offset text to a number only if it is numeric:
          If IsNumeric(txtOffset.Text) Then
          	intOffset = CInt(txtOffset.Text)
          
          Otherwise display an error message
          Perform the process only if the input textbox is not empty:
          If Not IsEmpty(txtInput.Text) Then
          
          Otherwise display another error message
          Determine the length of the input box because you must look at & convert every alphabetic character:
          intInputLength = Len(txtInput.Text)
          For i = 1 To intInputLength
          
          Get one letter & convert it to an ASCII number:
          strChr = Mid(txtInput.Text, i, 1)
          intAsc = Asc(strChr)
          
          If the letter is lowercase, ASCII 97 - 122, convert it to uppercase:
          If intAsc >= 97 And intAsc <= 122 Then intAsc = intAsc - 32
          
          If the letter is an uppercase alphabetic letter, ASCII 65 - 90, change it by the offset number:
          If intAsc >= 65 And intAsc <= 90 Then
          	intAsc = (intAsc - 64) + intOffset
          
          If the result of adding the offset number is greater than 26, start back at the beginning:
          If intAsc > 26 Then intAsc = intAsc - 26
          
          Display the offset character onto the output label:
          lblOutput.Caption = lblOutput.Caption & strAlphabet(intAsc)
          
          If the letter is not an uppercase alphabetic letter, simply display the letter onto the output label:
          lblOutput.Caption = lblOutput.Caption & strChr
          
      4. Save & Test -- How do you test???:
          You must reverse the process to check that your encyphered phrase can be decyphered:
        1. Add a large label to display the decoded phrase "lblDecode"
        2. Add a command button to decode
        3. Only if the output label is not empty
        4. Get the length of the output label caption
        5. Look at every character in the output caption in a loop
        6. Get the ASCII value of each character
        7. If the ASCII value is a letter (60 - 90) then reverse the offset
          • Reduce the ASCII value by 64 & subtract the offset
          • If less than 1, add 26
          • Add the letter from the ASCII value position in the strAlphabet array to the decode label
          otherwise simply display the character

    5 11/29/05 Tuesday - English, "vbCypher" cont'd
    1. Classroom Discussion -
      1. Ms. Gerrick will visit with more reading comprehension practice
      2. Microsoft PowerPoint Tutorial
    2. Lab Assignment -
      1. Choose one of the Microsoft PowerPoint Tutorials and read another 1/5th
      2. Modify your existing Visual Basic program "vbCypher" to decode the output label to compare with the input textbox
        1. Open
        2. If the output label is not blank
        3. Get each character in turn
        4. Convert each character to an ascii number
        5. Subtract 65 & SUBTRACT the offset number
        6. If less than 1 add 26 (wrap around)
        7. Display onto a second output label
        8. Save & Test
      3. Create a quick little Visual Basic program "vbAsciiDisplayer" to display in a listbox all of the ASCII characters from 32 to 255
        • Why start from 32? - Because ASCII characters below 32 are non-printing
        • Where do the numbers (0 - 9) start? Why? - 48, because in binary it's 0011 0000
        • Where do the uppercase letters start? Why? - 65, because in binary it's 0100 0001
        • Where do the lowercase letters start? Why? - 97, because in binary it's 0110 0001
        • Where do the normal characters end and other types of characters start? Why? - 128, because in binary it's 1000 0000

    6 11/30/05 Wednesday - Ocean County College Information Program, "vbCypher" cont'd
    1. Classroom Discussion -
      1. OCC Informational Session in Computer Science classroom - class meeting schedule:
        AM
        8:00 - 9:00 All Students - "vbCypher3" Lab All Students
        9:00 - 10:00 Select Students - OCC in Computer Science Room
        All Other Students - Job Search Lab in Computer Lab
        PM
        11:00 - 12:00 Select Students - OCC in Computer Science Room
        All Other Students - Job Search Lab in Computer Lab
        12:00 - 1:00 All Students - "vbCypher3" Lab All Students
      2. Job Search Techniques practice
      3. Microsoft PowerPoint Tutorial
    2. Lab Assignment -
      1. Choose one of the Microsoft PowerPoint Tutorials and read another 1/5th
      2. Visit your favorite online job-search web site and search for a job:
        • Computer Programmer
        • Visual Basic
        • Entry Level
        • Ocean County New Jersey
        • How many are you qualified for?
        • How many if you remove the "Entry Level"?
        • Read the first five -- what else must you know in order to become qualified?
      3. Finish any unfinished programming assignments

    7 12/01/05 Thursday - Science, "vbCypher" cont'd
    1. Classroom Discussion -
      1. Science - How the new x-box 360 works
      2. Science - How swearing works, dog-mad-it
      3. Microsoft PowerPoint Tutorial
    2. Lab Assignment -
      1. Choose one of the Microsoft PowerPoint Tutorials and read another 1/5th
      2. Copy & modify the folder containing "vbCypher" to "vbCypher2" to encode all possible characters on the keyboard:
        1. You don't need to declare the array "strAlphabet()", you may comment it out
        2. You don't need to initialize the array "strAlphabet()" in the Form_Load(), comment it out
        3. Modify the code in "cmdEncode" to work for all keyboard characters (ASCII 32 to 128):
          For i = 1 To intLen
          	strChr = Mid(txtInput.Text, i, 1) ' get one character from text to be encoded
          	intAsc = Asc(strChr) + intOffset ' convert to ASCII and add offset
          	If intAsc > 128 Then intAsc = intAsc - 96 ' check for wraparound
          	strChr = Chr(intAsc) ' convert to character
          	lblOutput.Caption = lblOutput.Caption & strChr ' add to output label
          Next i
          
        4. Modify the code in "cmdDecode" to work for all keyboard characters (ASCII 32 to 128):
          For i = 1 To intLen
          	strChr = Mid(lblOutput.Caption, i, 1) ' get one character from text to be decoded
          	intAsc = Asc(strChr) - intOffset ' convert to ASCII and subtract offset
          	If intAsc < 32 Then intAsc = intAsc + 96 ' check for wraparound
          	strChr = Chr(intAsc) ' convert to character
          	lblDec.Caption = lblDec.Caption & strChr ' add to decode label
          Next i
          
      3. Modify the "vbCypher" program in folder "vbCypher2" to use higher-level ASCII code to really confuse 'em:
        1. Modify the code in "cmdEncode":
          'intAsc = Asc(strChr) + intOffset ' convert to ASCII and add offset
          'If intAsc > 128 Then intAsc = intAsc - 96 ' check for wraparound
          intAsc = Asc(strChr) + intOff + 128 ' convert to higher ASCII and add offset
          If intAsc > 255 Then intAsc = intAsc - 128 ' check for wraparound
          
        2. Modify the code in "cmdDecode":
          'intAsc = Asc(strChr) - intOffset ' convert to ASCII and subtract offset
          'If intAsc < 32 Then intAsc = intAsc + 96 ' check for wraparound
          intAsc = Asc(strChr) - intOff - 128 ' convert to normal ASCII and subtract offset
          If intAsc < 32 Then intAsc = intAsc + 96 ' check for wraparound
          
      4. See if you can figure out a way to let the user choose which ASCII set to use (32-128 or 128-255)
      5. Finish any unfinished programming assignments

    8 12/02/05 Friday - SkillsUSA, Quiz VB 4, Quiz "vbL33t", Lab "vbCoinToss"
    1. Classroom Discussion -
      1. SkillsUSA - PDP Blue Book - Level 1.1 - Self-Assessment
      2. Microsoft PowerPoint Tutorial
    2. Lab Assignment -
      1. Choose one of the Microsoft PowerPoint Tutorials and read another 1/5th
      2. Our text at samsPublishing.com is available for you during the quiz
      3. QUIZ - Take the Visual Basic Quiz 5. Click the link and follow the instructions. PRINT AND HAND IN. You only get one chance - this is not "try until you score 100". Open notes, open internet, open VB IDE (you may try out your answer in a program before you submit it), you may ask me for clarification, you may NOT ask me for the answers, likewise you may NOT ask another student for help
      4. QUIZ - Visual Basic Quiz program "vbLeet":
        1. Design, write, create, test, run, and save a Visual Basic program to translate normal characters to "leet" - get ideas from this wikipedia page
        2. Requirements:
          1. Get the phrase to be translated from the user - textbox object
          2. Display the results to the user - use a textbox object to allow the user to copy the result
          3. You must translate at a minimum 10 characters - for example: c = © or r = ®
          4. Be sure to following the grading criteria listed below
          5. Save & Test
        3. Copy the project and form and any images to your "H:/vb/vbLeet" folder for me to assess
        4. Grading Criteria:
          1. Must give correct answer and all output specified in requirements above (70 pts)
          2. Must translate at least 10 characters - I will check using a phrase that uses all 26 uppercase and 26 lowercase letters (5 pts)
          3. Must look good (5 pts)
          4. Must have author name, program name, and date written as comments (5 pts)
          5. Must use Option Explicit (5 pts)
          6. Must use correct object and variable naming conventions (txtSomething and intSomething) (5 pts)
          7. Must have at least one programmer-written function or sub-routine (5 pts)
      5. Finish any unfinished programming assignments

    9 12/05/05 Monday - Storyboard, VB Menus, "vbATM"
    1. Classroom Discussion -
      1. Storyboard before PowerPoint:
      2. Chapter 17 from samsPublishing.com - The Menu Editor
      3. Chapter 17 from samsPublishing.com - Add an Application Menu Bar
      4. Chapter 17 from samsPublishing.com - Naming Menu Options
      5. Chapter 17 from samsPublishing.com - Adding Pull-Down Menu Options
      6. Chapter 17 from samsPublishing.com - Menu Extras
      7. Chapter 17 from samsPublishing.com - Connecting Menus to Event Procedures
    2. Lab Assignment -
      1. Create a storyboard to use to create a PowerPoint presentation about the Computer Science class:
        • Graded Assignment
        • Hand-Written
        • Single-Page
        • Name-on-it
        • Hand-in
      2. Create a Visual Basic program "vbATM" to practice with Visual Basic menus:
        1. Create a new VB executable "frmATM" and "vbATM" in a folder "vbATM"
        2. Main Steps:
          1. ATM can 1)Check Balance, 2)Deposit Money, 3)Withdraw Money
          2. Create a text file to hold the current balance
          3. Declare Variables
          4. Initialize Variables
          5. Open the File and Get Balance
          6. Display the Balance
          7. Deposit Money (add to balance and display)
          8. Withdraw Money (subtract from balance and display)
          9. Save File and Continue Working
          10. Save File and Exit
        3. Create a file "bankAccount.txt" with "0" (zero) as the only data in the folder "vbATM"
        4. Open the Menu Editor - [ctrl+E] or Tools | MenuEditor
        5. You must be in View | Object mode in order to be able to open the Menu Editor
        6. Build the menu:
          • Add caption property "&File" and name property "mnuFile" - menu bar menu items don't get any code
          • Add indented caption "&Open" and name "mnuFileOpen" - pull down menu options will get coded
          • Add indented caption "-" and name "mnuFileSep1" - a single hyphen/dash draws a separater bar
          • Add indented caption "&Save" and name "mnuFileSave"
          • Add indented caption "-" and name "mnuFileSep2"
          • Add indented caption "e&Xit" and name "mnuFileExit"
          • Add caption "&ATM" and name "mnuATM"
          • Add indented caption "&Balance" and name "mnuATMBalance"
          • Add indented caption "-" and name "mnuATMSep1"
          • Add indented caption "&Deposit" and name "mnuATMDeposit"
          • Add indented caption "&Withdrawal" and name "mnuATMWithdrawal"
          • Add caption "&Help" and name "mnuHelp"
          • Add indented caption "&About" and name "mnuHelpAbout"
          • Close the MenuEditor by clicking [Okay]
        7. Add a textbox object "txtAmount" to the form and label it
        8. Let the Visual Basic Integrated Design Environment (VB-IDE) create the subroutine for you: click the form menu option
        9. Declare your variables:
          Option Explicit
          Dim strBalance As String ' existing bank balance
          Dim sngBalance As Single ' existing bank balance
          Dim sngAmount As Single ' amount to add or withdraw
          Dim blnFileOpen As Boolean ' flag variable to show whether file was open
          Dim strFileName As String ' name of file
          
        10. Write the code for the "Form_Load()" subroutine:
          blnFileOpen = False ' initialize to file not open
          strFileName = "bankAccount.txt" ' name of file
          sngBalance = 0 ' initialize to 0
          sngAmount = 0 ' initialize to 0
          
        11. Write the code for the "mnuFileOpen" subroutine:
          If LenB(Dir$(strFileName)) Then ' file has depth
              Open strFileName For Input As #1 ' open the file to read
              Line Input #1, strBalance ' get text balance from text file
              sngBalance = CSng(strBalance) ' change to number
              blnFileOpen = True ' file was opened
              Close ' close any open files
          Else
              MsgBox "File " & strFileName & " not found" ' error message
          End If
          
        12. Write the code for the "mnuATMBalance_Click()" subroutine:
          If blnFileOpen Then
              MsgBox "Current Balance: " & sngBalance ' display current balance
          Else
              MsgBox "File " & strFileName & " is not open" ' file was never opened
          End If
          
        13. Write the code for the "mnuATMDeposit_Click()" subroutine:
          If blnFileOpen Then ' if the file was opened
              If IsNumeric(txtAmount.Text) Then ' check for numeric
                  sngAmount = CSng(txtAmount.Text) ' change text to number
                  sngBalance = sngBalance + sngAmount ' add to current balance
                  txtAmount.Text = "" ' clear amount so user doesn't have to
                  txtAmount.SetFocus ' set focus so user doesn't have to
              Else
                  MsgBox "Deposit Amount Must be a Number" ' error message
              End If
          Else
              MsgBox "File " & strFileName & " was not opened" ' file was not opened
          End If
          
        14. Write the code for the "mnuATMWithdrawal_Click()" subroutine:
          If blnFileOpen Then ' if the file was opened
              If IsNumeric(txtAmount.Text) Then ' check for numeric
                  sngAmount = CSng(txtAmount.Text) ' change text to number
                  If sngAmount < sngBalance Then ' check for available balance
                      sngBalance = sngBalance - sngAmount ' withdraw from current balance
                      txtAmount.Text = "" ' clear amount so user doesn't have to
                      txtAmount.SetFocus ' set focus so user doesn't have to
                  Else
                      MsgBox "Requested Withdrawal of " & sngAmount & " is greater than available balance of " & sngBalance
                  End If
              Else
                  MsgBox "Withdrawal Amount Must be a Number" ' error message
              End If
          Else
              MsgBox "File " & strFileName & " was not opened" ' file was not opened
          End If
          
        15. Write the code for the "mnuFileSave_Click()" subroutine:
          If blnFileOpen Then ' if the file was opened
              Open strFileName For Output As #1 ' open the file to write
              Write #1, sngBalance ' write the balance
              Close ' close any open files
          Else
              MsgBox "File " & strFileName & " was not opened" ' file was not opened
          End If
          
        16. Write the code for the "mnuFileExit_Click()" subroutine:
          If blnFileOpen Then ' if the file was open
              Open strFileName For Output As #1 ' open the file to write
              Write #1, sngBalance ' write the balance
              Close ' close any open files
          End If
          End ' end program run
          
        17. Write the code for the "mnuHelpAbout_Click()" subroutine:
          MsgBox "ATM Simulator" & vbCrLf & "Michael R. Clarke" & vbCrLf & "12/04/05"
          
        18. Save & Test
      3. Modify the "vbCypher" Visual Basic program to be able to decode a message sent to you

    10 12/06/05 Tuesday - Snow
    Delayed opening - No AM class
    BLACK ICE ON ROADS - Drive cautiously

    Computer Vocabulary, Random Number Review, "vbCypher3"
    1. Classroom Discussion -
      1. Computer Vocabulary - a Daily Process
    2. Lab Assignment -
      1. Complete any incomplete assignments

    11 12/07/05 Wednesday - Career Job Search, "vbCypher3"
    1. Classroom Discussion -
      1. New Grading Criteria
      2. Career - Company Web Sites
      3. PseudoRandom Number Review:
        • PseudoRandom - Of, relating to, or being random numbers generated by a definite, nonrandom computational process
        • intRand = Int(Rnd() * (highNum - lowNum + 1) + lowNum)
        • Rnd() is a pre-defined, built-in, Visual Basic routine that returns a real number between 0.0 and 9.9
        • highNum is the highest of a set of numbers you wish to produce
        • lowNum is the lowest of a set of numbers you wish to produce
        • Remember to add 1
      4. VBExplorer.com Random Numbers for Encryption tutorial:
        • according to vbexplorer random number page
        • use randomize intSeed where intSeed is a number input in a textbox
        • to create a repeatable random number list with a different seed value
    2. Lab Assignment -
      1. Modify the "vbCypher" Visual Basic program to use random numbers to produce a cypher more difficult to decode and use it to encode/decode messages:
        1. Create a new Visual Basic program "frmCypher" and "vbCypher" saved in folder "vbCypher3"
        2. Add a large textbox for input of a normal or encoded phrase
        3. Add a large textbox for output of an encoded or decoded phrase
        4. Add menu options for:
          NameCaption
          mnuFile&File
          mnuFileGetSeedNumber&GetSeedNumber
          mnuFileExite&Xit
          mnuCypher&Cypher
          mnuCypherEncode&Encode
          mnuCypherDecode&Decode
          mnuCypherMove&Move
          mnuSecurity&Security
          mnuSecurityLowest&Lowest
          mnuSecurityNormal&Normal
          Check the "Checked" property for mnuSecurityNormal
          mnuSecurityHighest&Highest
        5. Write the code for the variables:
          Option Explicit
          Dim i As Integer
          Dim strSeed As String
          Dim intSeed As Integer
          Dim intRand As Integer
          Dim intSecurity As Integer
          Dim intLen As Integer
          Dim intAsc As Integer
          Dim strChr As String
          
        6. Write the code for the "Form_Load()" subroutine
          intSeed = 0
          
        7. The next three work like a three-way radio-button where only one can be checked, when the user checks one the other two are unchecked
        8. Write the code for the "mnuSecurityLowest_Click()" subroutine
          mnuSecurityLowest.Checked = True
          mnuSecurityNormal.Checked = False
          mnuSecurityHighest.Checked = False
          
        9. Write the code for the "mnuSecurityNormal_Click()" subroutine
          mnuSecurityLowest.Checked = False
          mnuSecurityNormal.Checked = True
          mnuSecurityHighest.Checked = False
          
        10. Write the code for the "mnuSecurityHighest_Click()" subroutine
          mnuSecurityLowest.Checked = False
          mnuSecurityNormal.Checked = False
          mnuSecurityHighest.Checked = True
          End Sub
          
        11. Write the code for the "mnuFileExit_Click()" subroutine
          Unload Me
          
        12. Write the code for the "mnuFileGetSeedNumber_Click()" subroutine
          strSeed = InputBox("Enter Cypher Seed Number", , "5")
          If IsNumeric(strSeed) Then
              intSeed = CInt(strSeed)
          Else
              MsgBox "Cypher Seed Must be a Number"
          End If
          
        13. Write the code for the "mnuCypherEncode_Click()" subroutine
          txtOutput.Text = "" ' clear the output box
          Rnd -1 ' reset random number generator
          Randomize (intSeed) ' reinitialize random number generator
          If txtInput.Text <> "" Then
              intLen = Len(txtInput.Text)
              For i = 1 To intLen
                  strChr = Mid(txtInput.Text, i, 1)
                  intAsc = Asc(strChr)
                  If intAsc <> 32 Then ' not encode spaces
                      intRand = Int(Rnd() * 25) ' random number between 0 and 25
                      If mnuSecurityLowest.Checked Then intRand = 0
                      intAsc = intAsc + intRand
                      If intAsc > 127 Then intAsc = intAsc - 96
                      If mnuSecurityHighest.Checked Then intAsc = intAsc + 128
                      strChr = Chr(intAsc)
                  End If
                  txtOutput.Text = txtOutput.Text & strChr
              Next i
          Else
              MsgBox "Please Enter Phrase to be Encoded"
          End If
          
        14. Write the code for the "mnuCypherDecode_Click()" subroutine
          txtOutput.Text = "" ' clear the output box
          Rnd -1 ' reset random number generator
          Randomize (intSeed) ' reinitialize random number generator
          If txtInput.Text <> "" Then
              intLen = Len(txtInput.Text)
              For i = 1 To intLen
                  strChr = Mid(txtInput.Text, i, 1)
                  intAsc = Asc(strChr)
                  If intAsc <> 32 Then ' not decode spaces
                      intRand = Int(Rnd() * 25) ' random number between 0 and 25
                      If mnuSecurityLowest.Checked Then intRand = 0
                      intAsc = intAsc - intRand
                      If intAsc < 32 Then intAsc = intAsc + 96
                      If mnuSecurityHighest.Checked Then intAsc = intAsc - 128
                      strChr = Chr(intAsc)
                  End If
                  txtOutput.Text = txtOutput.Text & strChr
              Next i
          Else
              MsgBox "Please Enter Phrase to be Encoded"
          End If
          
        15. The next line is for testing: we have to make sure we can decode what we've just encoded using the same seed number
        16. Write the code for the "mnuCypherMove_Click()" subroutine
          txtInput.Text = txtOutput.Text
          txtOutput.Text = ""
          
        17. Save & Test

    12 12/08/05 Thursday - Science: PlayStation3, "vbBandit"
    1. Classroom Discussion -
      1. New Grading Criteria
      2. Science - PlayStation 3 from HowStuffWorks.com
      3. Science - One-Armed Bandit from HowStuffWorks.com
    2. Lab Assignment -
      1. Science online discussion
      2. Practice with Visual Basic menus
      3. Make a Visual Basic game program to simulate a One-Armed Bandit or Slot machine:
          Overview:
        1. Our machine will have a set of eight images
        2. Randomly display onto one of three image objects
        3. Roll command button or menu option to start displaying the images
        4. 1-3 stop command button(s) or menu option to stop displaying the images
        5. Exit command button or menu option to end the program
        6. The images will display in sequence until the player decides to stop them
        7. If three images match, award 10 points
        8. If two of the three images match, award 3 points
        9. Keep track of and display the score
          Steps:
        1. Copy the images from "Q:/programming/vbExamples/vbBanditImages" (or download from the internet)
        2. Paste the images into your folder
        3. Create a new Visual Basic executable "frmBandit" and "vbBandit" in a folder "css##vbBandit"
        4. Create a string array of 8 images and load them in the form_load
        5. Add three image objects, set the stretch property to True
        6. Add three timers, one for each image object
        7. Code to display the images one at a time
        8. Add a command button for Roll
        9. Code to enable the stop button(s), disable the roll button, and start the three image timmers
        10. Add a command button (or three) for Stop
        11. Code to enable the run button, disable the stop button(s), and test a winner
        12. Add a subroutine to test a winner
        13. Code to check that all three images have stopped rolling
        14. Code to compare image1 with image2 and image2 with image3 and add points to the score
        15. Code to display the score
        16. Save & Test

    13 12/09/05 Friday - SkillsUSA, "vbCoinToss"
    1. Classroom Discussion -
      1. New Grading Criteria
      2. SkillsUSA PDP Blue Book - Level 1.2 - Self-Motivation Techniques
    2. Lab Assignment -
      1. Complete the SkillsUSA PDP Blue Book worksheet
      2. LAB - Visual Basic program "vbCoinToss" to simulate flipping a coin:
        1. Create a new Visual Basic executable "frmCoinToss" and "vbCoinToss" in a folder named "vbCoinToss"
        2. Simulate a coin toss by getting a random number between 0 and 1 - 0 for tails and 1 for heads
        3. Allow the user to specify in a textbox how many times to toss the coin
        4. Perform all the coin tosses in one command button click event (don't click 1,000 times to flip 1,000 times)
        5. Keep a count of how many heads and how many tails are generated
        6. Display how many heads and how many tails
        7. Keep track of how many flips, how many heads, how many tails in a listbox that I can scroll through - for example:
        8. Remember "Randomize" in the Form_Load()"
        9. Remember the random number generator: "intRand = Int((intHigh - intLow + 1) * Rnd()) + intLow"
        10. Loop from 1 to intHowMany (or something similar)
        11. Save & Test
        12. Copy the project and form and any images to your "H:/vb/vbCoinToss" folder for me to assess
      3. Complete any incomplete labs

    14 12/12/05 Monday - Storyboard, "vbNJITRaceTrack"
    1. Classroom Discussion -
      1. New Grading Criteria
      2. Storyboard before PowerPoint:
      3. Math - Area of a Rectangle
      4. Visual Basic code to READ FROM an input text file:
        If LenB(Dir$(strFileIn)) Then ' file has depth
        Open strFileIn For Input As #1 ' open the file to read
        Input #1, intStopValue ' get sentinel data
        Input #1, intOne, intTwo, intThree ' get data from input file
        
      5. Visual Basic code to WRITE TO an output text file:
        Open strFileOut For Append As #2 ' open the file to write
        Write #2, intOne, intTwo, intThree, intSum ' write the data
        
      6. 2005 NJIT High School Programming Contest Problems page
    2. Lab Assignment -
      1. The computer science class is part of the school's "Building Objective" this year. We are required to acquire basic skills in obtaining information, solving problems, thinking critically, and communicating effectively through vocational education. The objective is to, by June 2006, demonstrate an improvement in technology skills by developing a Microsoft PowerPoint presentation on a trade related skill project. I will create a rubric that measures completeness. You will create a Microsoft PowerPoint presentation as an advertisement for this class.
        • Project: Develop a computer presentation covering what the computer science class is all about, what we study and how, what we create, where students go after completing the course.
        • Step 1: Create a Storyboard using pencil/pen and paper. Use the web sites above for reference. Put your name on it and hand it in
      2. Use Visual Basic to solve Problem 0 on the 2005 NJIT High School Programming Contest Problems page:
        1. Create a Visual Basic program "frmNJITRaceTrack" and "vbNJITRaceTrack" in a folder "css##vbNJITRaceTrack"
        2. Solve Problem 0

    15 12/13/05 Tuesday - Computer Vocabulary, Visual Basic Print, "vbNJITSuperb"
    1. Classroom Discussion -
      1. New Grading Criteria
      2. Computer Vocabulary - a Daily Process
      3. Visual Basic Printing:
        1. Chapter 16 from samsPublishing.com - Printing
        2. Chapter 16 from samsPublishing.com - Introducing Printing
        3. Chapter 16 from samsPublishing.com - Preparing the User
        4. Chapter 16 from samsPublishing.com - The Printer Object
        5. Chapter 16 from samsPublishing.com - The Print Method
        6. Chapter 16 from samsPublishing.com - Starting to Print
      4. 2005 NJIT High School Programming Contest Problems page
    2. Lab Assignment -
      1. Use Visual Basic to solve Problem 0 on the 2005 NJIT High School Programming Contest Problems page:
        1. Create a Visual Basic program "frmNJITSuperb" and "vbNJITSuperb" in a folder "css##vbNJITSuperb"
        2. Solve Problem 1
        3. Print the solution using Visual Basic print method

    16 12/14/05 Wednesday - Career, Visual Basic Print cont'd, "vbNJITCalendar"
    1. Classroom Discussion -
      1. New Grading Criteria
      2. Career - Reading the Classified Advertisements
      3. 2005 NJIT High School Programming Contest Problems page
    2. Lab Assignment -
      1. Use Visual Basic to solve Problem 0 on the 2005 NJIT High School Programming Contest Problems page:
        1. Create a Visual Basic program "frmNJITCalendar" and "vbNJITCalendar" in a folder "css##vbNJITCalendar"
        2. Solve Problem 2
        3. Print the solution using Visual Basic print method

    17 12/15/05 Thursday - Science, Visual Basic Print cont'd, "vbNJITSetIntersection"
    1. Classroom Discussion -
      1. New Grading Criteria
      2. Science - How Narnia Works from HowStuffWorks.com
      3. 2005 NJIT High School Programming Contest Problems page
    2. Lab Assignment -
      1. Use Visual Basic to solve Problem 0 on the 2005 NJIT High School Programming Contest Problems page:
        1. Create a Visual Basic program "frmNJITSetIntersection" and "vbNJITSetIntersection" in a folder "css##vbNJITSetIntersection"
        2. Solve Problem 3
        3. Print the solution using Visual Basic print method

    18 12/16/05 Friday - SkillsUSA, Visual Basic Print cont'd, complete "vbNJITSetIntersection"
    1. Classroom Discussion -
      1. New Grading Criteria
      2. SkillsUSA home page - Contest Updates - you will pick one:
      3. 2005 NJIT High School Programming Contest Problems page
    2. Lab Assignment -
      1. Use Visual Basic to solve Problem 0 on the 2005 NJIT High School Programming Contest Problems page:
        1. Modify the "vbNJITSetIntersection" from yesterday:
          • Well -- I did it -- I completed the "vbNJITSetIntersection" Visual Basic program
          • Wow! What a |3=4|2 of a |*|2()6|24|v| !! This was more difficult even than TicTacToe!!!
          • You may start at the same point as we left off yesterday -- copy the folder "Q:/Programming/Examples/AM/vbNJITSetIntersection/"
          • Create a subroutine "getNumbers()" where we'll read through "strLine" and isolate the numbers based in "intSpace" and "Call checkNumbers()"
          • Create a subroutine "checkNumbers()" where we'll insert numbers into the variables "intLine()" based on rules for sorting and no duplicates
          • Create a subroutine "getIntersection()" where we'll check all possible numbers for equality in all three sets
          • Call "getNumbers()" from inside the main loop of the "Form_Load()"
          • Before ending the main loop, call "getIntersection()" if "intRow Mod 3 = 0"
          • Comment out all testing "Msgbox"
          • Save & Test & View the "output.txt" -- your file should match mine:
            16,23,45,89,-1,-1,-1,-1,-1,-1,
            12,23,45,55,89,100,-1,-1,-1,-1,
            23,45,66,77,-1,-1,-1,-1,-1,-1,
            "Writing Intersection..."
            23,45,
            66,77,88,99,-1,-1,-1,-1,-1,-1,
            66,77,88,99,-1,-1,-1,-1,-1,-1,
            66,77,99,-1,-1,-1,-1,-1,-1,-1,
            "Writing Intersection..."
            66,77,99,
            
        2. Solve Problem 4
        3. Print the solution using Visual Basic print method

    19 12/19/05 Spirit Week - Hat Monday - Storyboard, "vbPacMan" - the gameboard
    1. Classroom Discussion -
      1. New Grading Criteria
      2. Storyboard, second draft:
        • Review your storyboard, first draft
        • Create an improved storyboard, second draft
      3. The History of Pac Man
      4. Using a text file as a draft for different gameboard designs:
        • Using different board names: "board1.txt"
        • Input into an array variable
        • Draw the board from the array variable
    2. Lab Assignment -
      1. Create a Visual Basic program to simulate the historic arcade game of "Pac Man". One lone yellow dot, just trying to get by, increasing his score by eating all the other little dots, chased by red ghosts, able to chase and eat the blue ghosts after eating a "power pill":
        1. "frmPacMan.frm" and "vbPacMan.vbp" in a folder "vbPacMan"
        2. You may use my images or search for your own: Ghost1.gif Ghost2.gif GhostScared1.gif GhostScared1.gif PacMan1.gif PacMan2up.gif PacMan3up.gif PacMan4up.gif PacMan2down.gif PacMan3down.gif PacMan4down.gif PacMan2left.gif PacMan3left.gif PacMan4left.gif PacMan2right.gif PacMan3right.gif PacMan4right.gif
      2. Specifications:
        1. In order to be able to test movement and keep score, we'll use a base setting of 500 x 500 twips for all images
        2. Create a gameboard on which the man and ghosts will move
        3. The board will be a square shape made up of 11 x 11 smaller squares
        4. The smaller squares will be 500 x 500 twips
        5. This means the gameboard will be 5500 x 5500 twips so your form must be larger
        6. Some of the smaller squares will be solid, as walls, through which no moving object may move
        7. When the smaller square is not solid, a small yellow "food" dot will appear
        8. Four (4) of these small "food" dots will be "power pills", signified by the color purple
        9. The user will be able to choose from a minimum of four (4) different game boards which you will design
        10. The user will pick a game board by pressing a number 1 - 4
        11. The program will load a text file, i.e. "input1.txt", and then draw the smaller squares on the larger game board based on instructions containted in the text file
        12. There are two types of moving objects: one (1) man, a yellow dot, and four (4) red or blue ghosts
        13. The man will initially appear on the bottom row in the center square
        14. The user will control the man's movement using the four (4) cursor keys, up, down, left, right
        15. The man must run away from the red ghosts
        16. The man must attempt to "eat" all of the small yellow "food" dots, worth 1 point each
        17. If the man successfully "eats" all the "food", the man wins, and the user will be prompted "play again?"
        18. The red ghosts will "eat" the man if their positions on the game board ever overlap
        19. The man has three (3) lives, that is, if the man is "eaten" three times the ghosts win
        20. There will be four (4) red ghosts and they will initially appear at the top row center square
        21. The four ghosts will move randomly
        22. Whenever the man eats a "power pill", the red ghosts will turn blue for an amount of time, probably 15 seconds
        23. The man may "eat" blue ghosts and gain 10 points if their positions on the game board ever overlap
        24. A blue ghost, once "eaten", will appear again at the top center as a red ghost
        25. No moving object will move beyond the boundaries of the game board
        26. No moving object will move through solid smaller squares
        27. Ghosts may overlap other ghosts with no penalty
      3. Game Board Pseudocode:
        1. Create the form
        2. Add a Shape object "shpBoard" background color black, border color black, border style opaque, border width 3, top, left, height=5500, width=5500
        3. In the "Form_Load()" reset position properties of top, left, height, width
        4. Save & Test
        5. Add variables for intRow, intCol, intPlace
        6. Add a Shape object "shpSquare" background color white, border color white, border style opaque, border width 3, top, left, height=500, width=500
        7. Copy "shpSquare" and paste onto the form CREATE A CONTROL ARRAY
        8. Paste a total of 121 of these smaller black squares (0 - 120)
        9. In the "Form_Load()" add code to place all 121 "shpSquare" objects to their proper position on the board and reset their height and width to 500
        10. Conjure math for positioning each small square (row and col):
          • There are 121 small squares (0 - 120)
          • intRow can go from 0 to 10
          • intCol can go from 0 to 10
          • How can you make 0 to 120 from 0 to 10 and 0 to 10???
        11. Save & Test
        12. Add a Shape object "shpFood" background color red, border color red, border style opaque, shape circle, border width 3, top, left, height=100, width=100
        13. Copy "shpFood" and pase onto the form CREATE A CONTROL ARRAY
        14. Paste a total of 121 of these small red dots (0 - 120)
        15. Change the color to blue for the four corner dots (#0, 10, 110, 120)
        16. In the "Form_Load()" add code to place all 121 "shpFood" objects to their proper position on the board and reset their height and width to 100 (use the existing loops)
        17. Conjure math for positioning these objects onto the game board
        18. Save & Test
        19. Add code in the "Form_KeyDown()" to test for the escape key and then end the program
        20. Save & Test
        21. Add code in the "Form_KeyDown()" to test for the numbers between 1 and 4 to load a game board design
        22. Create the four text files with the game board designs:
          • Each text file will have 11 rows of 11 "Xs" and "Os", separated by a comma (,)
          • The "X" signifying solid wall and the "O" signifying open
          • Make interesting patterns
          • Remember - the power pills will be in the four corners of the game board, so don't put a wall ("X") in the corners
          • Also, it's a bad idea to have dead ends or piazza where there are no walls at all
        23. Create a subroutine "drawBoard(intFileNum as Integer)" to draw the board from the text file based on the key the user presses
          • Open the correct input file - you can concatenate the "intFileNum" to the "input.txt"
          • For each small square (row and col)
            1. Read each character from the input file
            2. Calculate which square it represents
            3. If "X", show the square wall (visible=true) and hide the food (vislbie=false)
            4. If "O", hide the square wall (visible=false) and show the food (vislbie=true)
          • Add a new global variable "intBoard" to hold which board was chosen and set it to -1 in the "Form_Load()"
          • Assign the board number to the variable "intBoard = intFileNum"
        24. Call the subroutine "drawBoard()" from inside the "Form_KeyDown()" and remember to pass the correct file number
        25. Save & Test
        26. You may, it you desire, create up to ten (10) different game board designs (Why only 10?)

    20 12/20/05 Spirit Week - Dress like Someone Famous Tuesay - Computer Vocabulary, "vbPacMan" - the Man
    1. Classroom Discussion -
      1. New Grading Criteria
      2. Computer Vocabulary - A Daily Process
      3. Controlling a moving object in Visual Basic:
        • Use a Timer Object, when the time interval expires, the moving object moves
        • Remember which direction is being moved
        • Change the top or left property to move a certain distance
        • Check and stop at the edge of the game board BEFORE crossing the edge -- when the NEXT position would be outside the edge of the game board
        • Check and stop when encounter any non-moving object like a wall -- when the object in the NEXT position is visible=true
        • The user controls the object with the cursor keys: vbKeyUp, vbKeyDown, vbKeyLeft, vbKeyRight
        • Use a Select Case
    2. Lab Assignment -
      1. Modify the Visual Basic program "vbPacMan" to move the man and let the user control the moving the man:
          The Man Pseudocode:
        1. Create an Image Object "imgMan" with picture property "PacMan1.gif" and stretch property "True"
        2. Place the man on the game board bottom center square in the "Form_Load()" event:
          • Top = top of board plus height of 10 small squares
          • Left = left of board plus width of 5 small squares
          • Height and Width = 500
        3. Create a Timer Object "tmrMan" to control the man:
          • Enabled = False
          • Interval = 250
        4. Add variables:
          • intManDir to hole the current man direction, 0 = up, 1 = down, 2 = left, and 3 = right
          • intManPos to hold on which small square the man currently is
          • intManNum to hold the number representing the man mouth size (2 = small, 3 = normal, 4 = large)
        5. Add a case statement to the "Form_KeyPress()" to evaluate the keystroke "G" for GO:
          • Only if intBoard > -1
          • Set intManDir = 3 (right)
          • Set intManPos = 115 (bottom center)
          • Set the man timer enabled to True
        6. Code "tmrMan":
          • Use "Select Case intManDir" to move the man:
            • "Case 0:"
              if the man is not yet at the top of the game board then
              if the next small square is NOT visible then
              decrease the top of the man by the height of one small square
              subtract 11 from "intManPos" change the man picture to the correct intManNum up
            • "Case 1:"
              if the man is not yet at the bottom of the game board then
              if the next small square is NOT visible then
              increase the top of the man by the height of one small square
              add 11 to "intManPos"
            • change the man picture to the correct intManNum down
            • "Case 2:"
              if the man is not yet at the left side of the game board then
              if the next small square is NOT visible then
              decrease the left of the man by the width of one small square
              subtract 1 from "intManPos"
            • change the man picture to the correct intManNum left
            • "Case 3:"
              if the man is not yet at the right side of the game board then
              if the next small square is NOT visible then
              increase the left of the man by the width of one small square
              add 1 to "intManPos"
            • change the man picture to the correct intManNum right
          • Copy all the "3" pictures and paste them as "1" pictures -- this will make the man open and close his mouth more evenly
          • Use "Select Case intManNum" to change the mouth number:
            • "Case 1: intManNum = 2"
            • "Case 2: intManNum = 3"
            • "Case 3: intManNum = 4"
            • "Case 4: intManNum = 1"
          • Gimick -- How can you make the man's mouth move even when the man is not moving?
          • Save & Test

    21 12/21/05 Spirit Week - Hawaiian Shirt Wednesay - Career, "vbPacMan" - the ghosts
    1. Classroom Discussion -
      1. New Grading Criteria
      2. Reading a newspaper classified advertisement section
      3. Letting the program control a moving object in Visual Basic:
        • Use a Timer Object, when the time interval expires, the moving object moves
        • Remember which direction is being moved
        • Change the top or left property to move a certain distance
        • Check and stop at the edge of the game board BEFORE crossing the edge -- when the NEXT position would be outside the edge of the game board
        • Check and stop when encounter any non-moving object like a wall -- when the object in the NEXT position is visible=true
        • The program controls the object with a random number: up=0, down=1, left=2, right=3
        • The direction to be moved is determined just before the movement occurs
        • The random number to be chosen includes any unencumbered direction (no walls) -- obviously the object cannot move through an existing object
        • Just as obviously, the object may or may NOT choose to go straight or turn left or right
        • The object will not randomly turn and go backwards
        • Use a Select Case
    2. Lab Assignment -
      1. Modify the Visual Basic program "vbPacMan" to move the ghosts and randomly change direction:
          Pseudocode:
        1. Add an Image Object "imgGhost" stretch=True, height=500, width=500, picture=ghost1.gif
        2. Copy, paste, CREATE A CONTROL ARRAY, for a total of four (4) ghosts numbered 0 to 3
        3. Add variables to the global:
          • "intGhostPos(3)" to keep track of ghost position
          • "intGhostDir(3)" to keep track of ghost direction
          • "intGhost" to control which ghost is being controlled
          • "intRand" to hold a random number
          • "intGhostMove" to hold a number that will determine which and how many ways the ghost can move
        4. Add a variable "intRand" to hold a random number
        5. In the Form_Load() event, add the 4 ghosts to the form at the top center square
        6. In the Form_Load() event, add "Randomize"
        7. Add a Timer Object "tmrGhost" enabled=False, interval=333
        8. When you start the game ([G] or [enter]):
          • Enable "tmrGhost"
          • Set the 4 "intGhostPos()" to 5 (top center square)
          • Set the 4 "intGhostDir()" to 0 (moving up)
        9. Add code to move all 4 ghosts in "tmrGhost_Timer()":
          1. Use "For intGhost = 0 To 3" to get all 4 ghosts
          2. Set "intGhostMove" to 0
          3. Use 4 "If" statements to see if the ghost can move:
            • if the ghost can move up and ghost direction is not down, add 1 to "intGhostMove"
            • if the ghost can move down and ghost direction is not up, add 2 to "intGhostMove"
            • if the ghost can move left and ghost direction is not right, add 4 to "intGhostMove"
            • if the ghost can move right and ghost direction is not left, add 8 to "intGhostMove"
          4. "intGhostMove" is now a number between 0 and 15 that we can use to let the computer choose where the ghost will move
          5. For each of the possible move choices, generate a random number to determine which way the computer moves
          6. Use "Select Case intGhostOkay" to move a ghost:
            • "Case 0:"
              the ghost can't move at all
            • "Case 1:"
              the ghost can only move up
            • "Case 2:"
              the ghost can only move down
            • "Case 3:"
              the ghost can move up or down
            • "Case 4:"
              the ghost can only move left
            • "Case 5:"
              the ghost can move up or left
            • "Case 6:"
              the ghost can move down or left
            • "Case 7:"
              the ghost can move up or down or left
            • "Case 8:"
              the ghost can only move right
            • "Case 9:"
              the ghost can move up or right
            • "Case 10:"
              the ghost can move down or right
            • "Case 11:"
              the ghost can move up or down or right
            • "Case 12:"
              the ghost can move left or right
            • "Case 13:"
              the ghost can move up or left or right
            • "Case 14:"
              the ghost can move down or left or right
            • "Case 15:"
              the ghost can move up or down or left or right
          7. Calculate the random number for the ghost direction
          8. Move the ghost the proper direction
          9. Change the ghost picture to the other ghost picture (so the eyes move)
        10. Save & Test

    22 12/22/05 Spirit Week - Crazy Sock Thursay - Science, "vbPacMan" - keeping score
    1. Classroom Discussion -
      1. New Grading Criteria
      2. Science - Google Earth from www.HowStuffWorks.com
      3. Letting the program keep score in Visual Basic:
        • Keep track of the current score
        • When a score event occurs, add to or subtract from the existing score
        • Score events in Pac Man include: eating a visible food, eating a blue ghost, being eaten by a red ghost
    2. Lab Assignment -
      1. Modify the Visual Basic program "vbPacMan" to keep track of man lives and score:
        1. To keep track of how many food pellets are visible, count them when you draw them
        2. To keep track of how many food pellets are eaten, count them when TheMan runs over them and they're visible
        3. To eat the food pellets when TheMan goes over them, if they're visible make them invisible
        4. If pellets visible equals pellets eaten then Pac Man wins
        5. Display all numbers on labels on the form
        6. New variable: intManLives and set to 3 in Form_Load()
        7. If any ghost every laps TheMan (top & left equal) then display a message and decrease intManLives
        8. To change ghost eyes (pix 1 or pix 2) new variable: intGhostEyes(3) and set to 1 in Form_Load() when loading ghosts
        9. At bottom of tmrGhost change picture -- if intGhostEyes(intGhost) = 1 display pix 1 and intGhostEyes(intGhost) = 2 if intGhostEyes(intGhost) = 2 display pix2 and intGhostEyes(intGhost) = 1
        10. To change TheMan (make his mouth move) new variable: intManNum where 1=normal, 2=narrow,3=normal, 4=wide
        11. Test intManNum at bottom of tmrMan and display proper picture and change intManNum

    23 12/23/05 Spirit Week - Holiday Dress-up Friday - Networking Essential
    1. Classroom Discussion -
      1. New Grading Criteria
      2. Networking Essentials presentation by select students
    2. Lab Assignment -
      1. Practice with networking

    12/26/05 Monday - Winter Break - No School
    12/27/05 Tuesday - Winter Break - No School
    12/28/05 Wednesday - Winter Break - No School
    12/29/05 Thursday - Winter Break - No School
    12/30/05 Friday - Winter Break - No School

    24 01/02/06 Monday - Storyboards, Microsoft PowerPoint, Microsoft Access
    1. Classroom Discussion -
      1. Story Boards
      2. Microsoft PowerPoint Tutorial from Florida Gulf Coast University:
      3. Why study Microsoft Access?
        • Relational Databases
        • Text files are a childishly simple way to store data
        • Simple doesn't always get the job done
        • Eliminate duplicate data
        • Quick comparisons
        • Faster searches
        • Uniformity
      4. Microsoft Access Tutorial from Florida Gulf Coast University:
    2. Lab Assignment -
      1. Start working on your Microsoft PowerPoint presentation about this computer science class, use the storyboard you've created as a reference
      2. Start Microsoft Access and review the main menu options
      3. Complete "vbPacMan"

    25 01/03/06 Tuesday - Computer Vocabulary, Microsoft PowerPoint, Microsoft Access
    1. Classroom Discussion -
      1. Computer Vocabulary
      2. Microsoft PowerPoint Tutorial from Florida Gulf Coast University:
      3. Why study Microsoft Access?
        • Relational Databases
        • Text files are a childishly simple way to store data
        • Simple doesn't always get the job done
        • Eliminate duplicate data
        • Quick comparisons
        • Faster searches
        • Uniformity
      4. Microsoft Access Tutorial from Florida Gulf Coast University:
    2. Lab Assignment -
      1. Continue working on your Microsoft PowerPoint presentation
      2. Create a Microsoft Access database "petStore"
        1. Create the database "perStore" in your VB folder
        2. The following may be considered a "data dictionary" describing the tables in the database and the fields in each table and the field data type and what the fields do
        3. Create a table "employee" with fields for:
          • employeeID - autoNumber - key
          • firstName - text - employee first name
          • lastName - text - employee last name
          • startDate - date - employee hire date
          • salary - currency - employee hourly wage
        4. Create a table "customer" with fields for:
          • customerID - autoNumber - key
          • firstName - text - customer first name
          • lastName - text - customer last name
          • street - text - customer street address
          • city - text - customer city address
          • state - text - customer state address
          • zip - text - customer zip code address
        5. Create a table "inventory" with fields for:
          • partNumber - autoNumber - key
          • partName - text - name and description of part
          • cost - currency - purchase price
          • price - currency - sales price
          • quantity - number - quantity on hand
        6. Create a table "salesHeader" with fields for:
          • salesNumber - autoNumber - key
          • salesDate - date - date of sale
          • employeeID - number - will link to employeeID in employee
          • customerID - number - will link to customerID in customer
        7. Create a table "salesDetail" with fields for:
          • salesDetailNumber - autoNumber - key
          • salesNumber - number - will link to salesNumber in salesHeader
          • partNumber - number - will link to partNumber in inventory
          • quantity - number - quantity sold
        8. Create relationships:
          • employeeID in employee to employeeID in salesHeader
          • customerID in customer to customerID in salesHeader
          • salesNumber in salesHeader to salesNumber in salesDetail
          • partNumber in inventory to partNumber in salesDetail
        9. Create lookups in design view:
          • lookup employeeID in employee for employeeID in salesHeader
          • lookup customerID in customer for customerID in salesHeader
          • lookup salesNumber in salesHeader for salesNumber in salesDetail
          • lookup partNumber in inventory for partNumber in salesDetail

    26 01/04/06 Wednesday - Career, Microsoft PowerPoint, Microsoft Access
    1. Classroom Discussion -
      1. Career - The Cover Letter, a tutorial from quintCareers.com
      2. Microsoft PowerPoint Tutorial from Florida Gulf Coast University:
      3. Why study Microsoft Access?
        • Relational Databases
        • Text files are a childishly simple way to store data
        • Simple doesn't always get the job done
        • Eliminate duplicate data
        • Quick comparisons
        • Faster searches
        • Uniformity
      4. Microsoft Access Tutorial from Florida Gulf Coast University:
    2. Lab Assignment -
      1. Continue working on your Microsoft PowerPoint presentation
      2. Review the Microsoft Access database "petStore" and create sorts and filters and queries

    27 01/05/06 Thursday - Science, Microsoft PowerPoint, Microsoft Access
    1. Classroom Discussion -
      1. Science - PCs, from howStuffWorks.com
      2. Microsoft PowerPoint Tutorial from Florida Gulf Coast University:
      3. Why study Microsoft Access?
        • Relational Databases
        • Text files are a childishly simple way to store data
        • Simple doesn't always get the job done
        • Eliminate duplicate data
        • Quick comparisons
        • Faster searches
        • Uniformity
      4. Microsoft Access Tutorial from Florida Gulf Coast University:
    2. Lab Assignment -
      1. Continue working on your Microsoft PowerPoint presentation
      2. Review the Microsoft Access database "petStore" and create input forms

    28 01/06/06 Friday - SkillsUSA, Microsoft PowerPoint, Microsoft Access
    1. Classroom Discussion -
      1. SkillsUSA, Professional Development Program, Chapter 1
      2. Microsoft PowerPoint Tutorial from Florida Gulf Coast University:
      3. Why study Microsoft Access?
        • Relational Databases
        • Text files are a childishly simple way to store data
        • Simple doesn't always get the job done
        • Eliminate duplicate data
        • Quick comparisons
        • Faster searches
        • Uniformity
      4. Microsoft Access Tutorial from Florida Gulf Coast University:
    2. Lab Assignment -
      1. Complete the PDP Blue Book worksheet
      2. Continue working on your Microsoft PowerPoint presentation
      3. Review the Microsoft Access database "petStore" and create reports

    29 01/09/06 Monday - SkillsUSA, SQL, VB with SQL - First Class Stamps Now Cost 39˘
    1. Classroom Discussion -
      1. SkillsUSA, Professional Development Program, Chapter 1, cont'd
      2. SQL is a standard computer language for accessing and manipulating databases. Here is a tutorial from w3schools.com:
        1. Home - learn how to use SQL to access and manipulate data in database systems
        2. Intro - a standard computer language for accessing and manipulating databases
        3. SELECT - choose data from a table, the tabular result is stored in a result table called the result set
        4. WHERE - specify a selection criterion to conditionally select data from a table, added to the SELECT statement
        5. ORDER BY - sort the result of a SELECT statement
        6. Summary - execute queries, retrieve data, insert new records, delete records and update records in a database with SQL
        7. Quick Reference
      3. Visual Basic with SQL and Microsoft Access:
        1. devdos.com - VB Access Reference
        2. VB with Database - The Basics
        3. VB with Database - Multiple Tables
        4. Mr. Clarke's Visual Basic and Active Database Object tutorial with examples
        5. Updated the reference page
    2. Lab Assignment -
      1. Try It - test your SQL skills
      2. sqlCourse.com
      3. Create a Visual Basic program "vbPetStore.vbp" to display select records from the "petStore" Microsoft Access database:
        1. Create a new Visual Basic executable project "vbPetStore.vbp" in folder "css50vbPetStore"
        2. Design the main form:
          • Name your main form "frmPetStore.frm"
          • Add a Command Button Object and code for Exit:
            End
            
          • Save & Test
          • Add a Command Button Object and code for Customers to show a Customers form and hide the main form:
            frmCustomers.Show
            frmPetStore.Hide
            
        3. Add and design a new form: menu option Project, Add Form
          • Name the new form "frmCustomers"
          • Add a Command Button Object and code for Close to show the main form and hide the Customers form:
            frmPetStore.Show
            Unload Me
            
          • Save & Test
          • Add a Data Object named "datCustomers"
          • Change the DataBaseName property to select "petStore.mdb" and then the RecordSource property to select "customers"
          • Add Textbox Object for each field in the database, name them, select the DataSource property first then the DataField property:
            textbox namedata sourcedata field
            txtCustomerID datCustomers customerID
            txtFirstName datCustomers fName
            txtLastName datCustomers lName
            txtStreet datCustomers street
            txtCity datCustomers city
            txtState datCustomers state
            txtZip datCustomers zip
            As you can see, it would be smart to set the DataSource property copy the Textbox Object
          • Save & Test
          • Can you change some of the data?
          • Locate the "frmCustomers" and double-click the form to open the code for "Form_Load()"
          • Disable keyboard entry by setting all Textboxes to Enabled = False
          • Save & Test

    30 01/10/06 Tuesday - Computer Vocabulary, SQL, VB with SQL
    1. Classroom Discussion -
      1. Computer Vocabulary - a Daily Adventure
      2. SQL is a standard computer language for accessing and manipulating databases. Here is a tutorial from w3schools.com:
        1. Home - learn how to use SQL to access and manipulate data in database systems
        2. Intro - a standard computer language for accessing and manipulating databases
        3. INSERT - add new rows into a table
        4. UPDATE - change the data in a table
        5. DELETE - delete rows in from table
        6. Summary - execute queries, retrieve data, insert new records, delete records and update records in a database with SQL
        7. Quick Reference
      3. Visual Basic with SQL and Microsoft Access:
        1. devdos.com - VB Access Reference
        2. VB with Database - The Basics
        3. VB with Database - Multiple Tables
        4. Mr. Clarke's Visual Basic and Active Database Object tutorial with examples
        5. Updated the reference page
    2. Lab Assignment -
      1. Try It - test your SQL skills
      2. sqlCourse.com
      3. Add to the form Customers to display selected output:
        • Add a Listbox Object named "lstOutput" and make it large
        • Add a Command Button Object and code named "cmdDisplay":
          Dim strData As String
          datCustomers.Recordset.MoveFirst
          Do While Not datCustomers.Recordset.EOF
              strData = ""
              strData = strData & datCustomers.Recordset!fName & " "
              strData = strData & datCustomers.Recordset!lName & " "
              strData = strData & datCustomers.Recordset!street & " "
              strData = strData & datCustomers.Recordset!city & " "
              strData = strData & datCustomers.Recordset!state & " "
              strData = strData & datCustomers.Recordset!zip
              lstOutput.AddItem strData
              datCustomers.Recordset.MoveNext
          Loop
          
        • Add a search feature
          • Add a Label Object with instructions to the user
          • Add a Textbox Object "txtSearch" for the user to enter a last name to search for
          • Add a Command Button Object "cmdSearch" and code to start the search event:
            lstOutput.Clear
            Dim strSearch As String
            Dim strData As String
            strSearch = "lName LIKE '*" & txtSearch.Text & "*'"
            datCustomers.Recordset.MoveFirst
            datCustomers.Recordset.FindFirst strSearch
            Do While Not datCustomers.Recordset.EOF
                If Not datCustomers.Recordset.NoMatch Then ' two negatives make a positive
                    strData = ""
                    strData = strData & datCustomers.Recordset!fName & " "
                    strData = strData & datCustomers.Recordset!lName & " "
                    strData = strData & datCustomers.Recordset!street & " "
                    strData = strData & datCustomers.Recordset!city & ", "
                    strData = strData & datCustomers.Recordset!state & ", "
                    strData = strData & datCustomers.Recordset!zip
                    lstOutput.AddItem strData
                Else
                    datCustomers.Recordset.MoveNext
                End If
                datCustomers.Recordset.FindNext strSearch
            Loop
            

    31 01/11/06 Wednesday - Career, SQL, VB with SQL
    1. Classroom Discussion -
      1. Career - The Cover Letter, cont'd, a tutorial from quintCareers.com
      2. SQL is a standard computer language for accessing and manipulating databases. Here is a tutorial from w3schools.com:
        1. Home - learn how to use SQL to access and manipulate data in database systems
        2. Intro - a standard computer language for accessing and manipulating databases
        3. AND OR - used in a SELECT WHERE clause to join two or more conditions. The AND operator displays a row if ALL conditions listed are true. The OR operator displays a row if ANY of the conditions listed are true
        4. IN - used in a SELECT WHERE clause if you know the exact value you want to return for at least one of the columns
        5. BETWEEN AND - used in a SELECT WHERE clause to select a range of data between two values which may be numbers, text, or dates
        6. Alias - used to rename column names and table names
        7. JOIN - used in a SELECT WHERE clause to select data from two or more tables
        8. Summary - execute queries, retrieve data, insert new records, delete records and update records in a database with SQL
        9. Quick Reference
      3. Visual Basic with SQL and Microsoft Access:
        1. devdos.com - VB Access Reference
        2. VB with Database - The Basics
        3. VB with Database - Multiple Tables
        4. Mr. Clarke's Visual Basic and Active Database Object tutorial with examples
        5. Updated the reference page
    2. Lab Assignment -
      1. Try It - test your SQL skills
      2. sqlCourse.com
      3. Modify a Visual Basic program "vbPetStore.vbp" to insert, update, and delete records from the "petStore" Microsoft Access database:
        1. Add, using a new form with all fields except "customerID":
          • I can't think of a way to use the existing form, so I'll use another
          • Add a Command Button Object named "cmdAdd" onto form "frmCustomers"
            datCustomers.RecordSource = "" ' close the record
            datCustomers.DatabaseName = "" ' close the database
            frmAddCustomers.Show ' show the Add Customers form
            frmCustomers.Hide ' hide the Customers form
            datCustomers.DatabaseName = "petStore97.mdb" ' open the database
            datCustomers.RecordSource = "customers" ' open the record
            
          • Add a new blank form "frmAddCustomers"
          • Add labels and textboxes for all fields: fName, lName, street, city, state, zip
          • Add a Data Object "datCustomers" with DataBaseName "petStore97.mdb" and RecordSource "customers"
          • Add a Command Button Object and code to Close
            frmCustomers.Show
            Unload Me
            
          • Add a Command Button Object and code to Add
            datCustomers.Recordset.AddNew ' create a new record in the table
            datCustomers.Recordset!fName = txtFN.Text ' set the text for the first name field
            datCustomers.Recordset!lName = txtLN.Text ' set the text for the last name field
            datCustomers.Recordset!street = txtS.Text ' set the text for the street field
            datCustomers.Recordset!city = txtC.Text ' set the text for the city field
            datCustomers.Recordset!state = txtST.Text ' set the text for the state field
            datCustomers.Recordset!zip = txtZ.Text ' set the text for the zip field
            datCustomers.Recordset.Update ' update the new record, completing the add new record
            datCustomers.Recordset.MoveFirst ' move to the first record
            txtFN.Text = "" ' clear the textboxes
            txtLN.Text = ""
            txtS.Text = ""
            txtC.Text = ""
            txtST.Text = ""
            txtZ.Text = ""
            txtFN.SetFocus ' set the focus to the first textbox
            
          • Save & Test
        2. Change, use the Data Control to locate the correct record then change the data in the Textboxes:
          • Use a Checkbox Object on the "frmCustomers" form to control whether the textboxes are enabled or disabled
          • Create a subroutine "enableAll()" to enable the textboxes and disable the data object
          • Create a subroutine "disableAll()" to disable the textboxes and enable the data object
          • Call "disableAll()" in the "Form_Load()"
          • Add a Checkbox Object "chkModify" with the caption "Modify Record"
          • Double-click it to create the subroutine "chkModify_Click()"
          • Test the value property and call "enableAll()" or "disableAll()"
          • Save & Test
        3. Delete, use the Data Control to locate the correct record then delete the record:
          • Add a Command Button Object "cmdDelete"
          • Always confirm before delete
          • Code to delete the recordset
            datCustomers.Recordset.Delete
            datCustomers.Recordset.MovePrevious
            
          • Display a message box whether deleted or not
          • Save & Test

    32 01/12/06 Thursday - Science, SQL, VB with SQL
    1. Classroom Discussion -
      1. Science - MicroProcessors, from howStuffWorks.com
      2. SQL is a standard computer language for accessing and manipulating databases. Here is a tutorial from w3schools.com:
        1. Home - learn how to use SQL to access and manipulate data in database systems
        2. Intro - a standard computer language for accessing and manipulating databases
        3. Functions - built-in functions for counting and calculations
        4. GROUP BY and HAVING - used in a SELECT WHERE clause to find the aggregate for each individual group of column values
        5. SELECT INTO - create backup copies of tables or for archiving records
        6. CREATE VIEW - a virtual table based on the result-set of a SELECT statement
        7. Summary - execute queries, retrieve data, insert new records, delete records and update records in a database with SQL
        8. Quick Reference
      3. Visual Basic with SQL and Microsoft Access:
        1. devdos.com - VB Access Reference
        2. VB with Database - The Basics
        3. VB with Database - Multiple Tables
        4. Mr. Clarke's Visual Basic and Active Database Object tutorial with examples
        5. Updated the reference page
    2. Lab Assignment -
      1. Try It - test your SQL skills
      2. sqlCourse.com
      3. Modify a Visual Basic program "vbPetStore.vbp" to display complex select records from the "petStore" Microsoft Access database
        1. Display records from the "salesDetail" table which is connected to the "salesHeader" and "products" tables
        2. Add Data Objects for each table and connect the DataTableName and RecordSource
          • "datHeader" connects to "salesHeader"
          • "datDetail" connects to "salesDetail"
          • "datProducts" connects to "products"
          • Make the header and products Data Objects "Visible=False"
        3. Add Textbox Objects for each field to be displayed and connect them to the correct "DataSource" and "DataField"
          • From "salesDetail" table, display "salesDetailNumber", "partNumber", "quantity" fields
          • From "salesHeader" table, display "salesDate"
          • From "products" table, display "partName", "quantity"
        4. Double-click the "datDetail" Data Object to create the "datDetail_Validate()" event and add code to make the "datHeader" and "datProducts" do a lookup
          Dim strSQL As String
          strSQL = "partNumber = " & datDetail.Recordset!partNumber ' create a search
          datProducts.Recordset.FindFirst strSQL ' perform the search
          strSQL = "salesNumber = " & datDetail.Recordset!salesNumber ' create a search
          datHeader.Recordset.FindFirst strSQL ' perform the search
          
        5. Double-click the "txtPrice_Change()" event
          If txtPrice.Text <> "" And txtQuantity.Text <> "" Then
              txtTotal.Text = CDbl(txtPrice.Text) * CInt(txtQuantity.Text)
          End If
          
        6. Double-click the "txtQuantity_Change()" event
          If txtPrice.Text <> "" And txtQuantity.Text <> "" Then
              txtTotal.Text = CDbl(txtPrice.Text) * CInt(txtQuantity.Text)
          End If
          
      4. Modify a Visual Basic program "vbPetStore.vbp" to display aggregate select records from the "petStore" Microsoft Access database

    33 01/13/06 Friday - Math, SQL, VB with SQL
    1. Classroom Discussion -
      1. Math - more on Matrices with Ms. Verde
      2. SQL is a standard computer language for accessing and manipulating databases. Here is a tutorial from w3schools.com:
        1. Home - learn how to use SQL to access and manipulate data in database systems
        2. Intro - a standard computer language for accessing and manipulating databases
        3. CREATE - create a database, table, or index
        4. DROP - delete an existing index, table, or database
        5. ALTER - add or drop columns in an existing table
        6. Summary - execute queries, retrieve data, insert new records, delete records and update records in a database with SQL
        7. Quick Reference
      3. Visual Basic with SQL and Microsoft Access:
        1. devdos.com - VB Access Reference
        2. VB with Database - The Basics
        3. VB with Database - Multiple Tables
        4. Mr. Clarke's Visual Basic and Active Database Object tutorial with examples
        5. Updated the reference page
    2. Lab Assignment -
      1. Try It - test your SQL skills
      2. sqlCourse.com
      3. QUIZ - Take the SQL Quiz 1. Click the link and follow the instructions. PRINT AND HAND IN. You only get one chance - this is not "try until you score 100". Open notes, open internet, open VB IDE (you may try out your answer in a program or Access database before you submit it), you may ask me for clarification, you may NOT ask me for the answers, likewise you may NOT ask another student for help
      4. QUIZ - Visual Basic Quiz database program "vbPetStore":
        1. Modify your existing Visual Basic program "vbPetStore.vbp" to read the "petStore97.mdb" database "employees" table. Get as much done in the time you have available
        2. Requirements:
          1. Use "frmCustomers" and code for ideas and sources
          2. Add a new form "frmEmployees"
          3. Add an object and connect to the database and table
          4. Add textboxes (disabled) to display all the fields in each record
          5. Add the ability for the user to search
          6. Add the ability for the user to insert
          7. Add the ability for the user to update
          8. Add the ability for the user to delete
          9. Save & Test
        3. Considerations:
          1. Test in phases or steps -- don't try to write the entire program and then test at the end
          2. Remember when you connect the database that Visual Basic 6 (1998) does not work with Access 2002 -- connect the correct database "petStore97.mdb"
          3. Connect the correct table -- "employees"
          4. For each object that will display field data, connect the source first then field
          5. How will you control the user ability to search?
          6. How will you control the user ability to insert new records?
          7. How will you control the user ability to update existing records?
          8. How will you control the user ability to delete old records?
          9. DO THE EASY PARTS FIRST
          10. Some of you will not finish
          11. Do as much as you can -- I will grade your work as if it were complete
          12. I will subtract points for time not spent working
        4. Do the work on the "C:" drive in the "myDocuments" folder -- it's faster and more secure and less error prone than waiting for the network to find "H:"
        5. Copy the folder with the project and form and any images to the correct "Q:" folder for me to assess
        6. Grading:
          1. Works with all requirements specified above (50 pts)
          2. Has "Option Explicit", programmer name/date, correct object and variable naming conventions, and looks good (25 pts)
          3. Has extra features remembered from programs written in the past (25 pts)
          4. IN-CLASS ASSIGNMENT -- DUE TODAY
            LATE SUBMISSIONS NOT ACCEPTED
            FROM STUDENTS NOT ABSENT

    01/16/06 Monday - Martin Luther King Day - No School
    34 01/17/06 Tuesday - Computer Vocabulary, PowerPoint, FAFSA
    1. Classroom Discussion -
      1. Computer Vocabulary - a Daily Adventure
      2. samsPublishing.com
      3. PowerPoint Tutorial
      4. Online FAFSA form - Free Money for College
    2. Lab Assignment -
      1. Work on your Microsoft PowerPoint presentation class advertisement project

    35 01/18/06 Wednesday - Career, "vbMatchGame"
    1. Classroom Discussion -
      1. Some ideas on how to make a GREAT PowerPoint presentation:
      2. samsPublishing.com
      3. PowerPoint Tutorial
    2. Lab Assignment -
      1. Work on your Microsoft PowerPoint presentation class advertisement project

    36 01/19/06 Thursday - Science, "vbMatchGame"
    1. Classroom Discussion -
      1. Science - Motherboards, from howStuffWorks.com
      2. samsPublishing.com
      3. PowerPoint Tutorial
    2. Lab Assignment -
      1. Work on your Microsoft PowerPoint presentation class advertisement project
      2. Create a Visual Basic game program "vbMatchGame":
        1. Concept:
          • The gameboard is made up of 8 pairs of images for a total of 16
          • The images are covered by another image
          • As the user clicks on covered images the images underneath are uncovered
          • If two match, they stay uncovered or disappear
          • If they don't match, they are covered back up
          • The game continues until the user successfully uncovers all of the matching images
        2. Locate 8 images and save them into a folder "css##vbMatchGame"
        3. Create a new VB executable "frmMatchGame" and "vbMatchGame"
        4. Add menu items for Exit and NewGame
        5. Add an Image Object "imgBoard" as the background of and make it the same size as the game board
        6. Add an Image Object "imgCover" to cover the pictures
        7. Copy and paste a total of 16 (0 - 15) of these CREATE A CONTROL OBJECT
        8. Add an Image Object "imgPic" for the pictures
        9. Copy and paste a total of 16 (0 - 15) of these CREATE A CONTROL OBJECT
        10. Create a subroutine to set the board:
          • Randomly choose which Image Object will contain which picture
          • Only place two of each picture
          • Remember which pictures are placed on which Image Object
        11. Work on any other incomplete game programs

    37 01/20/06 Friday - SkillsUSA, "vbMatchGame"
    1. Classroom Discussion -
      1. SkillsUSA, Professional Development Program, Chapter 1, cont'd
      2. samsPublishing.com
      3. PowerPoint Tutorial
    2. Lab Assignment -
      1. Work on your Microsoft PowerPoint presentation class advertisement project
      2. Modify the Visual Basic game program "vbMatchGame":
        1. Complete the subroutine to set the board - use a list of 0 - 15 numbers 0 - 7 & 0 - 7 to choose which picture will be loaded into which box. Randomly choose one of the 0 - 15 numbers and remember which box it is placed into:
          • Declare an array variable "intPicNum(15)" to remember which pictures are loaded into which squares
          • Load "intPicNum(15)" with the numbers 0 - 7 and 0 - 7
          • Use "intPlace" to show which Image Object you are loading the picture and which place in "intPicNum()" you are
          • Get a random number between intCount - 15
          • Load the picture referenced by "strPicName(intPicNum(intRand))"
          • Switch "intPicNum(intPlace)" and "intPicNum(intRand)" using a temporary variable "intTemp"
        2. In "form_Load()" set "imgPic()" top, left, width, height and test with visible and invisible
        3. Randomize!
        4. Add an Image Object "imgCover" to cover the pictures, height & width = 2000, picture, stretch
        5. Copy and paste a total of 16 (0 - 15) of these CREATE A CONTROL OBJECT
        6. In "form_Load()" set "imgCover()" top, left, width, height and test with visible and invisible
        7. Code the "New Game" menu option: "Call setBoard()"
        8. Double-click on "imgCover" to create a subroutine "imgCover_Click()" and write hte code:
          • New variables: "intCountClick", "intClick1", "intClick2"
          • In "setBoard()" set "intCountClick = 0"
          • Create a Select Case to evaluate the value of "intCountClick"
          • "imgCover_Click()" will have one parameter variable: "Index"
          • Case 0: picture = visible, cover = invisible, intClick1 = Index, intCountClick = 1
          • Case 1: picture = visible, cover = invisible, intClick1 = Index, intCountClick = 2
          • Case 2: computer must make a decision:
            • if two pictures match:
            • then: both pictures = invisible, revealing part of the background
            • else: picture = invisible, cover = visible
            either way, intCountClick = 0
        9. Save & Test, Test, Test

    38 01/23/06 Monday - SkillsUSA, Visual Basic Common Dialog Boxes - File Open, "vbCalculator"
    1. Classroom Discussion -
      1. SkillsUSA - PDP Blue Book, complete level 1-1, Self-Assessment
      2. Visual Basic Common Dialog Boxes - File Open
      3. Our text at samsPublishing.com is available
    2. Lab Assignment -
      1. Visual Basic program "vbCalculator":
        1. Create a new VB executable "frmCalc.frm" & "vbCalc.vbp" in a folder called "css50vbCalc"
        2. Design the form
        3. Write the code
        4. Save & Test
        5. Have Fun

    39 01/24/06 Tuesday - Résumé, Visual Basic Common Dialog Boxes - File Save, "vbCalculator"
    1. Classroom Discussion -
      1. The Résumé, tutorial from quintCareers.com
      2. Visual Basic Common Dialog Boxes - File Save
      3. Our text at samsPublishing.com is available
    2. Lab Assignment -
      1. Complete the "vbCalculator" from yesterday

    40 01/25/06 Wednesday - Career, Visual Basic Common Dialog Boxes - File Print, "vbCypher4"
    1. Classroom Discussion -
      1. Career - The Cover Letter, cont'd, a tutorial from quintCareers.com
      2. Visual Basic Common Dialog Boxes - File Print
      3. Our text at samsPublishing.com is available
    2. Lab Assignment -
      1. Design and create the form for "vbCypher4" that we'll write code for on Friday
        1. Concept:
          • Get a phrase (series of alphabetic letters) in plain English
          • Perform a simple math substitution (A=1, B=2, C=3 ... Z=26) -- a blank space is zero
          • Get pairs of numbers -- add a zero to an odd set
          • Use a predetermined inversion matrix to perform a matrix inversion on the pairs of numbers
          • This will result in different sets of pairs of numbers
          • Reverse the steps to decode a coded message in numbers to get alphabetic letters
        2. Form design:
          • a Textbox Object for input of a phrase or sentence
          • a Listbox Object for the list of pairs of numbers
          • Command Button or Menu Objects to encode or decode
          • a Textbox Object for output
        3. Variables:
          • a string array for the letters of the alphabet
          • an integer sentinel to control any loops
          • an integer array for the pair of numbers
          • an integer length of textbox input
          • an integer counter for the pair of numbers
        4. Steps:
          • Create the form
          • Initialize the alphabet string array
          • Save & Test
          • Input may not be blank
          • Determine how long the input text is
          • If the length is odd, add a blank space to the end of the input text and re-determine how long the input text is
          • Loop to do all letter in input text
          • Get each letter
          • Change any lowercase alphabetic characters to uppercase
          • Put the number for the first letter into the first position of the number array
          • Put the number for the second letter into the second position of the number array
          • Add both numbers to the listbox with a comma delimiter
          • Repeat for all letters in input text

    41 01/26/06 Thursday - "vbChange" and "vbVolume"
    1. Classroom Discussion -
      1. Professional Development Day for Mr. Clarke - Substitute Teacher
      2. Our text at samsPublishing.com is available
    2. Lab Assignment -
      1. Create a Visual Basic Program "vbChange" to figure out how do give change, how many quarters, dimes, nickels, pennies:
        1. Create a new Visual Basic executable
        2. Design the form with sufficient controls & objects
        3. Process a change amount:
          • How many quarters?
          • How many dimes?
          • How many nickels?
          • How many pennies?
        4. Use / and mod in sequence to determine how many of a coin and the remainder
        5. Display enough information back to the user so that a sales clerk could use your program to give change to a customer
        6. Test & Save to the "Q:/" drive
      2. Create a Visual Basic Program "vbShapeVolume":
        1. Create a new Visual Basic executable
        2. Design the form with sufficient controls & objects
        3. Determine volumes of different types of shapes given their exterior dimensions:
          • Volume of a cube with equal dimensions
          • Volume of a box that's not a perfect cube with unequal dimensions
          • Volume of a can
          • Volume of a sphere
          • Volume of a pyramid
          • Volume of a cone
        4. Use the internet to lookup any formulas that you may not already know
        5. Use Radio Button Objects to allow the user to choose which object
        6. Correctly label any input Textbox Objects to tell the user what to type where
        7. Correctly label any output
        8. Test & Save to the "Q:/" drive
      3. Work on your PowerPoint

    42 01/27/06 Friday - Math, Visual Basic Common Dialog Boxes - Font & Color, "vbCypher4"
    1. Classroom Discussion -
      1. Ms. Verde will visit to discuss how matrices can be used to create sophistocated cyphers
      2. Visual Basic Common Dialog Boxes - Font & Color
      3. Our text at samsPublishing.com is available
    2. Lab Assignment -
      1. Add the code to "vbCypher4"

    ClickHERE for Marking Period 3
    02/04/06 Saturday - SkillsUSA Open House at the Brick Vocational Center - Click for more information
    • Voluntary
    • 9:00 a.m. to 1:00 p.m.
    • Demonstrations of what we're learning and doing
    • Web sites and PC programming
    • Games and Prizes
    • Fun for all ages
    • Extra-credit available
    • Not interested? Stop by and see what other students in other classes in the school district are doing
    02/09/06 Thursday - Open House at the Toms River Vocational Center - Click for more information
    • Voluntary
    • 7:00 p.m. to 9:00 p.m.
    • Demonstrations of what we're learning and doing
    • Web sites and PC programming
    • Games and Prizes
    • Fun for all ages
    • Extra-credit available
    • Not interested? Stop by and see what other students in other classes are doing
    Next week we are responsible for the morning announcements - any volunteers?

    webopedia
    webster
    whatis
    vocabulary