Jumat, 14 Desember 2018

File Processing

File is a collection of record 
• Record is a collection of field
• Field is a block of byte
-      • Byte is collection of bit

TEXT FILE is saved in a text format or ASCII File.
The syntax is : 
File *fp = fopen ("file_name","value");
Fp is a saving place for file ( it's function is similar with scanf in stdio.h library)

Fopen is use to open file, if some errors occured it will return to 0.

Possible mode value that often used:
r”  opening a file to be read.
  “w”  creating a file to be written.
  “a”  opening a File for data append.
  “r+”  opening a File for read/write.
  “w+”  creating file for read/write.
  “a+”  opening a File for read/append
  “rb”    opening a File (binary) to be read.
  “wb”  creating a file (binary) for write operation

Before using the data, file should be opened using fopen(fp).
After using the data, file should be closed using fclose(fp).

Syntax to input file:
1. fgets
2. fscanf
3. fread

Syntax to output file:
1. fwrite
2. fputs
3. fprintf

Selasa, 04 Desember 2018

Cloud Computing

Cloud computing is combination of the usage of 'computation' and 'cloud'. Cloud computing is the process of making computation work structure with LAN network and globally (by internet) where it can be saved, accessed, edited by numerous people at the same time. 

Cloud is a metaphor from internet, like the cloud that we usually see, cloud is sometimes pictured as computer system. In cloud computing, cloud is a service that can be easily accessed through the internet, so user can access it without even knowing what inside that cloud.

Benefits of cloud computing
1. It can easily stored information and data in no time.
2. Everyone that allowed can easily access it too so it is suitable for long distance meeting.
3. Eliminates the capital expenses of buying hardware.
4. No limit in processor, harddisk, and memory capacity.
5. No limit in number of servers running in the background.

Types of cloud computing

  • Private cloud (used exclusively by a single business or organization ). A private cloud can be physically located on the company’s database. Some companies also pay third-party service providers to host their private cloud. A private cloud is maintained in a private network.
  • Public cloud ( owned and operated by a third-party cloud service providers ) delivers their computing resources like servers and storage over the internet. Using public cloud, all hardwares, softwares and other supporting data are owned and managed by the cloud provider. Accessing these services require a web browser. Example : Microsoft Azure.
  • Hybrid cloud ( combination of public and private clouds ) bound together by technology that allows data and applications to be shared between them. By allowing data and applications to move between private and public clouds, a hybrid cloud have greater flexibility, more deployment options and helps optimize existing infrastructure, security and compliance.
  • Community cloud ( share infrastructure between several organizations from a specific community with common concerns (security, compliance, jurisdiction, etc.)) managed internally or by a third-party, and either hosted internally or externally. The costs are spread over fewer users than a public cloud (but more than a private cloud), so only some of the cost savings potential of cloud computing are realized.
source: https://www.esds.co.in/

Selasa, 23 Oktober 2018

Pointers & Arrays

POINTER
Pointer adalah suatu variabel yang menunjuk ke alamat memory variabel yang lainnya. Suatu pointer bukan berisi dengan suatu nilai data seperti pada variabel biasa, variabel pointer berisi dengan alamat. Untuk mendeklarasikan variabel pointer kita menggunakan tanda asterik (*) didepan variabel yang di deklarasikan pada tipe data tertentu. Tanda ini juga dapat dipakai untuk mengakses nilai dari variabel yang telah ditunjuk. Untuk mendapatkan alamat dari variabel pointer kita menggunakan tanda ‘&’.

contoh pengunaan pointer:

#include <stdio.h>

main(){
    int *pointer;
    int i;
    i=7;
    printf("Input variabel i = %d", i);
    printf("\nAlamat variabel i = %d", &i);
    printf("\nAlamat variabel *pointer = %d", &pointer);
    printf("\nIsi variabel *pointer = %d", pointer);
    pointer = &i;
    printf("\nAlamat variabel *pointer = %d", &pointer);
    printf("\nIsi variabel *pointer = %d", pointer);
    printf("\nIsi dari alamat %d = %d",pointer, *pointer);
    printf("\n");
}



Array
Array adalah kumpulan dari nilai-nilai data bertipe sama dalam urutan tertentu yang menggunakan sebuah nama yang sama. Nilai-nilai data disebuah array disebut dengan elemen-elemen array. Letak urutan dari elemen-elemen array di tunjukkan oleh suatu subscript atau indeks.
Ada 2 jenis array : 1. Array berdimensi 1

Contoh :

#include <stdio.h>

int main(){
  int array[5] = {1,2,3,4,5};
//indeks awal 0 dan indeks akhir 4
  printf("%d\n", array[3]);
}

                         2. Array berdimensi 2
Contoh :
#include <stdio.h>
int main()
{
 int array[2][5] = { 1, 2, 3, 4, 5,
                     6, 7, 8, 9, 10 };
 int i, j;
 for (i=0; i<3; i++)
{
     for (j=0; j<5; j++) printf("%6d", array[i][j]);
     printf("\n");
}
return 0; 
}

Kamis, 11 Oktober 2018

Program Control: Repetition




Repetition memiliki 3 operation :  

1.     For

2.     While

3.     Do-while





"For"
Fungsi pengulangan ini digunakan jika mengetahui berapa kali sesuatu operasi mau diulang (loop), dan akan berjalan jika syarat terpenuhi. Ada 3 tahap dalam ‘For’, tahap pertama initialization, di tahap ini integer yang digunakan diberi nilai awal, tahap kedua conditional, di tahap ini integer yang sebelumnya sudah diberi nilai dicheck, jika memasuki syarat maka operasi akan diulang, terakhir adalah tahap ketiga, increment or decrement, penambahan atau pengurangan nilai integer, setiap operasi di ulang, integer yang dipakai di ‘For’ akan berubah value bergantung dari increment(penambahan) atau decrement(pengurangan)

"Do-while"
Fungsi pengulangan ini digunakan untuk menjalankan suatu operasi lalu diuji apakah kondisi sudah bernilai benar, operasi tidak akan berjalan jika kondisi di ‘while’ salah.

"While"
Fungsi pengulangan banyak digunakan untuk data yang berstruktur. Pengulangan ini banyak digunakan jika jumlah perulangannya belum diketahui. Berbeda dengan ‘For’ yang digunakan saat jumlah pengulangan sudah cenderung diketahui, ‘While’ digunakan saat pengulangan belum jelas akan diulang berapa kali.




Mungkin masih banyak yang mempertanyakan perbedaan dari while dan do-while karena nama nya yang sangat mirip, sebenarnya ada perbedaan yang sangat jelas pada kedua operator repetisi ini: 
Perbedaan terletak pada proses memeriksa kondisi suatu pernyataan dimana untuk while akan langsung menjalankan operasi tetapi jika kondisi salah, repetisi dengan ini pasti akan berjalan sekali, sedangkan do-while harus memeriksa kondisinya terlebih dahulu baru menjalankan operasi tetapi operasi pasti berjalan sekali kalau kondisi di bagian while tidak terpenuhi



Nama : Jessica Andrian
NIM   : 2201757982