CIS 56 INTRODUCTION TO VISUAL BASIC

Evening School

Programming Assignment 6

Week of March 24,2003

Your assignment this week is as follows:

First you are to read chapter 6 on multiforms.

Programming:

Make a copy of last weeks assignment and do the following, or if youd rather, you can write a new program and copy the controls from the old form to the new and copy the code you need from the old to the new. However you do it is up to you.

Add an array to hold the description of the items, the item type, ie "Hard Covered Book", and have it loaded when the program is run and add a command to display them as a separate entity.

There are 3 ways from which you can choose to do the loading.

Add 4 more text boxes to follow the members name.

You are to code validation, in the respective validation events, for each of these new entries.

Where the comma and period are concerned you will need to concatenate.

REMEMBER THAT YOU WILL HAVE TO ADJUST YOUR TAB INDEX PROPERTY ACCORDINGLY FOR THE ADDITIONAL TEXT BOXES.

IN ALL THE VALIDATIONS FOR ALL THE ENTRIES, INCLUDING THE ITEM NUMBER AND DESCRIPTION, CONVERT TO UPPER CASE

Now create a user data type of your own for all the member information:

Create an array of that type for at least 10 members.

Add a command button to add the member to the array.

When you go to add the member, you must have a procedure to read through the array to be sure that the member does not already exist. If the member exists, then take appropriate action. If not, the addition can be made. You might find the use of a Boolean flag useful for this. Take into consideration the possibility of an out of range subscript. Be careful in dimensioning your arrays.

When you read through the array, you are to use a DO loop, either Do While or Do Until. How you use it or whichever you use is up to you, but it must be a DO loop.

Now, create a multidimensional array for at least 10 members, to hold 3 fields. (10 rows, 3 columns)

The first column will hold the members id number, the second will hold a running integer total of the number of items borrowed each time you do a transaction for that member and the third column will hold the running total currency type value of the charges for each entry for that member.

HINT, QUESTION: Arrays are declared to be a certain type. What type would OR could you use, when you are dealing with three different types in one array????????????

Add a command button, which will display the members information from the data type array, followed by a blank line, depending on what youre using for a display media, and then the total of items that member borrowed and the total charges he/she paid from the multidimensional array.

You are to retain the ability you had in the last program to display final totals so, for the display of the member info, add a different command button.

Also, when you display the city, state, zip, they should be concatenated on the same line with appropriate spacing. This too is a MUST.

This should not be a problem if you did your validation correctly.

Your output for the member should look something like this. Assume I used a list box:

12345

JOHN DOE

15 MAIN ST

FALL RIVER, MA. 02721

Total items borrowed: 25

Total cost: $15.75

23456

MARAGARET PETERS

45 DONDER RD.

FALL RIVER, MA. 02721

Total items borrowed: 32

Total cost: $25.00

I will, of course be going over the tools you will need to do this project at Mondays meeting. I have modified the program from last week to incorporate the requirements of this assignment.

Keep in mind however, that last weeks assignment must be turned in separately form this one. You cannot turn in one assignment to satisfy both last weeks and this weeks requirements.

I also remind you to be sure to include the heading documentation and be EXPLICIT with ALL the documentation in your code. WHAT YOU ARE DOING MUST BE CLEAR.

Also, I want you to think of a topic to use in next weeks assignment. The specifications for next weeks assignment will incorporate chapters 8 and 6. I will give the specifications and you will apply them to a program, based on the topic youve selected. The topic you choose should be something youd like to try or something that is of interest to you.

In the class of March 31st, I will cover essentials of chapter 6 and add some more functions/tools for you that I have not touched on yet.

QUIZ ALERT!!!!!

I will ask Mrs. Grocer to post your next quiz on the weekend of April 5-6.

This quiz will incorporate chapters 1 through 8 inclusively.

Know that this quiz will be programmic, where you will have to correct, explain and possibly add to a program I will have written, with the possibility of a few essay type questions.

Please be prepared, by making sure you have read the chapters and understand what theyre about.

As always, you can direct questions to me via e-mail.