Docsity

Declaration Statements - Business Applications Programming - Exam, Exams of Business Management and Analysis

Toggle sidebar
bg1
Semester I Examinations 2009/ 2010
Exam Code(s)
1AE1, 1MIS1, 1MIS2
Exam(s)
Masters of Business Studies in Electronic Commerce
MSc. Information Systems Management full-time
MSc. Information Systems Management part-time
Module Code(s)
MS806
Module(s)
Business Applications Programming
Paper No.
Repeat Paper
External Examiner(s)
Professor H. van der Heijden
Internal Examiner(s)
Dr. T. Acton
Mr. Seamus Hill
Instructions:
Candidates are required to answer:
Section A (20 Marks) Answer all 10 parts of section A,
This section consists of 10 multiple-choice questions all of which
should ideally be attempted. Answers are to be written on the MCQ
sheet provided, NOT on the Examination paper.
Section B (80 Marks) Answer Any Two Questions
Duration
Department(s)
Course Co-ordinator(s)
Requirements:
MCQ
Yes, Type a-d
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Declaration Statements - Business Applications Programming - Exam and more Exams Business Management and Analysis in PDF only on Docsity!

Semester I Examinations 2009/ 2010

Exam Code(s) 1AE1, 1 MIS 1 , 1 MIS Exam(s) (^) Masters of Business Studies in Electronic Commerce MSc. Information Systems Management full-time MSc. Information Systems Management part-time

Module Code(s) (^) MS8 06 Module(s) Business Applications Programming

Paper No. Repeat Paper

External Examiner(s) Professor H. van der Heijden Internal Examiner(s) Dr. T. Acton Mr. Seamus Hill

Instructions: Candidates are required to answer: Section A (20 Marks) Answer all 10 parts of section A, This section consists of 10 multiple-choice questions all of which should ideally be attempted. Answers are to be written on the MCQ sheet provided, NOT on the Examination paper. Section B (80 Marks) Answer Any Two Questions Duration 3 hrs

Department(s) (^) Accountancy & Finance Course Co-ordinator(s)

Requirements : MCQ Yes, Type a-d

Section A (20 Marks)

Attempt all 10 questions

Mark your answers on the MCQ sheet provided

1) Assume that you are designing a form where the user will need to select only one item

from a group of displayed choices. This can best be accomplished by using _______.

a) check boxes

b) text boxes

c) radio buttons

d) name boxes

2) Declaration statements _______.

a) can only be written inside a procedure

b) are only allowed in the Declarations section of a form

c) variables and constants names, and specify the type of data they will hold

d) are not needed for constants

3) In Visual Basic, we work with objects that have _______.

a) Programmer preference

b) Projects, solutions, and procedures

c) Classes, actions, and disciplines

d) Properties, methods, and events

4) With the logical operator _______ , both expressions must be true for the entire

expression to evaluate True.

a) And

b) Or

c) .AndAlso

d) OrElse

5) Which of the following statements is NOT true?.

a. Functions perform an action and then return a value to the point from which

they were called.

b. Function procedures and sub procedures can be supplied with arguments

c. Arguments sent to sub procedures and functions procedures can be sent

ByVal or ByRef.

d. Sub procedures and function procedures can return values to the point from

which they were called.

Section B (80 Marks) Answer Any TWO Questions

Question 2

Review the following application and explain the purpose of the application and how it works.

Explain, line by line, the purpose of each class and procedure. Where possible sketch the relevant

forms and outputs. Use the line numbers for reference purposes.

1 Option Strict On 2 3 Public Class pieceworkForm 4 5 Friend workerCountInteger, totalPiecesInteger As Integer 6 Friend totalPayDecimal As Decimal 7 Const RATE1_TO_199_Decimal As Decimal = 0.5D 8 Const RATE200_TO_399_Decimal As Decimal = 0.55D 9 Const RATE400_TO_599_Decimal As Decimal = 0.6D 10 Const RATE600_PLUS_Decimal As Decimal = 0.65D 11 12 Private Function AmountEarned(ByVal quantityInteger As Integer) As Decimal 13 14 Dim payRateDecimal As Decimal 15 16 Select Case quantityInteger 17 Case 1 To 199 18 payRateDecimal = RATE1_TO_199_Decimal 19 Return quantityInteger * payRateDecimal 20 Case 200 To 399 21 payRateDecimal = RATE200_TO_399_Decimal 22 Return quantityInteger * payRateDecimal 23 Case 400 To 599 24 payRateDecimal = RATE400_TO_599_Decimal 25 Return quantityInteger * payRateDecimal 26 Case Is > 599 27 payRateDecimal = RATE600_PLUS_Decimal 28 Return quantityInteger * payRateDecimal 29 End Select 30 End Function 31 32 Private Sub CalculatePayToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalculatePayToolStripMenuItem.Click 33 34 Dim messageString As String 35 Dim quantityInteger As Integer 36 Dim amountEarnedDecimal As Decimal 37 38 With Me 39 If .nameTextBox.Text <> "" Then 40 Try 41 42 quantityInteger = Integer.Parse(.quantityTextBox.Text) 43 44 If quantityInteger > 0 Then

46 amountEarnedDecimal = AmountEarned(quantityInteger) 47 totalPayDecimal += amountEarnedDecimal 48 totalPiecesInteger += quantityInteger 49 workerCountInteger += 1 50 51 .amountEarnedTextBox.Text = amountEarnedDecimal.ToString("C") 52 Else 53 messageString = "Please enter a number greater than zero." 54 MessageBox.Show(messageString, "Data Entry Error", _ 55 MessageBoxButtons.OK, MessageBoxIcon.Information) 56 With quantityTextBox 57 .Focus() 58 .SelectAll() 59 End With 60 End If 61 Catch quantityException As FormatException 62 MessageBox.Show("Enter the quantity.", "Data entry error", _ 63 MessageBoxButtons.OK, MessageBoxIcon.Information) 64 With .quantityTextBox 65 .Focus() 66 .SelectAll() 67 End With 68 End Try 69 Else 70 messageString = "Please enter worker name." 71 MessageBox.Show(messageString, "Missing Data", _ 72 MessageBoxButtons.OK, MessageBoxIcon.Information) 73 .nameTextBox.Focus() 74 End If 75 End With 76 End Sub 77 78 Private Sub SummaryToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SummaryToolStripMenuItem.Click 79 80 Dim messageString As String 81 82 If workerCountInteger > 0 Then 83 summaryForm.ShowDialog() 84 Else 85 messageString = "No data to summarize." 86 MessageBox.Show(messageString, "Piecework Pay", MessageBoxButtons.OK, _ 87 MessageBoxIcon.Information) 88 End If 89 End Sub 90 91 Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click 92 93 Me.Close()

145 Else 146 .LogoToolStripMenuItem.Checked = True 147 .logoPictureBox.Visible = True 148 End If 149 End With 150 End Sub 151 End Class 152 Option Strict On 153 154 Public Class summaryForm 155 156 Private Sub summaryForm_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated 157 158 With Me 159 Try 160 If pieceworkForm.workerCountInteger > 0 Then 161 .piecesTextBox.Text = pieceworkForm.totalPiecesInteger.ToString 162 .payTextBox.Text = pieceworkForm.totalPayDecimal.ToString("C") 163 .averageTextBox.Text = (pieceworkForm.totalPayDecimal / pieceworkForm.workerCountInteger).ToString("C") 164 .numberWorkersTextBox.Text = pieceworkForm.workerCountInteger.ToString 165 End If 166 Catch anyException As Exception 167 MessageBox.Show("Error: " & anyException.Message, "Error") 168 End Try 169 End With 170 End Sub 171 172 Private Sub okButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles okButton.Click 173 174 Me.Hide() 175 End Sub 176 End Class 177

(40 Marks)

Question 3

Part a)

In relation to VB .NET discuss with appropriate examples each of the following

terms:

i) Parameter passing By Value and By Reference

ii) Scope and lifetime of module-level, local, and static variables

(10 Marks)

Part b)

Create a project in which the user will complete a 10 Question survey using the following

questions:

Q 1. Do you read the textbook chapter before class?

Q 2. Do you complete the homework when it is assigned?

Q 3. Do you attend class regularly?

Q 4. Do you participate in class discussions?

Q 5. Do you participate in a study group?

Q 6. Do you answer questions in the textbook?

Q 7. Do you practice with the Hands on Exercises?

Q 8. Do you try little projects to test all new topics?

Q 9. Do you ask questions when unsure of a topic?

Q 10. Do you use the online Help to learn more about each feature?

Create a form containing labels with each of the questions and a group of radio buttons

for each question with the following responses: Always, Usually, Sometimes, Seldom and

Never (see below).

Use a two dimensional array to accumulate the number of each response for each

question. You should have a second form to display an item analysis which shows the

question number and the count for each response.

(30 Marks)