Cbds 2103
Cbds 2103
_________________________________________________________________________
CBDS2103
DATA STRUCTURES
STRUKTUR DATA
JANUARY 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
Question 1
You are required to write a C program that will input the number of students and reserve
the memory space dynamically. You need to store the student’s name, ID and Culmulative
Grade Point Average (CGPA) together as one unit. In order to do this, you must use a
structure data type.
Next, you must declare ptr as a pointer of struct student * type (that can point to
the location of struct student type) as shown below:
struct student *ptr;
Then, use a linked list data structure to store the student information in nodes and link
them. You can use the operator -> to access the data in the structure through ptr.
Finally, your program should count and display the average cgpa entered for the n
students. The linked list must be sorted by students’ name in ascending order before it is
displayed to the user. The sample output is shown below:
The assessment will be done based on the following criteria:
i. A proper writing of C codes: structure, efficiency and modular.
ii. The readability, consistency, naming and user interface
iii. Robustness and testing
iv. Complete documentation and correct submission.
Note: You MUST write C programming codes for this assignment. Codes written in C++ will
not be accepted.
(50 marks)
Soalan 1
Anda dikehendaki menulis aturcara C yang akan input bilangan pelajar dan akan merizab
ruang memori secara dinamik. Anda perlu menyimpan nama, ID dan Purata Nilai Gred
Kumulatif (CGPA)pelajar sebagai satu unit. Bagi tujuan ini, anda perlu menggunakan jenis
data struktur.
Selepas itu, anda perlu mengisytihar ptr sebagai penunding bagi struct student * type
(yang akan menunding kepada lokasi struct student type) seperti yang ditunjukkan di
bawah:
struct student *ptr;
Kemudian, gunakan struktur senarai terpaut untuk menyimpan maklumat pelajar dalam nod
dan pautannya. Anda boleh menggunakan operator -> untuk mengekses struktur menerusi
ptr.
Akhir sekali, aturcara anda perlu mengira dan memaparkan purata cgpa yang dimasukkan
bagi n bilangan pelajar. Senarai terpaut tersebut mestilah terisih mengikuti nama pelajar
dalam turutan menaik sebelum ianya dipaparkan kepada pengguna. Contoh output
ditunjukkan seperti di bawah:
Penilaian akan dilakukan berdasarkan kepada kriteria berikut:
i. Penulisan kod C yang betul: struktur, kecekapan dan modular
ii. Kebolehbacaan, ketekalan, penamaan dan antara muka pengguna
iii. Kekukuhan dan ujian
iv. Dokumentasi lengkap dan penghantaran yang betul.
Nota: Anda MESTI menulis kod pengaturcaraan C bagi tugasan ini. Kod yang ditulis dalam C+
+ tidak akan diterima.
Instructions:
Join a discussion group in the forum and discuss the topic given below.
There will be a platform for group discussions readily available for you in the forum
in myINSPIRE.
You may select any group to work with.
Follow the instructions for submitting proof of online class participation.
Arahan:
Sertai kumpulan perbincangan dalam forum dan bincangkan topik yang diberikan di
bawah.
Terdapat platform untuk perbincangan kumpulan yang tersedia untuk anda di dalam
forum di myINSPIRE.
Anda boleh memilih mana-mana kumpulan untuk bekerjasama.
Ikut arahan untuk menyerahkan bukti penyertaan kelas dalam talian.
Question 2
As a group select and discuss one of the following:
a. Share and discuss in general the use data structures such as arrays, structures,
linked lists, stack and queues in our day to day lives.
b. Share and discuss how you would apply these data structures in your work place.
(10 marks)
[Total: 60 Marks]
Soalan 2
Sebagai satu kumpulan pilih dan bincangkan salah satu daripada yang berikut:
a. Kongsi dan bincangkan secara umum penggunaan struktur data seperti tatasusunan,
struktur, senarai terpaut, timbunan dan baris gilir dalam kehidupan seharian kita.
b. Kongsi dan bincangkan cara anda menggunakan struktur data ini di tempat kerja
anda.
(10 markah)
[Jumlah: 60 Markah]
INSTRUCTIONS ON HOW TO SUBMIT PROOF OF ONLINE CLASS PARTICIPATION (10%)
Do the following:
1. Select the best FIVE (5) 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) . Refer to the
sample of Screen Grab below
4. The screenshots should contain: Name, Title of the discussion, Day, Date and Time.
1. Pilih LIMA (5) postings terbaik dari perbincangan dalam talian yang telah di sediakan oleh
tutor anda
2. Laksanakan screen shot posting dan isikan dalam tugasan anda sebagai file imej
3. Imej screen shot mesti dalam format imej (sama ada JPG atau PNG). Rujuk pada contoh
screenshot di bawah.
4. Screen shot mesti mengandungi: Nama, Tajuk Perbincangan, Hari, Tarikh dan Masa