Professional Documents
Culture Documents
___________________________________________________________________________
CBDS2103
DATA STRUCTURES
STRUKTUR DATA
SEPTEMBER 2022
6. This assignment accounts for 60% of the total marks for the course.
Tugasan ini menyumbang sebanyak 60% dari jumlah markah kursus.
ASSIGNMENT QUESTION
PURPOSE
The purpose of this assignment is to develop data structures using C language to solve a
given problem and demonstrate the implementation of appropriate data structure
features with suitable test data and output.
Tujuan tugasan ini adalah untuk membangunkan struktur data menggunakan bahasa C
untuk menyelesaikan masalah tertentu dan menunjukkan pelaksanaan ciri struktur data
yang sesuai dengan data dan output ujian yang sesuai.
PART I / BAHAGIAN I
REQUIREMENT/ASSIGNMENT QUESTION
There are four teams that are playing football for their respective schools. For each of the
teams, the information is to be inserted into the table 1 below.
There will be total of three games played, (as there are four teams, and each team will
play with another team once only).
i. You are given the task to create a program using C language, to input the
information for the columns Win, Draw, Lose, Goals and to calculate the Points.
You must use a two-dimensional (2-D) array for this question.
ii. There are some rules which must be followed for the input:
a) None of the columns of Win, Draw and Lose can have values more than 3 as
the number of games played is 3 (maximum)
b) The row Win, Draw and Lose must total to 3 for each Team.
c) The total for column Draw must be even value, as there must be two teams
that draw against each other.
d) The points are to be calculated based on this:
Wins equals to 3 points
Draw equals to 2 points
Lose equals to 0 points
So, if a team wins 2 games and loses one game, then the points obtained is 3 *
2 + 0 * 1 = 6 points.
iii. After this, the football scores are kept in a scores.dat file which must have the
team name, the number of wins, draws, losses, goals and points.
Note: You MUST write C programming codes for this assignment. Codes written in C++ will
not be accepted.
(50 marks)
Terdapat empat pasukan yang bermain bolasepak untuk sekolah mereka. Untuk setiap
pasukan, maklumat perlu di masukkan dalam jadual di bawah.
Terdapat tiga perlawanan yang akan dimainkan (kerana ada empat pasukan, dan setiap
pasukan akan bermain dengan pasukan lain sekali sahaja).
iii. Selepas ini, skor bolasepak disimpan dalam fail scores.dat yang mesti mempunyai
nama pasukan, bilangan kemenangan, seri, kalah, gol dan poin.
Nota: Anda MESTI menulis kod pengaturcaraan C bagi tugasan ini. Kod yang ditulis dalam C+
+ tidak akan diterima.
PART II / BAHAGIAN II
Discuss the following topic(s) in the forum and submit proof of your participation in the
online discussions:
Share and discuss in general the use data structures such as arrays, structures,
linked lists, stack and queues in our day to day lives.
Bincangkan topik berkenaan di dalam forum dan hantar bukti penglibatan forum dalam
perbincangan dalam talian.
Kongsi dan bincangkan secara umum penggunaan struktur data seperti tatasusunan,
struktur, senarai terpaut, timbunan dan baris gilir dalam kehidupan seharian kita.
(10 marks)
[Total/ Jumlah: 60 marks/ markah]
INSTRUCTIONS ON HOW TO SUBMIT PROOF OF ONLINE PARTICIPATION (10%)
Do the following:
1. Select the best FIVE (5) of your postings from the forum discussion set up by your tutor.
2. Do screenshots of the postings and include them as images in your assignment.
3. The screenshots should be in image file (either in JPG or PNG format).
4. The screenshots should contain: Name, Title of the discussion, Day, Date and Time.
1i 2 Pengisytiharan struktur, tatasusunan atau 2.0 Memenuhi keperluan Memenuhi Memenuhi keperluan Memenuhi Tidak memenuhi 8
struktur senarai terpaut kriteria. kebanyakan daripada kriteria secara asas/ keperluan kriteria kriteria langsung
Kod jelas, logic, struktur kawalan yang keperluan kriteria minimal. secara lemah. ATAU jawapan yang
digunakan dengan betul. tetapi ianya boleh salah telah
Struktur pengaturcaraan yang paling dimantapkan lagi. diberikan.
sesuai (pemilihan, pengulangan, fail)
digunakan.
Fungsi bersifat modular dan
meningkatkan kejelasan
pengaturcaraan
1i 2 2-D Array Manipulation: Insert Data and 2.0 Met the Mostly met the Basic/ minimally met Poorly met the Did not meet 8
writing to scores.dat requirements of the requirements of the the requirements of requirements of the criteria at all OR
2-DArray is used correctly. criteria. criteria but it can be the criteria. criteria. wrong answer was
Most appropriate programming improved further. given.
structures (selection, repetition, files)
are used
Functions are modular and increases
programming clarity
Writing to file scores.dat is done
correctly
Manipulasi tatasusunan 2-D: kemasukkan Memenuhi keperluan Memenuhi Memenuhi keperluan Memenuhi Tidak memenuhi
data dan menulis ke fail scores.dat kriteria. kebanyakan daripada kriteria secara asas/ keperluan kriteria kriteria langsung
Tatasusunan 2-D digunakan dengan keperluan kriteria minimal. secara lemah. ATAU jawapan yang
betul tetapi ianya boleh salah telah
Struktur pengaturcaraan yang paling dimantapkan lagi. diberikan.
sesuai (pemilihan, pengulangan, fail)
digunakan.
Fungsi bersifat modular dan
meningkatkan kejelasan
pengaturcaraan
Menulis kepada fail scores.dat dibuat
dengan betul
Rules a) to d) are followed Met the Mostly met the Basic/ minimally met Poorly met the Did not meet
Structure, Efficiency and Modular: requirements of the requirements of the the requirements of requirements of the criteria at all OR
Codes are clear, logical, control criteria. criteria but it can be the criteria. criteria. wrong answer was
structure used correctly. improved further. given.
Most appropriate programming
structures (selection, repetition, files)
are used
Functions are modular and increases
programming clarity
1i 2 Peraturan a) hingga d) diikuti 2.0 Memenuhi keperluan Memenuhi Memenuhi keperluan Memenuhi Tidak memenuhi 8
Struktur, Kecekapan dan Modular: kriteria. kebanyakan daripada kriteria secara asas/ keperluan kriteria kriteria langsung
Kod jelas, logic, struktur kawalan yang keperluan kriteria minimal. secara lemah. ATAU jawapan yang
digunakan dengan betul. tetapi ianya boleh salah telah
Struktur pengaturcaraan yang paling dimantapkan lagi. diberikan.
sesuai (pemilihan, pengulangan, fail)
digunakan.
Fungsi bersifat modular dan
meningkatkan kejelasan
pengaturcaraan
Readability, consistency, naming and user Met the Mostly met the Basic/ minimally met Poorly met the Did not meet
interface: requirements of the requirements of the the requirements of requirements of the criteria at all OR
Coding style, easy to read and criteria. criteria but it can be the criteria. criteria. wrong answer was
maintain. improved further. given.
Consistent and proper naming.
Screen based instruction and final
output are clear, correct and attractive.
1ii 2 2.0 8
Kebolehbacaan, ketekalan, penamaan dan Memenuhi keperluan Memenuhi Memenuhi Memenuhi Tidak memenuhi
antara muka pengguna: kriteria. kebanyakan daripada keperluan kriteria keperluan kriteria kriteria langsung
Gaya pengekodan, mudah dibaca dan keperluan kriteria secara asas/ minimal secara lemah. ATAU jawapan yang
diselenggara. tetapi ianya boleh salah telah
Penamaan yang konsisten dan tepat dimantapkan lagi. diberikan.
Arahan berdasarkan skrin dan output
akhir yang jelas, betul dan menarik
1iii 3 Robustness and Testing 3.0 Met the Mostly met the Basic/ minimally met Poorly met the Did not meet 12
Ability of the program to be compiled requirements of the requirements of the the requirements of requirements of the criteria at all OR
and executed criteria. criteria but it can be the criteria. criteria. wrong answer was
The program can handle erroneous or improved further. given.
unexpected input
Complete without being redundant,
all test cases are considered
Determination process based on the
input. Correct technique must be
chosen and shown in this part
Displaying all output as required
Kekukuhan dan Ujian: Memenuhi keperluan Memenuhi Memenuhi keperluan Memenuhi Tidak memenuhi
Keupayaan aturcara untuk dikompil kriteria. kebanyakan daripada kriteria secara asas/ keperluan kriteria kriteria langsung
dan dilaksanakan keperluan kriteria minimal. secara lemah. ATAU jawapan yang
Aturcara ini dapat menangani input tetapi ianya boleh salah telah
yang salah atau tidak dijangka dimantapkan lagi. diberikan.
Lengkap tanpa kelebihan, semua kes
ujian dipertimbangkan
Proses penentuan berdasarkan input.
Teknik yang betul mesti dipilih dan
ditunjukkan di bahagian ini
Menunjukkan semua output mengikut
keperluan
Complete documentation and correct Met the Mostly met the Basic/ minimally met Poorly met the Did not meet
submission: requirements of the requirements of the the requirements of requirements of the criteria at all OR
Cover page of assignment criteria. criteria but it can be the criteria. criteria. wrong answer was
Introduction, description of problem improved further. given.
Copy of codes
Several screenshots with various
input and output
Submission of C source file in
extension .c
Submission of “scores.dat” file.
1iv 3 1.5 6
Dokumentasi lengkap dan penghantaran Memenuhi keperluan Memenuhi Memenuhi keperluan Memenuhi Tidak memenuhi
yang betul: kriteria. kebanyakan daripada kriteria secara asas/ keperluan kriteria kriteria langsung
Muka hadapan tugasan keperluan kriteria minimal. secara lemah. ATAU jawapan yang
Pengenalan, penghuraian masalah tetapi ianya boleh salah telah
Salinan kod dimantapkan lagi. diberikan.
Beberapa cekupan skrin dengan
pelbagai input dan output
Penghantaran fail sumber C dalam
sambungan .c
Penghantaran fail “scores.dat”.
Total 12.5 50
*QN = Question Number / *NS = Nombor Soalan
PART II
ASSIGNMENT RUBRICS