Question 1.1. (TCO 7) (a) Explain what is meant by data validation and discuss why it is important in programming. (b) What type of control structure is used in data validation? Explain your answer. (c) A user enters a patient's weight in pounds into a medical application. Describe at least two specific validation checks that should be performed on this input.(Points : 30) |
Question 2.2. (TCOs 2 and 4) You have been asked to develop an application to keep track of employees' scheduled vacations and ensure that all vacations are approved by the manager and that each employee does not exceed his or her maximum annual vacation time. Maximum annual vacation time is determined by the number of years the employee has worked for the firm. You are using object-oriented programming (OOP) to develop this application. (a) Describe at least two classes that you could use in this application and what each class would represent in the real world. (b) Describe at least two properties of each class you identified in part (a) and identify the data type you would use for each property. (c) Describe at least one method of each class you identified in part (a), giving for each the method name and the action performed by the method. (Points : 30) |
Question 3.3. (TCOs 8, 9, and 10) (a) Explain the value to a business user of storing information entered in an application in a database. (b) In a two-tier architecture with a fat client and thin server, describe the functions performed by the client and by the server in processing a request by a user for information from a database. (c) In a Visual Basic application that retrieves data from a database, describe the role of a dataset. (Points : 30) |
|
Question 1.
1. (TCOs 1, 2, and 3) You have been asked to develop an application with the following business requirements: The user will enter an order quantity, which must be a whole number, and a unit price, which can have dollars and cents. When the user clicks a Calculate Total button, the application will calculate a total price by multiplying the quantity times the unit price. The application will display the total price to the user. (a) Develop a TOE chart for this application. You do not need to put it in table form, but list what would go in the Task column, what would go in the Object column, and what would go in the Event column for each row of the chart. Your chart should have at least four rows: two for input, one for processing, and one for output. (b) Write pseudocode for the button-click event procedure in this application. (c) Identify three variables that you would declare for this application. For each, provide a variable name that follows the syntax rules of Visual Basic and the Hungarian naming convention, and an appropriate Visual Basic data type. (Points : 30)
|
Question 2.2. (TCO 5) Consider the following Visual Basic code snippet: If intScore >= 100 Then lblMessage.Text = "Great job!" Else lblMessage.Text = "Better luck next time" End If (a) What type of control structure is this? Be as specific as possible, and justify your answer. (b) Describe step by step how this code will be executed and what will be displayed to the user for each of the following values of intScore: 99, 100, and 101. (c) Rewrite this code snippet so that it still produces the same results, but changing the condition in the first line from intScore >= 100 to intScore < 100. (Points : 30) |
Question 3.
3. (TCO 6) Consider the following code snippet: Dim intTotal As Integer = 0 For intNum As Integer = 1 To 5 intTotal += intNum Next intNum MessageBox.Show( intTotal.ToString() ) (a) What type of control structure is this? Be as specific as possible, and explain your answer. (b) Identify the counter variable and the accumulator variable in this loop. Explain your answer. (c) Describe step by step how this code will be executed and what value will be displayed in a message box to the user. (Points : 30)
|
|