0% found this document useful (0 votes)
235 views

Final Exam Format - DIP1PRG11

Section A contains 40 multiple choice questions worth 40 marks. Section B contains 4 short answer questions worth between 5-15 marks each, totaling 35 marks. Section C contains 1 coding question worth 25 marks. Sample questions include creating variable names, using functions like ToString() to format values, writing code snippets, using control structures like Select Case, and identifying syntactically incorrect code. The longest question asks to write a sequential search method and indicate if a value is found in an array.

Uploaded by

theetcana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
235 views

Final Exam Format - DIP1PRG11

Section A contains 40 multiple choice questions worth 40 marks. Section B contains 4 short answer questions worth between 5-15 marks each, totaling 35 marks. Section C contains 1 coding question worth 25 marks. Sample questions include creating variable names, using functions like ToString() to format values, writing code snippets, using control structures like Select Case, and identifying syntactically incorrect code. The longest question asks to write a sequential search method and indicate if a value is found in an array.

Uploaded by

theetcana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Final Exam Format

Section A

1. Multiple Choice Questions


2. 40 Questions
3. 40 Marks

Section B

1. Short Answer Questions


2. 4 Questions
3. Each question carries 5 – 15 marks
4. Total 35 Marks

Section C

1. Coding
2. 1 Question
3. Total 25 marks

SAMPLE QUESTIONS

SHORT ANSWERS

1. Create variable names that would be appropriate for holding each of the following
information items: (4 Marks)
a. The number of backpacks sold this week
b. Today’s date
c. An item’s wholesale price
d. A customer’s name

2. Assuming that the variable dblTest contains the value 67521.584, complete the following
table, showing the value returned by each function call: (4 Marks)

Function Call Return Value


dblTest.ToString(“d2”)
dblTest.ToString(“c2”)
dblTest.ToString(“e1”)
dblTest.ToString(“f2”)

3. Write a line (or lines) of code to carry out the task. (8 Marks)
(a) Make btnButton disappear.
(b) Set the color of the characters in the text box txtBox to red.
(c) Enable the disabled button btnOutcome.
(d) Give the focus to txtBoxTwo.
4. Table 1 below gives the terms used by the National Weather Service to describe the
degree of cloudiness. Write Select Case statements that use percentage of cloud cover
to display the appropriate descriptor. (6 Marks)

Table 1 Cloudiness Descriptors


Percentage of Cloud Cover Descriptor
0 – 30 Clear
31 – 70 Partly cloudy
71 – 99 Cloudy
100 Overcast

5. Identify the syntactically incorrect statements in the following: (8 Marks)

(a) Loop
intX = intX + 1
Do While intX < 100

(b) Do
lstOutput. Items.Add (“Hello”)
intX = intX + 1
While intCount < 10

(c) Loop Until intX = 99


intX = intX + 1
Do

(d) For intX = 1


lstOutput.Items.Add(intX)
Next

6. Write a procedure named TimesTen that accepts a single Integer argument. When the
procedure is called, it should display the product of its argument multiplied by 10 in
message box. (6 Marks)

7. Write the code for a sequential search that determines whether the value -1 is stored in the array
named intValues. The code should print a message indicating whether the value is was found.
(14 Marks)
CODING

(a) Design a flowchart for the event handler btnCalcSale_Click, which calculates the total of
a retail sale. Assume the program uses txtRetailPrice, a TextBox control that holds the
retail price of the item being purchased, and decTAX_RATE, a constant that holds the sales tax
rate (6%). The event handler uses the items above to calculate the sales tax for the purchase and
the total of the sale. Display the total of the sale in a label named lblTotal. (4 Marks)

(b) Convert the flowchart you constructed into Visual Basic code. Write comments wherever
appropriate. (6 Marks)

You might also like