Struktur Data Modul 2 – Review Struct

Dosen kami bilang yang pake bahasa inggris dapat nilai lebih, coba ah…
Our lecturers told me who use English language (for practical reports) can score more, lets try lah … :hammers

Laporan dibuat dalam 2 bahasa untuk berjaga jaga kalau kalau ada yang susah dipahami dalam bahasa inggris.
This report were made in 2 languages just in case there are things that are hard to understand in english.

Laporan Resmi dimulai disini.
The formal report starts here.

:hn

Percobaan pertama : Alokasi memori untuk struct.
First experiment : Memory allocation for struct.

Tujuan : Mahasiswa mengulang kembali penggunaan struct dalam bahasa C.
Purpose : Students repeat how to use struct in C language.

Penjelasan Kasus : Menampilkan data struct sesuai inputan.
Case description : Showing data inside struct corresponding to the input.

Hasil – Result :

a. Tampilan dalam bentuk tabel – results in table format

NRP Nama Nilai Test
12345 Rinaldo Jonathan Nilai test 1 : 99
Nilai test 2 : 98

b. Apa yang terjadi jika lebih dari 10 digit dimasukkan sebagai data nrp?
What happens if you input more than 10 digit in nrp?


nrp akan menampilkan nama setelah digit ke 10, namun tampilan nama tidak berubah.
nrp will show nama after 10th digit, but “nama” itself isn’t changed.

c. Ganti konstanta MAX menjadi 2 dan tampilkan semua alamat dari elemen struct.
Change MAX constants to 2 and show all the memory address from struct element.

Hasil – Results :

Notice : Kode program telah berubah menjadi yang di link dibawah ini
Program source code has been altered to this link :
Click here.

d. Apa kegunaan dari atoi(strjum)?
What is the use of atoi(strjum)?

Library fungsi C int atoi(const char *str) digunakan untuk mengubah string menjadi integer (type int).
The C library function int atoi(const char *str) converts the string argument str to an integer (type int).

atof hampir sama dengan atoi, hanya saja hasil akhirnya float.
atof is almost the same as atoi, but the results will be float instead of integer.

Source : Tutorials Point atoi atof

Pembahasan hasil praktikum 1 :
Discussion of the results of lab work 1 :

  1. #define MAX 10 berarti variabel nrp hanya bisa menampung 10 digit. Kalau saja kita ganti ke 15, program ini tidak akan error saat pembahasan soal kedua (namun saya malas) :hammers
    #define MAX 10 means nrp variable only able to store 10 digit of number. If we changed it to 15, that program won’t make error when we run it at the second experiment (but laziness strikes).
  2. Fungsi perintah atoi adalah mengubah string menjadi integer.
    atoi is used to convert string into integer.
  3. Fungsi perintah atof adalah mengubah string menjadi float.
    atof is used to convert string into float.

 

Percobaan kedua : Data produksi dengan struct
Second experiment : Production data with struct

Penjelasan Kasus : Melengkapi coding sehingga bisa melakukan proses input data produksi perusahaan.
Case description : Completing the program code to make the program able to receive and process input from your company.

Source Code

Hasil – Result :

Pembahasan hasil praktikum 2 :
Percobaan ini kita memodifikasi program agar dapat menerima dan memproses inputan dalam struct.
Discussion of the results of lab work 2 :
In this experiment, we modify program to make it able to accept and process input inside struct.

Percobaan ketiga: Pembuatan struct berisi daftar obat.
Third experiment : Creating struct filled with medicine information.

Source code :

Hasil – Result :

Pembahasan hasil praktikum 3 :
Percobaan ini kita membuat program yang dapat menerima dan memproses inputan dalam struct.
Discussion of the results of lab work 3 :
In this experiment, we made program that can accept and process input inside struct.

Trivia :
Saya memilih Spiramycin untuk contoh obatnya karena ketika saya mengerjakan ini, saya lagi flu dan radang tenggorokan berat, dan sejauh ini Spiramycin biasanya manjur.
I choose Spiramycin for the medicine example because I was working at this report, I have the flu and sore throat, and Spiramycin usually helps me.

Share Button

By Rinaldo Jonathan

Admin of this site. Artis papan PCB. #zoneRinaldo #Controllerism Studio Demon, Stage Angel, Sleepy Developer, Smoke free. Kalkud SHS 2012, PCR G15.

1 comment

Leave a Reply

Verified by ExactMetrics