Beruflich Dokumente
Kultur Dokumente
______________________________________________________________________________
MAIN PAPER
INSTRUCTIONS
1
SECTION A
Question 1
For i = 0 To array.GetUpperBound()
total += array(i)
Next
Interest = 0
For Year =1 to NumberOfYears
Interest = Interest+((Principal + Interest))+ InterestRate/100)
Next Year
End Sub
End Class [7]
2
if(rate >= 0.0 and rate < 1.0)
price = 20 * rate
else (rate <= 1.0 and rate < 2.0)
price = 15 * rate
else (rate >= 2.0)
price = 10 * rate
msgbox(price) [5]
lstDisplay.add.items(S1,S2)
Dim count as Integer,dim term as Integer
Question 2
b) Sub first()
Dim x as integer
x=20
Display.items.add(x)
Call second(x)
Display.items.add(x)
End Sub
3
Sub second (y as integer)
y=40
Display.items.add(y)
End Sub
SECTION B
Question 3
a) Write a sub program to find the largest, smallest, sum and average number of array of ten
numbers. [12]
b) Write a VB procedure to reverse the digits of given number e.g. 1234 => 4321. [8]
Question 4
a) Assume you want to generate a multiplication table of any given number from 1 to 12.
Write a program that allows the user to enter the number and then generate the
multiplication table. The output a number 2 should look like this:
1X3=3
2x3=6
.
.
12 x 3=26 [12]
4
Question 5
Question 6
A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges
an additional $0.50 per hour for each hour or part thereof in excess of three hours. The
maximum charge for any given 24-hour period is $10.00. Assume that no car parks for longer
than 24 hours at a time.
Required :
Write a program that calculates and displays the parking charges for each customer who parked a
car in this garage yesterday. You should enter in a TextBox the hours parked for each customer.
The program should display the charge for the current customer. The program should use the
method Calculate Charges to determine the charge for each customer. [20]
[END]