EDK EME 6930 (formerly EME 6412)
Programming Languages in Education:
Visual BASIC as a Research Tool

EVALUATION PROGRAM ASSIGNMENTS TO BE SUBMITTED

Eval1 Eval2 Eval3 Eval4 Eval5 Eval6 Eval7 Main Page

General Instructions

Before attempting to write any of the EVAL programs below:

1) Complete the corresponding chapters in the textbook, run & study the demo programs provided with the textbook, and do the exercises.

2) Try to write some programs of your own invention that apply your new knowledge. Try to write a whole bunch of them. You learn to program by PROGRAMMING -- what a concept!

3) Then, run & study the related instructor-provided demo programs. You can run these programs from within Visual BASIC and you are able to see the code, as with the text-provided programs.

4) Run the appropriate EVAL demo program (EVAL1.EXE, for example) to get a visual example of the evaluation program that you must write and submit to the instructor. These EVAL programs cannot be run from within Visual BASIC. They are compiled so that you are not able to see the code. To run them, just double-click them or RUN them from the Windows Start button. MSIE users can also See them On-Line!

5) Now try to write your EVAL submission

As you create your evaluation programs, adhere to the general intent of the each task, not the exact detail of how it has been accomplished in the sample EVAL.EXE program. I don't want you to recreate the sample programs, just to do something comparable that accomplishes the same general objectives about learning programming.


EVAL ASSIGNMENT DESCRIPTIONS


EVAL 1: Introduction to Visual BASIC - (Complete chapters 1-3 in your text. Also, read pp. 425-426 on the subject of access keys.  Study Eval1Demo1.vbp, Eval1Demo2.vbp, Eval1Demo3.vbp, and Eval1Demo4.vbp in your instructor-provided demo programs.)

Create an original program that that allows the user to enter demographic data into text boxes or other controls, and then use command buttons to manipulate the data and change the attributes of the controls. In addition to tabbing through the data fields in a logical order, your program should also allow the user to access each data field in order using keystroke combinations.

For example, in Eval1.exe, notice how pressing ALT-I at any time causes the cursor to jump to the 'ID' field, ALT-A jumps to the 'Age' field, and so on. Also, when the user clicks on a command button, the data in the input fields are displayed in a scrolling output box. Command buttons are also used to change the text color of the labels. Run Eval1.exe for a demonstration. See it On-Line!


EVAL 2: Data & Decision-Making - (Complete chapters Chapters 4.1-4.6 & 5.5 in your text.  In this unit and throughout the remainder of the course, you may also need to consult chapters 10, 11, and 12, depending upon what you try to accomplish.  Study Eval2Demo1.vbp, Eval2Demo2.vbp, Eval2Demo3.vbp, and Eval2Demo4.vbp in your instructor-provided demo programs.)

Create an original program that uses multiple groups of controls to collect data from a user, performs some kind of processing on that data, and provides some kind of qualitative response that depends upon the result of the data processing. Also, use Inputboxes to collect some appropriate text data from the user, and use MessageBoxes to display pop-up messages or to offer options to the user.

Eval2.exe, for example, asks the user to complete an erstaz 'programming attitude' survey. When the user clicks on a command button, the mean (average) of the Likert item responses is computed and displayed, along with some interpretation of the measure. See Eval2.exe for an example. See it On-Line!

(If you decide to use option button controls to implement a Likert-type instrument, such as I did in my sample solution, you will most likely want to group the controls inside frames, which can be tricky.  If you have trouble getting the option controls to be attached to the frame, try this: group them by holding down the SHIFT key as you click each one with the mouse, use the EDIT menu option to CUT them, click on the desired frame control, then use the EDIT menu to PASTE them into it. Also, DON'T read ahead and try to use an array yet -- that will come in Eval3 (it might help to read Eval3 below now, but don't attempt to do it. It is expected that your solution for this problem will be repetitive and tedious.)


EVAL 3: Repetition & Arrayed Data - (Complete chapters Chapters 4.7-4.12 & 5 in your text. Study Eval3Demo1.vbp, Eval3Demo2.vbp, Eval3Demo3.vbp, and Eval3Demo4.vbp in your instructor-provided demo programs.)

Create an original program in which you apply methods of repetition (looping) to indexed (subscripted) controls such as list boxes, combo boxes, and control arrays to manipulate moderately large amounts of information.

Eval3.exe, for example, revises the Eval2.exe program to use an array of controls instead of individual (scalar) controls. This greatly reduces the amount of code required to compute the mean. Instead of writing many similar lines of code to test the value of each control (e.g IF Option1.Value = True THEN ...), the program uses one line of code placed within a loop to address each control (e.g. IF Option1(Index).Value = True THEN ...). Since one big array of option buttons is used, the complete solution also requires the use of Visual BASIC's MOD FUNCTION. MOD stands for modular, and it computes the remainder of a division problem. For example, since 7 divided by 5 produces the remainder 2, the result of the Visual BASIC expression 7 MOD 5 is 2. A different approach that is less computationally complex is to use multiple arrays of option buttons arranged vertically or horizontally. Also, since all the controls in an array now invoke the same methods, you no longer need to use a command button to cause the mean to be re-computed, so the program has been revised to automatically update the mean each time a control is changed. See it On-Line!


EVAL 4: Functions - (Complete chapters 6.16, 7 & 8 in your text. You may also need to read additional sections of 6.  Study Eval4Demo1.vbp, Eval4Demo2.vbp, Eval4Demo3.vbp, Eval4Demo4.vbp, Eval4Demo5.vbp, and Eval4Demo6.vbp in your instructor-provided demo programs.)

Create an original program in which you use Visual BASIC functions (e.g. Abs, Asc, Chr, Date, Format, InStr, Int, Left, Len, LoadPicture, Mid, Right,Rnd, Time, Timer, UCase, Val) to accomplish a substantial task. (If you haven't been doing so, now is the time to begin differentiating your work from my sample solutions.)

Eval4.exe, for example, focuses on the use of timing functions to time the latency of a subject's responses to a test of the limits of short term memory (Miller's number - 7 +/- 2 chunks.) Beginning with one digit, then two digits, then three digits, and continuing until the subject fails, the program displays a seemingly random sequence of digits (it is really a sequence that the programmer determined) in a text box for a fixed amount of time, then hides the digit(s) and ask the subject to recall them. When the subject fails, the latency of the response on the last trial is shown. See it On-Line!

NOTE: The Miller's number concept will be carried throughout the remainder of the examples, culminating with a program (Eval7) that is very close to a very good course project. Eval4 is when you should begin writing your Eval programs to center on the research idea that you will use in your project.


EVAL 5: Modular Programming - (Complete chapters 6.1-6.8 & 6.17 in your text. 6.11-6.15 are optional.  Study Eval5Demo1.vbp, Eval5Demo2.vbp, Eval5Demo3.vbp, Eval5Demo4.vbp, Eval5Demo5.vbp, and Eval5Demo6.vbp in your instructor-provided demo programs.)

Modify your Eval4 (or start anew) to create an original program that manipulates a relatively large amount of data using modular programming methods. a) Implement major parts of the program as SUBPROGRAMS. Include in your program at least one SUBPROGRAM or FUNCTION to which a variable is passed. b) Use a variable (data) array to store larger data sets. c) Then, create a Function to which that array is passed to perform some kind of processing or analysis with the data contained in the array.

For example, in Eval5.exe (See it On-Line!), the code that causes the digits to be displayed for a specific amount of time is a subprogram called Delay. Hence, the expression Delay 2 causes the digits to remain on the screen for 2 seconds. At the end of the program, instead of displaying the latency of the last response, the mean latency of all the responses is displayed. This was implemented by creating a function called Mean. For example, the expression: MsgBox Mean(Latency(), NumTrials)
causes the mean of all the response latencies stored in the array named "Latency" to be displayed in a message box. "NumTrials" contains the number of trials completed.

NOTE: Many students find this unit to be the most difficult part of the course. However, it is not normally possible to achieve an "A" grade if you fail "get" these concepts. (It IS still possible to get a "B", though.)


EVAL 6: Files & Databases - (Complete chapter 14 in your text. 18 is optional.  Study Eval6Demo1.vbp, Eval6Demo2.vbp, Eval6Demo3.vbp, Eval6Demo4.vbp, and Eval6Demo5.vbp in your instructor-provided demo programs.)

Modify your Eval5 (or start anew) to create an original program that: a) collects both demographic data and data related to the program's purpose, b) stores those data in a disk text file, c) under password protection, allows the data to be retrieved and viewed, and d) prints the data to the Windows default printer. (NOTE: If you would prefer to use a database instead of a text file, and you can do it with little-or-no help from me, that is an allowable option.)

Eval6.exe, for example, modifies Eval5.exe by collecting a subject's ID# and age. It then stores that information along with the performance data in a text file with fixed rows and columns for ease of exportation to other programs (such as SAS, SPSS, Excel.) By entering the password "EME6930", the researcher is able to view and to print the data. See Eval6.exe for an example. See it On-Line!


EVAL 7: Randomness, Multimedia & Other Topics - (Complete chapters 6.9-6.10, 9, 13.  20 is optional. Study Eval7Demo1.vbp, Eval7Demo2.vbp, Eval7Demo3.vbp, Eval7Demo4.vbp, and Eval7Demo5.vbp in your instructor-provided demo programs.)

Modify your Eval6 (or start anew) to create an original program that: a) implements menus appropriately, b) implements randomness appropriately, and c) implements static or dynamic media elements (e.g. multimedia: pictures, movies, sounds) appropriately.

Eval7.exe, for example, modifies Eval6.exe by including menu items to duplicate or extend the functions of the various buttons. Also, the memory items are now chosen randomly. They differ every time the program is run. Finally, still and moving images are used to enhance the program. See Eval7.exe for an example. See it On-Line! (Note: Owing to technical limitations, the online version of Eval7 does not implement menu items.)

Supplemental Notes on Multimedia and Randomness:

MULTIMEDIA - Additional information on how to play movies (*.avi) and sounds (*.wav), used in Eval7Demo5.vbp.The following line is placed in the general declarations section of the form's code:*
Private Declare Function mciExecute Lib "WINMM" (ByVal CommandString As String) As Integer
Then, lines like the following:
Dummy = mciExecute("play " & App.Path & "\" & "uhoh.wav")
are placed in code sections where you want the media played. The App.Path reference causes Visual BASIC to look for the file in the same directory where the program resides. (NOTE: This method appears to cause an error if there are any spaces in any of the folder names in the path.) If you have access to some *.AVI files, try replacing the filename. They should also work. The performance of such files is degraded if they are retrieved from floppy diskettes.
{* NOTE1: For older, 16 bit (Windows 3.1) installations of VB, you must use the following line instead:}
Declare Function mciExecute Lib "MMSystem" (ByVal CommandString As String) As Integer
{* NOTE2: Recently, some students have reported problems with using this multimedia technique. I suspect that this may be specific to users of Windows XP, and possibly NT/2000, who have placed their files in folders on the Desktop or other folders that contain spaces in their names.  The Desktop folder is no longer located at c:\windows\desktop in WinXP. There is now a folder at c:\Documents and Settings\ that contains a folder for each user. Each user's folder contains a Desktop subfolder. Since the c:\Documents and Settings\ folder has such a long name that also contains spaces, it causes an error in the multimedia features of the Eval7 Demo5 and Sample Solution programs. They are unable to locate *.avi and *.wav files that are placed in the same folder. (This probably happens because a 16-bit API call is made, for those who are interested in such matters.) I'll work on a long-term solution for this, but in the meantime I suggest that you place all your files in a folder that has a short path with no spaces, e.g. c:\vbart6  Also, for purposes of simply being able to implement multimedia for your own needs and interests, look into using the MS Multimedia MCI Control (Deitel Ch. 10 tells how to get it, Ch 20 tells how to use it), or a general OLE control (Ch.10). Neither of those techniques is quite as flexible as the method described here, but they are useful substitutes.}

RANDOMNESS - Additional information on how to cause events to occur randomly, used in Eval7Demo4.vbp (also Demos 2 & 3.) The documentation immediately below is copied from the VB4 Working Model Online Help:

Rnd Function - Returns a Single containing a random number. Syntax - Rnd[(number)]
The optional number argument is a Single or any valid numeric expression.
Return Values -
If number is: Rnd generates:
Less than zero The same number every time, using number as the seed.
Greater than zero The next random number in the sequence.
Equal to zero The most recently generated number.
Not supplied The next random number in the sequence.
Remarks -
The Rnd function returns a value less than 1 but greater than or equal to zero. The value of number determines how Rnd generates a random number: For any given initial seed, the same number sequence is generated because each successive call to the Rnd function uses the previous number as a seed for the next number in the sequence. Before calling Rnd, use the Randomize statement without an argument to initialize the random-number generator with a seed based on the system timer.
To produce random integers in a given range, use this formula:
Int((upperbound - lowerbound + 1) * Rnd + lowerbound)
Here, upperbound is the highest number in the range, and lowerbound is the lowest number in the range.
Note: To repeat sequences of random numbers, call Rnd with a negative argument immediately before using Randomize with a numeric argument. Using Randomize with the same value for number does not repeat the previous sequence.

Return to Main Page