Docsity

software engineering methods, Exams of Software Engineering

Toggle sidebar
bg1
1
Name : _________________________________
Tutorial : ___________________________
ANSWER ALL QUESTIONS.
1. In order to solve a programming problem, the programmer needs to follow the correct
problem solving steps. This is to ensure that no errors occur while the program is being run.
a) What is problem solving? [2 marks]
_______________________________________________________________________
_______________________________________________________________________
b) List the first two (2) steps in problem solving. [2 marks]
_______________________________________________________________________
_______________________________________________________________________
c) Identify the steps in problem solving which involve in the situation. [3 marks]
Test the system and record all the problem
found.
The design of pseudocode and flowchart.
Ahmad is analysing the process of a
system that his team needs to develop.
d) In your opinion, why should the program be tested before delivering it to the user?
[2 marks]
_______________________________________________________________________
_______________________________________________________________________
Untuk Kegunaan Pemeriksa
No. Soalan
Markah
1
11
2
15
3
29
4
15
Jumlah
GEMPUR PSPM
SC025
SESI 2021/ 2022
KOLEJ MATRIKULASI SELANGOR
pf3
pf4
pf5
pf8

Partial preview of the text

Download software engineering methods and more Exams Software Engineering in PDF only on Docsity!

Name : _________________________________ Tutorial : ___________________________ ANSWER ALL QUESTIONS.

  1. In order to solve a programming problem, the programmer needs to follow the correct problem solving steps. This is to ensure that no errors occur while the program is being run. a) What is problem solving? [ 2 marks ] _______________________________________________________________________ _______________________________________________________________________ b) List the first two (2) steps in problem solving. [ 2 marks ] _______________________________________________________________________ _______________________________________________________________________

c) Identify the steps in problem solving which involve in the situation. [ 3 marks ]

Test the system and record all the problem found. The design of pseudocode and flowchart. Ahmad is analysing the process of a system that his team needs to develop. d) In your opinion, why should the program be tested before delivering it to the user? [ 2 marks ]



Untuk Kegunaan Pemeriksa No. Soalan Markah 1 11 2 15 3 29 4 15 Jumlah

GEMPUR PSPM

SC

SESI 2021/ 2022

KOLEJ MATRIKULASI SELANGOR

e) Justify one (1) importance of algorithm in problem solving. [ 2 marks ]



  1. a) KMSโ€™s Bookstore is doing a End Year sales promotion. Total price will be calculated based on quantity and price of the items. if a customer purchases above RM15.00, the customer will be given 1 5 % discount. Otherwise, 5% discount will be given. Calculate the price that a customer should pay. Based on the given scenario, design the algorithm by using a pseudocode. [ 7 marks ]
  1. (a) Write Java assignment statements for the following algebraic equations. (i) y = a x^2 + b x + c [2 marks] (ii) ๐‘‘ = ( ๐‘› (๐‘› + 1 ) 2 )^2 [3 marks] (b) Given the following Java codes. int a = 10, b = 5; while (a <= 50) { a = a + b; } System.out.print (a); (i) State the output(s) based on 3(b). [1 mark] (ii) Rewrite the code using for loop. [3 marks]

c) Rewrite the below Java assignments in the correct version. [ 3 marks] (assume all the variables have been declared.) d) What is the output of the following code segments? (assume all the variables have been declared.) [ 3 marks] Java Statements Output i. y = 10; if (y > 7) System.out.print ("AAA"); System.out.print ("BBB"); ii i . for (u = 1; u > 3; u = u+1) { System.out.print (u + " " ); } iii. System.out.print(โ€œ### โ€œ); System.out.println(โ€œ****โ€); System.out.print(โ€œ##โ€); System.out.print(โ€œ/n**โ€); i. char aChar = 5.5; ii. if (salesAmount >10 && <50) iii. String aName; String anotherName; if (aName == anotherName)

iii) Write a Java program segment for : A Method named calcNumbers that will accept two integer numbers and return the product value if both numbers are odd, return the total value if both numbers are even or return the division value if both numbers are not odd or even. [ 6 marks ]

  1. Blood pressure reading basically has two numbers, for example 125/85 mmHg. The top number (125) is called systolic while the bottom (85) is called diastolic. Based on these reading, the level of blood pressure of a person can be determined, such as low, ideal, pre- high or high. Write a complete Java program that performs the following tasks: ๏‚ท Request the reading of blood pressure for systolic and diastolic for n persons. Store the data in the arrays named arrSystolic and arrDiastolic respectively. ๏‚ท Find minimum reading of diastolic. ๏‚ท Count the number of person that can be categorized as low blood pressure where the reading of systolic is less than 100 and diastolic is less than 60.

[ 15 marks ]