ANSWERS FOR FINAL REVIEW QUESTIONS 1. A property is a procedure that gets or sets the value of a data member. A method is a procedure that accomplishes something. 2. Compiler: Syntax errors that can be caught before even running the program. They are marked with a wavy underline in the IDE. Exception: Situations that cause the program to crash such as division by zero or itrying to use an object before instantiating it. Logic: Errors that are not compiler errors and do not cause the program to crash, but that cause wrong answers in the program. 3. Advantage of Double: Allow decimal numbers, have a larger range than an int. Advantage of Integer: Takes up less space than a Double, no problems with round off errors. 4. Lists all possible data types when you type "Dim x As ". Lists all possible members when you type a dot after an object. Lists the arguments of a method when you type a left parenthesis. A drop down list allows you to choose among overloaded versions. 5. Use a Handles clause (requires object to be declared WithEvents). Use an AddHandler statement (WithEvents not needed). 6. Private x As New TextBox 7. A variable or expression value that is passed into a method. 8. Dim p As New Pen(Color.Black) 9. Location, Size, BackColor, ForeColor, Text, Font, Visible, Enabled, TabIndex, TabStop. 10. Form Events: Load, Activated, Deactivated, Closing, Closed. Control Events: Click, DoubleClick, TextChanged, MouseUp, MouseDown, MouseMoved, Enter, Leave, Paint. 11. txtGPA.Text = gpa.ToString("#0.000") 12. =, +=, -=, *=, /=, &= 13. Public Sub btnPushMe_Click(sender As Object, e As EventArgs) btnPushMe.Text &= "*" End Sub 14. ToLower, ToUpper, Substring, Trim, IndexOf, IndexOfAny. 15. Add, Insert, RemoveAt, Clear, Sort. 16. ' After the items in the array list are sorted, the ' largest item will have the largest index. a.Sort() System.Console.WriteLine(a(a.Count - 1)) 17. For Each c As Control In Me.Controls c.BackColor = Color.Cyan Next 18. Dim sw As New StreamWriter("c:\output.txt") For Each s As String In cb.Items sw.WriteLine(s) Next