Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

KEDAH MATRICULATION COLLEGE

MINISTRY OF EDUCATION OF MALAYSIA

COMPUTER SCIENCE 2 (SC025)


SESSION 2021/2022

INDIVIDUAL ASSIGNMENT : ARRAY

1
TABLE OF CONTENTS

TITLE PAGE

Problem Statement 3

Problem Analysis 4

Design a solution 5–6

Implementation 7

Testing 8–9

Documentation 10

References 11

2
i) PROBLEM STATEMENT

A program will receive inputs from the user and save them in a double type array; price[].
The minimum data to be saved is ten (10). This program also allows user to retrieve the saved
data. User will enter the keyword (price) to be searched in the array. The program then will
display an appropriate message if the element is found, the index of found element and an
appropriate message if the element is not found.

3
ii) PROBLEM ANALYSIS

 Problem analysis is an analysis of a problem statement to identify input, process and


output to gain a better understanding of the problem.

INPUT : price , find price

PROCESS : To declare and create array price that will store in the array. Repeat the

values of 10 price and find the values in the array. If the

price found, display message “The price is found”. If the price

is not found, display message “The price is not found”.

OUTPUT : message “The price is found” or message “The price is not found”.

4
iii) DESIGN A SOLUTION

 Design a solution is creating an algorithm that represent step-by-step solution that will
transform the input into the output of a problem.

PSEUDOCODE

Start
declare ten price
initialize i to zero

for i less than ten


read price
add one to i

endfor
read find price
for i less than ten

if find is equal to price


print message “The price is found”
add one to i

else if
print message “The price is not found”
endif

endfor
Stop

5
FLOWCHART

Start

declare price [10]

i=0

F
i < 10 read find price

T
read price

F
i=i+1
i < 10 print message “The
price is not found”
T

find price = price Stop

T
F

print message “The


price is found”

i=i+1

6
iv) IMPLEMENTATION

 Implementation is the process of implementing an algorithm by writing a computer


program using a programming language such as Java.

7
v) TESTING

 Program testing is the process of executing a program to verify that the program is correct
and it will do what it is expected to do.

The price is found at 1 index.

The price is found at 2 index.

8
The price is not found at any index.

The price is error.

9
vi ) DOCUMENTATION

 Documentation defined as produce a description of the program that helps other


programmers in editing or maintaining the program later.

 Internal documentation is written in a program as comments. It is created within the


programming department and shows the design and implementation of the project.

 External documentation is written in a place where people who need to use the software
can read about how to use the software. It would be things like flowcharts and design
documents.

10
vii) REFERENCES

- Ben Lutkevich (2022, February 25). Software Documentation.


https://www.techtarget.com/searchsoftwarequality/definition/documentation?amp=1

- Mohd Amran, M.A & Maziah, M.Z. (2022). Introduction to Programming JAVA
LEARN BY EXAMPLE.

- Sonoo Jaiswal (n.d). How to take array input in Java.


https://www.javatpoint.com/how-to-take-array-input-in-java

- Vijay, Ruslan Desyatnikov & Swati (2022, April 3). Java String Array.
https://www.softwaretestinghelp.com/java-string-array/

11
12

You might also like