lOMoARcPSD|24542669
2019 DS1 NOV EXAM - Past paper
Development Software 1 (Walter Sisulu University)
Studocu is not sponsored or endorsed by any college or university
Downloaded by Bheki Mthembu (
[email protected])
lOMoARcPSD|24542669
WALTER SISULU UNIVERSITY
2019 DEGREE AND DIPLOMA EXAMS:
NOVEMBER EXAMINATION – QUESTION PAPER
SUBJECT : DEVELOPMENT SOFTWARE 1 MAINSTREAM
: DEVELOPMENT SOFTWARE 1 EXTENDED YEAR 2
SUBJECT CODE : DEV11P0, EDS12P0, DEV11B0, EDS12B0, DEV11Q0
EXAMINER/S : MS L V D MERWE/MS S DUBE/MS A DAVID
: MS S VIJAYALEKSHMI / DR S FERNANDEZ
: MR A MABOVULA
MODERATOR : MR P TAMBA-TAMBA
DURATION : 180 minutes
MARKS : 100
NUMBER OF PAGES : 4 (including cover page)
INSTRUCTIONS
This is a closed book exam.
No student is allowed to borrow anything from another student.
All cell phones must be switched off.
Calculators may be used but cell phones may not be used as calculators.
All questions must be answered on the paper provided.
Write your last name, student number and group number on the cover of the answer paper.
Answer all questions.
Questions may be answered in any order. Include question number with the answer.
EXAMINATION RULES ARE NOW IN FULL FORCE AND EFFECT.
DO NOT TURN THE PAGE BEFORE BEING TOLD TO DO SO.
Page 1 of 4
lOMoARcPSD|24542669
QUESTION 1 [ 25 marks ]
Mista Kwezza is selling tickets for an all-star music show at Buffalo City stadium.
Tickets are available for 3 different blocks of seats at the prices shown below:
BLOCK CODE PRICE PER TICKET
VIP 8000.00
A 4000.00
B 2000.00
If a person buys more than 100 tickets, there is a discount of 15% off the total.
A program is needed to do the following:
Accept the block code (VIP, A or B) and the quantity of tickets wanted. Calculate and display the
total each person must pay after discount.
Use a FOR LOOP to repeat the input 500 times. Accumulate or count the required totals.
When there is no more input, display the following (with meaningful messages):
a. the total quantity of tickets sold for the VIP block
b. the total price after discount for all of the tickets sold
c. the total number of people who received a discount
DO THE FOLLOWING:
1a. Write the pseudocode for the program. [ 25 marks ]
You MUST use NESTED IF statements to calculate the price per ticket.
QUESTION 2 [ 15 marks ]
Ayoba Promotions was contracted to select young people to take part in the Cala Heritage Day
parade. People were selected based on their age, gender, and weight as follows:
a. Females; age over 16 years but under 18 years; weight more than 30 kgs
b. Males; age equal to 18 years; weight less than 60 kgs
c. Age equal to 20 or age equal to 30; weight between 55 kgs and 58 kgs
A program is needed to do the following:
Accept the gender (M or F), age, and weight of the person. The program must then use the
above selection criteria to display the message “SELECTED” if the person qualifies to be
selected or display the message “SORRY” if they do not qualify.
DO THE FOLLOWING:
2a. Draw a flowchart for the program. [ 15 marks ]
QUESTION 3 [ 25 marks ]
Security guards were hired to assist with crowd control at the Shine conference held in Mthatha.
They were paid according to their job grade as follows:
Page 2 of 4
lOMoARcPSD|24542669
Job Daily Daily Daily
Grade Basic Meals Transport Tax deduction
Pay Allowance Deduction
1 R800 R100 R30 8% of the amount due
2 R950 R130 R30 10% of the amount due
The amount due for each day - before tax - is basic pay plus meals allowance minus transport
deduction.
A program is needed to do the following:
Accept the job grade (1 or 2) and number of days the security guard worked. The program must
then calculate and display (with meaningful messages):
a. the total for the meals allowance paid to the security guard for all of the days worked
b. the total tax deducted for all of the days worked
c. the final salary paid to the security guard for the days worked (after tax)
DO THE FOLLOWING:
3a. Draw an IPO chart for the program. [ 5 marks ]
3b. Write the VB Console Application code for the program. [ 20 marks ]
QUESTION 4 [ 15 marks ]
Draw a trace table for the following pseudocode, using these input values: 10 2 20
There are no runtime or syntax errors.
BEGIN
DECLARE V, X, Y, Z AS INTEGER
ACCEPT X, Y, Z
V = X * Y + 5 * (Z – 17)
IF V - 2 <= X + Y + Z THEN
Z = Y ^ 3
ELSE
Z = Y * 3
END IF
SELECT CASE Z
CASE 20
DISPLAY “X ” X
CASE 8
DISPLAY “Y Y ”
CASE ELSE
DISPLAY V “ V ”
END SELECT
END
QUESTION 5 [ 12 marks ]
For each of the following, write down exactly what will be displayed on the output screen.
Page 3 of 4
lOMoARcPSD|24542669
5a. [ 3 marks ]
Dim in1 as Integer
Dim in2 as Double
in2 = -5.5
IF in1 > 0 OR in2 + in1 < 0 then
Console.WriteLine(“TRUE”)
END IF
Console.WriteLine(“FALSE”)
5b. [ 3 marks ]
Dim i, num1, num2 as Integer
num1 = 5
num2 = (num1 * 2 – (num1 – 1))
For i = num1 to num2
Console.WriteLine(i)
Next i
5c. [ 3 marks ]
Dim marks As Integer
marks = 65 \ 10
Select Case marks
Case 1, 5 To 8
Console.WriteLine ("YES")
Case 6, 7
Console.WriteLine ("MAYBE")
Case Else
Console.WriteLine ("NO")
End Select
5d. [ 3 marks ]
Dim colour, code As String
code = “A”
IF code = colour THEN
colour = “BLUE”
ELSE
If code <> “A” THEN
colour = “RED”
ELSE
colour = “GREEN”
ENDIF
ENDIF
Console.WriteLine (colour)
QUESTION 6 [ 8 marks ]
6a. Name and briefly describe the major characteristics of the 3 main program control structures.
Page 4 of 4