Uploaded by Roziyani Setik

Programming Methodology

advertisement
FINAL EXAMINATION
APRIL 2022 SEMESTER
COURSE
COURSE CODE
DURATION
FACULTY
: PROGRAMMING METHODOLOGY
: IAS 1123
: 3 HOURS
: FACULTY OF COMMUNICATION, VISUAL ART
AND COMPUTING
: COMPUTING
: BACHELOR OF BIOINFORMATICS (HONS)
BACHELOR OF SCIENCE (HONOURS) INDUSTRIAL
TECHNOLOGY
BACHELOR IN INFORMATION TECHNOLOGY
(HONOURS)
BACHELOR OF SOFTWARE ENGINEERING (HONS)
BACHELOR OF COMPUTER SCIENCE (HONS.)
: MDM. ROZIYANI BTE SETIK (0193170659)
DEPARTMENT
PROGRAMME
LECTURER &
PHONE NO
This paper consists of two (2) sections:
Section A – 3 questions (structured questions)
Section B – 2 questions (essay questions)
Answer all questions.
All answers of:
Section A and B must be written in answer booklet provided.
The answer for each question must start on a new page
Candidates are NOT ALLOWED to bring any unauthorized items into the exam hall
except with the permission of your invigilator.
Do Not Open the Question Paper Until Instructed
This Answer Paper Consists of Five (5) Printed Pages
CONFIDENTIAL
FCVAC/IAS1123/APRIL22
SECTION A: STRUCTURED QUESTIONS (60 MARKS)
ANSWER ALL QUESTIONS
Question 1
a)
If value of Redang and Tioman before execution is 111 and 444. What is
the value for each of variables after the following statements are being
execute?
(10 marks)
Operation
Redang += Redang ;
Tioman -= Redang ;
Tioman *= Redang ;
Tioman %= Redang
;
Tioman +=250
b)
Given that R = 1000, find the value for Z and R in every line. Assume that
the codes will be run in sequences.
Z = ++ R
Z = R ++
Z = -- R
Z = R -Z = ++ R
Z = R ++
Z = -- R
Z = R -Z = -- R
Z = R --
(10 marks)
CONFIDENTIAL/2
FCVAC/IAS1123/APRIL22
Question 2
Melur Firdaus own a bakery shop in Gombak that selling varieties of cakes with
different prices. Mastura wanted to order 7 slices of cake of type F which cost RM19.90
each. She then adds on paper bag with charges of RM2 each. Each transaction that
more than RM100 will be earned a free cup of tea as a promotion. Each customer also
promoted to join a membership which will receive a discount of 5% for every purchase
by submitting their name and ID card number. Payment of the transaction can be done
by using cash, e-wallet or debit card. If Melur Firdaus wanted to develop a new sales
and purchase system for her stall.
a)
Suggest any SIX (6) possible variables name with a suitable data type using the
correct naming convention from the above scenario together with value it
carried as a preparation for IPO chart development.
(3 marks)
b)
Write a pseudocode for the calculation statement for the total sum that Mastura
should pay if she already enrolled as a member of the stall using variables that
you indicate in a). Mastura present RM200 in cash to cover the charge and she
will get the balance amount and “Thank You” message.
(7 marks)
Question 3
Iteration is a term used in computer programming to describe a process in which a
sequence of instructions or structures is repeated a predetermined number of times
or until a condition is satisfied. You wanted to design a program that could printing
a multiplication of odd number with himself between number 11 and 25 using Do
WHILE and REPEAT UNTIL loop techniques. Based on the question, construct
i)
Problem analysis table.
(4 marks)
CONFIDENTIAL/3
FCVAC/IAS1123/APRIL22
ii)
Pseudo-code
(8 marks)
iii)
Flowchart
(8 marks)
iv)
Desk check table
(10 marks)
CONFIDENTIAL/4
FCVAC/IAS1123/APRIL22
SECTION B: ESSAY QUESTIONS (40 MARKS)
ANSWER ALL QUESTIONS
Question 1
Budiman Enterprise is a company that selling and delivering fresh fruit from their
farm. The company will charge for their services based on items weight and its
delivery charges is based on customer’s location. Fruit cost is RM10 per kilogram
and the charge for delivery is RM5 per order for local area and RM6 per kilogram
for other than that area. The program will receive the data from the user, which is
the item’s weight. Then, the program will calculate the amount to be charged to the
customer. Considering the system development using function method approach,
i)
Construct its pseudocode
(5 marks)
ii)
Perform its Python coding.
(15 marks)
Question 2
Develop a program logic that performs arithmetic functions which design to prompt
values for the variables from users. Both variables will be passed to methods named
by area() and perimeter() for a trapezium. Compute the values of two arguments,
respectively so each method should perform the appropriate computation and
display the results.
i)
Present hierarchy chart for the above-mentioned scenario.
(4 marks)
ii)
Construct a compliance pseudocode to the problem solution.
(10 marks)
iii)
Represent the pseudocode using the flow chart.
(6 marks)
END OF QUESTION PAPER
CONFIDENTIAL/5
Download