You are on page 1of 14

PENYERAHAN DAN PENILAIAN TUGASAN

ASSIGNMENT SUBMISSION AND ASSESSMENT


_________________________________________________________________________
CBDS2103
DATA STRUCTURE
MAY 2018
_________________________________________________________________________

ARAHAN KEPADA PELAJAR / INSTRUCTIONS TO STUDENTS

1. Tugasan ini mengandungi DUA soalan sahaja yang disediakan dalam Bahasa Melayu dan Bahasa
Inggeris / This assignment contains only TWO question that is set in both Malay and English.

2. Jawab dalam Bahasa Melayu atau Bahasa Inggeris. / Answer in Malay or English.

3. Anda dikehendaki menyerahkan tugasan dalam format MsWord melainkan dinyatakan


sebaliknya. Anda tidak dibenarkan untuk menukar teks/frasa tugasan tersebut kepada format
grafik seperti .jpeg / .gif / print screen / dan lain-lain format berkaitan. /Learners are to submit
assignment only in MsWord format unless specified otherwise. Please refrain from converting
text/phrases into picture format such as .gif / .jpeg / print screen / etc.

4. Muat turunkan templat tugasan versi bahasa yang berkenaan daripada myINSPIRE untuk
penyediaan dan penyerahan tugasan anda. Tugasan anda hendaklah ditaip dengan
menggunakan saiz fon 12 Times New Roman dan langkau baris 1.5. / Download the language
version of the assignment template concerned from the myINSPIRE for preparation and
submission of your assignment. Your assignment should be typed using 12 point Times New
Roman font and 1.5 line spacing.

5. Anda dikehendaki menghantar tugasan SECARA ONLINE melalui myINSPIRE. Sila rujuk kepada
portal untuk arahan mengenai prosedur menghantar tugasan anda secara online. Anda
dinasihatkan menyimpan senaskah tugasan yang diserahkan untuk rujukan sendiri. / You must
submit your assignment ONLINE via the myINSPIRE. Refer to the portal for instructions on the
procedures to submit your assignment online. You are advised to keep a copy of your submitted
assignment for personal reference.

6. Anda hanya boleh menghantar tugasan SEKALI sahaja dalam BEBERAPA FAIL seperti mana
keperluan soalan (1 fail utama dan fail-fail sokongan/lampiran. / You can submit your
assignment ONCE only in a MULTIPLE FILE as per requirement of the assignment (1 main file and
attachment/supporting files).

7. Tugasan anda hendaklah diserahkan antara 9hb Julai 2018 hingga 22hb Julai 2018. Serahan
selepas 22hb Julai 2018 TIDAK akan diterima. / Your assignment must be submitted between 9th
July 2018 until 22nd July 2018. Submission after 22nd July 2018 will NOT be accepted.
8. Tugasan hendaklah disiapkan secara individu. Anda dilarang meniru tugasan orang lain. Anda
juga dilarang sama sekali memplagiat kerja orang lain sebagai kerja sendiri. /
Your assignment should be prepared individually. You should not copy another person’s
assignment. You should also not plagiarise another person’s work as your own.

9. Sila ambil maklum tentang PENALTI yang akan dikenakan ke atas penghantaran lewat tugasan
seperti yang tertera di pekeliling pejabat Pendaftar 6/2012 (Rujuk Registrar’s Announcement di
myVLE). / Please take note that PENALTY will be imposed on late submission of assignment as
specified in the Registrar’s Office circular 6/2012 (Refer to Registrar’s Announcement in myVLE).

10. Anda perlu memastikan RESIT yang dikeluarkan bagi penghantaran tugasan disimpan sebagai
bukti penghantaran. Kegagalan mengemukakan resit dalam sebarang isu yang timbul berkaitan
penghantaran tugasan akan mengakibatkan tugasan dianggap TIDAK dihantar / Please ensure
that you keep the RECEIPT issued upon submisson of your assignment as proof of submission.
Your assignment is considered as NOT submitted if you fail to produce the submission receipt in
any dispute arises concerning assignment submission.

PENILAIAN / EVALUATION
Tugasan ini menyumbang sehingga 60% daripada jumlah markah kursus berkenaan dan akan dinilai
berdasarkan kepada Rubrik yang dilampirkan. / This assignment accounts for 60% of the total
marks for the course and shall be assessed based on the Rubrics attached.

Anda akan diberikan maklum balas tentang tugasan ini sebelum Peperiksaan Akhir Semester
bermula. / You would be given feedback on the assignment before the Final Semester Examination
commences.

PLAGIARISME: POTONGAN MARKAH / PLAGIARISM: MARKS DEDUCTION

Amaran: Tugasan yang diserahkan, secara automatik, akan disemak untuk menentukan kadar
pertindihan. Jika plagiarisme dikesan, markah akan dipotong seperti berikut: / Warning: The
submitted assignment will automatically undergo a similarity check. If plagiarism is detected,
marks would be deducted as follows:
% Kumpulan Pertindihan (Similarity % Potongan Markah (Marks
No.
Group) Deduction)
1 0 – 30 0
2 30.01 – 50 5
3 50.01 – 70 10
4 70.01 – 100 100

Tugasan yang dikenal pasti mempunyai pertindihan tugasan bagi mana-mana kumpulan pertindihan
di atas tidak dibenarkan untuk rayuan. Bagi pelajar dalam kategori pertindihan tugasan kumpulan
70.01-100, akses online rayuan semakan semula tugasan bagi subjek berkaitan dilupuskan dari
pilihan rayuan. / Assignments found to have similarities under any of the categories above; will not
be entitled to apply for appeal. For learners who fall into the 70.01-100 similarities group, the access
for online appeal for assignment remarking of the subject will be disabled from the appeal options.
ASSIGNMENT QUESTION

PURPOSE
The purpose of this assignment is to write C programs in order to solve programming problems
using structures and writing applications in C programs employing the characteristics of linked list
data structure.

TUJUAN
Tujuan tugasan ini adalah untuk menulis aturcara C bagi menyelesaikan masalah pengaturcaraan
menggunakan struktur dan menulis aplikasi dalam aturcara C menggunakan ciri-ciri struktur data
senarai pautan.

REQUIREMENT / QUESTION 1
A software company has requested you to implement a Computer Information System that will
keep up to a maximum of 50 Computer data. The computer’s information to be kept is:
 ComputerID – int
 ComputerName – 50 characters
 ProcessorSpeed – integer
 RAM - Integer
 OperatingSystem – 50 characters
 Price - float

You are requested to test the Computer Information System by writing a C program that will be
able to do the following tasks:

a) Declare the Computer structure and the Computers array, using the information given
above.
b) Insert 5 new computers using a sequential ComputerID
c) Search for a particular computer by ComputerID
d) Search for a particular computer by ComputerName
e) Display a list of all computers

(30)
The assessment will be done based on the following criteria:

i. A proper writing of C codes and its structure


ii. The ability of program to be compiled and executed

iii. Implementation of correct programming techniques


iv. Complete documentation and correct submission

The documentation must include a short introduction to the problem given, the program codes,
and several output screens (screenshots). You must submit the documentation file and the .c (or
.cpp) program file. Note: You must write C programming codes for this assignment.

Suatu syarikat perisian telah meminta anda mengimplementasikan Sistem Maklumat Komputer yang
akan menyimpan sehingga maksimum 50 data Komputer. Maklumat komputer yang disimpan ialah:

 IDKomputer – int
 NamaKomputer – 50 aksara
 KelajuanProsesor – int
 RAM – int
 SistemPengoperasian – 50 aksara
 Harga - float

Anda diminta untuk menguji Sistem Maklumat Komputer dengan menulis aturcara C yang boleh
melakukan tugas-tugas berikut:

a) Isytiharkan struktur Komputer dan tatasusunan Komputers, mengunakan maklumat yang


diberikan di atas.
b) Masukkan 5 komputer baru menggunakan KomputerID yang berturutan.
c) Mencari suatu komputer menggunakan ID Komputer.
d) Mencari suatu komputer menggunakan Nama Komputer.
e) Memaparkan senarai semua komputer.

Penilaian akan dilakukan berdasarkan kepada kriteria berikut:

i. Penulisan kod C dan strukturnya yang betul


ii. Kebolehan aturcara dikompil dan dilaksanakan

iii. Pelaksanaan teknik-teknik pengaturcaraan yang betul

iv. Dokumentasi lengkap dan penghantaran yang betul

Dokumentasi mesti termasuk pengenalan ringkas kepada masalah yang diberikan, kod aturcara, dan
beberapa skrin output (screenshot). Anda mesti menghantar fail dokumentasi serta fail aturcara .c
(atau .cpp) . Nota: Anda mesti menulis kod pengaturcaraan C bagi tugasan ini.
QUESTION 2

REQUIREMENT / ASSIGNMENT QUESTION


Arrays are not practical for modification or inserting or deleting data. This weakness can be
overcome by using linked lists. Linked lists are collections of data items in a row – insertions and
deletions are made anywhere in a linked list. Linked lists consists of sequential items known as
nodes. Each node is made up of two parts: data, the elements in the list, and link, the link to the
next node in the list.

The linked list data structure can be defined as follows:

typedef int ELEMENT;


typedef struct node;
{
ELEMENT data;
struct node *next;
} NODE;

An illustration of the linked list declared:

1 3 5 7 8

Linked NULL
List

In linked lists, there are several basic operations that can be performed:
i) Create an empty linked list
ii) Create a new node
iii) Test whether a linked list is empty or not
iv) Traverse a linked list
v) Insert new nodes
vi) Delete nodes from linked list
Examples of Insertion and Deletion operations are given:
The original linked list

1 3 5 7 8

Linked NULL
List

The linked list after inserting element 10, in between element 5 and 7

1 3 5 10 7 8
0 0
NULL
Linked
List

The linked list after deleting element 5

1 3 7 8

Linked NULL
List

Write a C program that will be able to do the 6 basic linked list operations.
(30)
The assessment will be done based on the following criteria:

i. A proper writing of C codes and its structure


ii. The ability of program to be compiled and executed

iii. Implementation of correct programming techniques

iv. Complete documentation and correct submission

The documentation must include a short introduction to the problem given, the program codes,
and output screens (screen shots). You must submit the documentation file and the .c (or .cpp)
program file. Note: You must write C programming codes for this assignment.
Tatasusunan adalah tidak praktikal untuk pengubahsuaian atau penyisipan atau penghapusan data.
Kelemahan ini boleh diatasi dengan menggunakan senarai terpaut. Senarai terpaut adalah koleksi
item data dalam turutan - sisipan dan penghapusan boleh dibuat mana-mana sahaja dalam senarai
terpaut. Senarai terpaut terdiri daripada item berurutan dikenali sebagai nod. Setiap nod terdiri
daripada dua bahagian: data, elemen-elemen dalam senarai, dan pautan, pautan ke nod seterusnya
dalam senarai.

Struktur data senarai terpaut boleh ditakrifkan seperti berikut:

typedef int ELEMENT;


typedef struct node;
{
ELEMENT data;
struct node *next;
} NODE;

Illustrasi senarai terpaut yang diisytiharkan:

1 3 5 7 8

Senarai NOL
terpaut

Dalam senarai terpaut, terdapat beberapa operasi asas yang boleh dilakukan:
i) Bina senarai terpaut kosong
ii) Mewujudkan nod baru
iii) Uji sama ada senarai kosong atau tidak
iv) Menjelajahi senarai terpaut
v) Penyisipan nod baru
vi) Penghapusan nod daripada senarai terpaut
Contoh operasi penyisipan dan penghapusan diberikan:
Senarai terpaut asal

1 3 5 7 8

Senarai NOL
terpaut

Senarai terpaut selepas penyisipan elemen 10, antara elemen 5 dan 7

1 3 5 10 7 8
0 0
Senarai NOL
terpaut

Senarai terpaut selepas penghapusan elemen 5

1 3 7 8
Senarai NOL
terpaut

Tulis aturcara C yang dapat melakukan 6 operasi asas senarai terpaut.

Penilaian akan dilakukan berdasarkan kepada kriteria berikut:


i. Penulisan kod C dan strukturnya yang betul
ii. Kebolehan aturcara dikompil dan dilaksanakan
iii. Pelaksanaan teknik-teknik pengaturcaraan yang betul
iv. Dokumentasi lengkap dan penghantaran yang betul

Dokumentasi mesti termasuk pengenalan ringkas kepada masalah yang diberikan, kod program, dan
skrin output (screenshot). Anda mesti menghantar fail dokumentasi serta fail aturacara .c(atau .cpp).
Nota: Anda mesti menulis kod pengaturcaraan C bagi tugasan ini.
[Total/Jumlah : 60 marks/markah]

MUKA SURAT TAMAT / END OF PAGE


ATTACHMENT
ASSIGNMENT RUBRICS
CBDS 2103 DATA STRUCTURE / MAY 2018

QUESTION 1

Unsatisfactory/ Tidak
memuaskan
Excellent/ Cemerlang Good/Baik Fair/Sederhana Poor/Lemah Or/atau
Weightage/ Max
Criteria/Kriteria No response/ Tiada
Pemberat Marks
respons
4 3 2 1 0
Program Completion for Task The task was Most of the task was Moderate Implemented only a No implementation of
a)Declaration of structure and array implemented implemented implementation of the small chunk of this the tasks
with the given information successfully correctly task correctly task
b)Inserting 5 data
c) Searching for a particular computer
using Computer ID
d)Searching for a particular computer
using Computer Name
e)Displaying all the information in
the array.
2.5 10
Kesempurnaan Aturcara BAGI Tugas Arahan dilaksanakan Kebanyakan arahan Perlaksanaan arahan Hanya sebahagian kecil Tiada perlaksanaan
a) Deklarasi struktur dan tatasusunan dengan cemerlang dilaksanakan dengan yang sederhana secara arahan dilaksanakan arahan
dengan maklumat yang diberi. betul betul
b) Memasukkan 5 data
c) Mencari suatu komputer
menggunakan ID Komputer
d) Mencari suatu Komputer
menggunakan Nama Komputer
e) Memaparkan semua data dalam
tatasusunan.
Coding Standards Codes written were Codes were Codes were organised Codes were not well Wrong coding
very well structured organised properly in moderate manner organised
and creatively
organised
Piawaian Kod
1.5 6
Kod ditulis dengan Kod disusun dengan Kod disusun dengan Kod tidak disusun Pengekodan yang
sangat berstruktur baik cara sederhana dengan sempurna salah
dan disusun dengan
kreatif

Runtime  The program was  The program was  The program was  The program was The program could
executed with all executed mostly executed but not executed due not be executed at all
the correct with the correct mostly with to errors
output output incorrect output  OR the program
 AND the program  OR the program was executed with
was executed by was executed with the correct output
fulfilling all the the correct output but the written
requirements as but the written coding did not fulfil
stated in the coding did not fulfil all the question’s
question few of the requirements
question’s
requirements
1.5 6
Masa Larian  Aturcara ini Aturcara ini  Aturcara ini  Aturcara ini tidak Aturcara tidak dapat
dilaksanakan dilaksanakan dengan dilaksanakan tetapi dilaksanakan dilaksanakan langsung
dengan semua kebanyakan output kebanyakan output disebabkan ralat
output yang betul yang betul adalah salah  ATAU aturcara ini
 DAN aturcara ini dilaksanakan
dilaksanakan  ATAU aturcara ini dengan output yang
dengan dilaksanakan betul tetapi kod
memenuhi semua dengan output yang ditulis tidak
keperluan yang betul tetapi kodnya memenuhi
dinyatakan dalam ditulis tanpa keperluan soalan
soalan memenuhi
beberapa keperluan
soalan
Efficiency Solution is efficient, Solution is efficient A logical solution that A difficult and Wrong solution
understandable and and easy to follow is easy to follow but it inefficient solution
easy to maintain is not the most
efficient

Efisiensi Penyelesaian adalah Penyelesaian adalah Penyelesaian logikal Penyelesaian yang Penyelesaian yang
1.0 4
berkesan, boleh berkesan dan senang yang senang diikuti sukar dan tidak salah
difahami dan senang diikuti tetapi ianya bukanlah berkesan
diselenggara penyelesaian paling
berkesan

Requirement of Documentation Excellent Good documentation Brief documentation Incomplete No documentation &
(Source Code files & Document file. documentation and together with source with source code file documentation & source code file
Document file has problem complete with code file without source code
statement, copy of codes, source code file file
screenshots of the program output
and program comments)
1.0 4
Dokumentasi yang
Keperluan Dokumentasi Dokumentasi yang memuaskan bersama Dokumentasi yang Dokumentasi yang Tiada dokumentasi
(fail sumber & fail dokumen. Fail cemerlang dan dengan fail kod ringkas bersama tidak lengkap dan dan fail kod sumber
dokumen mengandungi pernyata lengkap dengan fail sumber dengan fail kod tanpa fail kod sumber
masalah, salinan kod, imbasan skrin kod sumber sumber
output aturcara dan komen aturcara)
TOTAL 7.5 30
QUESTION 2

Unsatisfactory/ Tidak
memuaskan
Excellent/ Cemerlang Good/Baik Fair/Sederhana Poor/Lemah Or/atau
Weightage/ Max
Criteria/Kriteria No response/ Tiada
Pemberat Marks
respons
4 3 2 1 0
Program Completion for Task The task was Most of the task was Moderate Implemented only a No implementation of
Basic Linked List Operations: implemented implemented implementation of the small chunk of this the tasks
i) Create empty linked list successfully correctly task correctly task
ii) Create a new node
iii) Test whether list is empty or not
iv) Traverse linked list
v) Insert new nodes
vi) Delete node from linked list
Arahan dilaksanakan Kebanyakan arahan Perlaksanaan arahan Hanya sebahagian kecil Tiada perlaksanaan
Kesempurnaan Aturcara BAGI Tugas dengan cemerlang dilaksanakan dengan yang sederhana secara arahan dilaksanakan arahan
3.0 12
Operasi asas senarai terpaut betul betul
i) Bina senarai terpaut kosong
ii) Mewujudkan nod baru
iii) Uji sama ada senarai kosong atau
tidak
iv) Menjelajahi senarai terpaut
v) Penyisipan nod baru
vi) Penghapusan nod dari senarai
terpaut

Coding Standards Codes written were Codes were Codes were organised Codes were not well Wrong coding
very well structured organised properly in moderate manner organised
and creatively
organised
1.5 6
Kod ditulis dengan Kod disusun dengan Kod disusun dengan Kod tidak disusun Pengekodan yang
Piawaian Kod sangat berstruktur baik cara sederhana dengan sempurna salah
dan disusun dengan
kreatif
Runtime  The program was  The program was  The program was  The program was The program could
executed with all executed mostly executed but not executed due not be executed at all
the correct with the correct mostly with to errors
output output incorrect output  OR the program
 AND the program  OR the program was executed with
was executed by was executed with the correct output
fulfilling all the the correct output but the written
requirements as but the written coding did not fulfil
stated in the coding did not fulfil all the question’s
question few of the requirements
question’s
requirements
1.0 8
Masa Larian  Aturcara ini Aturcara ini  Aturcara ini  Aturcara ini tidak Aturcara tidak dapat
dilaksanakan dilaksanakan dengan dilaksanakan tetapi dilaksanakan dilaksanakan langsung
dengan semua kebanyakan output kebanyakan output disebabkan ralat
output yang betul yang betul adalah salah  ATAU aturcara ini
 DAN aturcara ini dilaksanakan
dilaksanakan  ATAU aturcara ini dengan output yang
dengan dilaksanakan betul tetapi kod
memenuhi semua dengan output yang ditulis tidak
keperluan yang betul tetapi kodnya memenuhi
dinyatakan dalam ditulis tanpa keperluan soalan
soalan memenuhi
beberapa keperluan
soalan
Efficiency Solution is efficient, Solution is efficient A logical solution that A difficult and Wrong solution
understandable and and easy to follow is easy to follow but it inefficient solution
easy to maintain is not the most
efficient

Efisiensi Penyelesaian adalah Penyelesaian adalah Penyelesaian logikal Penyelesaian yang Penyelesaian yang
1.0 4
berkesan, boleh berkesan dan senang yang senang diikuti sukar dan tidak salah
difahami dan senang diikuti tetapi ianya bukanlah berkesan
diselenggara penyelesaian paling
berkesan
Requirement of Documentation Excellent Good documentation Brief documentation Incomplete No documentation &
(Source Code files & Document file. documentation and together with source with source code file documentation & source code file
Document file has problem complete with code file without source code
statement, copy of codes, source code file file
screenshots of the program output
and program comments)
1.0 4
Dokumentasi yang
Keperluan Dokumentasi Dokumentasi yang memuaskan bersama Dokumentasi yang Dokumentasi yang Tiada dokumentasi
(fail sumber & fail dokumen. Fail cemerlang dan dengan fail kod ringkas bersama tidak lengkap dan dan fail kod sumber
dokumen mengandungi pernyata lengkap dengan fail sumber dengan fail kod tanpa fail kod sumber
masalah, salinan kod, imbasan skrin kod sumber sumber
output aturcara dan komen aturcara)
TOTAL 7.5 30

You might also like