Visual Basic Quiz on classes

 

  1. Using the program invclass2, modify it so that instead of m_onhand and m_onorder in Receive Inv, you use OnHand and OnOrder.  Explain what is happening before and after the change.  Submit the working program.

 

  1. The following example uses the &= operator to concatenate two String variables and assign the result to the first variable.

Dim var1 As String = "Hello "

Dim var2 As String = "World!"

var1 &= var2   ' The value of var1 is now "Hello World!" from VB.NET Help

Look at the timer program and explain what the &= is doing in the For loop and in the subs such as cmdNum1 and cmdNum2.

 

  1. Looking at the program calStuGradeRO, explain the following:
    1. objStuGrade = New ClassStuGrade(strName)
    2. objStuGrade.CalcFinalGrade(intGrade1, intGrade2, intGrade3)
    3.  

    Public ReadOnly Property Average() As Integer

        Get

            Return m_average

        End Get

    End Property

  1. Looking at the program PhoneLog, explain what these lines do:

 

Dim PhoneCalls As New Collection

PhoneCalls.Add(phoneCall, CStr(phoneCall.LogNo))

 

  1. Looking at the program PhoneLog, explain how you can delete something from the collection.

 

  1. Explain the difference between ByRef and ByVal. To do this, look at the programs called procbyref1, procbyref2, procbyval1 and procbyval2. Explain what is happening in each of these programs. They are under moving to VB.NET and in the zipped files covering procedures, functions and menus. This is the direct address to the listing (but I really want you to run the programs). http://www.pgrocer.net/Cis67/classinfo/ProcFunc.html