ExamSample_ans - the actual argument 3....

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Q.A F, T, F, T, F, T, T, F, F, T Q.B c, b, e, a, e, b, f, a, c, e Q.C 1. Yes, no, no, no, yes (on separate lines) 2. A, sample, line, of (on separate lines, note that the last word, text, is not part of the answer) 3. evian 4. q will always be greater than zero so the loop will never terminate 5. 3, 5, 9, 17 (on separate lines) 6. 15, 12.6 7. 10, 10 8. 5, 3 9. 16, 16, 2 10. -5, 11, 1 11. 4, 6, 6 Q.D 1. Dim indx As Integer indx = ListBox2.Items.Add(ListBox1.SelectedItem) 2. If ListBox1.SelectedIndex >= 0 Then btnPressed = MessageBox.Show( _ "Confirm removal of item . ..", _ "Remove member", MessageBoxButtons.YesNo) If btnPressed = Windows.Forms.DialogResult.Yes Then ListBox1.Items.Remove(ListBox1.SelectedItem) End If Else btnPressed = MessageBox.Show( _ "First select an item to remove") End If Q.E 1. Should be descriptive, meaningful for the context 2. Memory cell for ByVal argument contains copy of value of actual argument, memory cell for ByRef argument contains reference to location in memory of
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: the actual argument 3. abstraction/modularisation (helps handle complexity); re-use of code Q.F lblReward.Text = VbNullString btnGo.Visible = False btnStop.Visible = True Sub ByRef face As Color temp = generateRandom.Next(1,7) Sub btnGo.Visible = True btnStop.Visible = False Sub (no parameters) colourString = vbNullString Call build(colourString) lblReward.Text = reportOn(colourString) Sub colours = colours & colourOf(grpSlots.Controls(ctrl)) Function (ByVal sender As Control) As String Function Function (ByVal colours As String) As String Function Function (ByVal s As String) As Integer Function Q.G Dim base16, digit As String Dim i, p, base10 As Integer base16 = txtBase16.Text base10 = 0 p = base16.Length - 1 For i = 0 To base16.Length - 1 digit = base16.Substring(i, 1) base10 = base10 + DIGITS.IndexOf(digit) * 16 ^ p p = p - 1 Next lblBase10.Text = base10 Q.H 1. Private Sub subOne( ByRef x As Integer, ByRef y As Integer) Dim temp as Integer temp = x x = y y = temp End Sub 2. 3...
View Full Document

This note was uploaded on 01/12/2012 for the course CSE CSE1530 taught by Professor Lew during the Spring '09 term at York University.

Page1 / 2

ExamSample_ans - the actual argument 3....

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online