Tuesday, November 24, 2015

pengenalan dan penggunaan for pada C

Pengenalan dan Penggunaan For pada Bahasa C



     Membahas tentang FOR maka itu akan berkaitan dengan perulangan. Proses yang digunakan untuk melakukan sekumpulan pernyataan yang sama dan dilakukan berulang-ulang sampai kondisi tertentu tercapai.


Pernyataan For
Pernyataan While
Pernyataan Do-While

   Bentuk umum cara penulisan for adalah sebagai berikut :

For(inisialisasi; syarat perulangan; perubah nilai)


Pernyataan;

contohnya : 
       for(x=1;x<=100;x++)

 keterangan :

x=1               adalah sebagai inisialisasi atau harga awal
x<=100       adalah sebagai syarat perulangan atau batas dari perulangan
x++              adalah sebagai perubah nilai atau barapa penambah dan pengurangnya nantinya

     Kita masuk kedalam contoh :
buatlah sebuah program dengan menggunakan for untuk menulis kalimat " latihan for ke "angka". "angka" diganti menjadi nomor 1 - 15.

     codingnya sebagai berikut : 

main()
{
    int tangga;
    for (tangga=1;tangga<=20;tangga++)
    {
        printf ("latifan for ke %d \n", tangga);
    }
    getch();

}

Hasilnya sebagai berikut : 


Jika ada yang kurang jelas silahkan comment dibawah. Terima Kasih atas kunjungannya.





Friday, November 20, 2015

Answer CCNA 1 Chapter 1 Exam (v5.1)

CCNA 1 Chapter 1 Exam (v5.1)


1.   What two criteria are used to help select a network medium from various network media? (Choose two.)
• the types of data that need to be prioritized
• the cost of the end devices utilized in the network
• the distance the selected medium can successfully carry a signal
• the number of intermediary devices installed in the network
• the environment where the selected medium is to be installed

2.  What are two functions of end devices on a network? (Choose two.)
• They originate the data that flows through the network.
• They direct data over alternate paths in the event of link failures.
• They filter the flow of data to enhance security.
• They are the interface between humans and the communication network.
• They provide the channel over which the network message travels.

3.   What type of network must a home user access in order to do online shopping?
• an intranet
• the Internet
• an extranet
• a local area network

4.   Which two connection options provide an always-on, high-bandwidth Internet connection to computers in a home office? (Choose two.)
• cellular
• DSL
• satellite
• cable
• dial-up telephone

5.   Which term describes the state of a network when the demand on the network resources exceeds the available capacity?
• convergence
• congestion
• optimization
• synchronization

6.   Which expression accurately defines the term bandwidth?
• a method of limiting the impact of a hardware or software failure on the network
• a measure of the data carrying capacity of the media
• a state where the demand on the network resources exceeds the available capacity
• a set of techniques to manage the utilization of network resources

7.   Which statement describes a characteristic of cloud computing?
• A business can connect directly to the Internet without the use of an ISP.
• Applications can be accessed over the Internet by individual users or businesses using any                   device, anywhere in the world.
• Devices can connect to the Internet through existing electrical wiring.
• Investment in new infrastructure is required in order to access the cloud.

8.   What security violation would cause the most amount of damage to the life of a home user?
• denial of service to your email server
• replication of worms and viruses in your computer
• capturing of personal data that leads to identity theft
• spyware that leads to spam emails

9.   Fill in the blank
      A           converged         network is capable of delivering voice, video, text, and graphics over             the same communication channels.

10.   Match the description to the form of network communication. (Not all options are used.)
           Question


             Answer


11.  Match the definition to the security goal. (Not all options are used.)

          Question 

          Answer


12.   Which device performs the function of determining the path that messages should take through internetworks?
• a router
• a firewall
• a web server
• a DSL modem

13.   Which two statements describe intermediary devices? (Choose two.)
• Intermediary devices generate data content.
• Intermediary devices alter data content.
• Intermediary devices direct the path of the data.
• Intermediary devices connect individual hosts to the network.
• Intermediary devices initiate the encapsulation process.

14. Which area of the network would a college IT staff most likely have to redesign as a direct result of many students bringing their own tablets and smartphones to school to access school resources?
• extranet
• intranet
• wired LAN
• wireless LAN
• wireless WAN

15. An employee at a branch office is creating a quote for a customer. In order to do this, the employee needs to access confidential pricing information from internal servers at the Head Office. What type of network would the employee access?
• an intranet
• the Internet
• an extranet
• a local area network

16. Which two Internet connection options do not require that physical cables be run to the building? (Choose two.)
• DSL
• cellular
• satellite
• dialup

17. What type of network traffic requires QoS?
• email
• on-line purchasing
• video conferencing
• wiki


18. A network administrator is implementing a policy that requires strong, complex passwords. Which data protection goal does this policy support?
• data integrity
• data quality
• data confidentiality
• data redundancy

19. Which statement describes the use of powerline networking technology?
• New “smart” electrical cabling is used to extend an existing home LAN.
• A home LAN is installed without the use of physical cabling.
• A device connects to an existing home LAN using an adapter and an existing electrical outlet.
• Wireless access points use powerline adapters to distribute data through the home LAN.


20. A user is implementing security on a small office network. Which two actions would provide the minimum security requirements for this network? (Choose two.)
• implementing a firewall
• installing a wireless network
• installing antivirus software
• implementing an intrusion detection system
• adding a dedicated intrusion prevention device

21.. Fill in the blank.
The acronym      byod       refers to the policy that allows employees to use their personal devices in the business office to access the network and other resources.

22. Match each characteristic to its corresponding Internet connectivity type. (Not all options are used.)

          Question

         Answer

23. A company is contemplating whether to use a client/server or a peer-to-peer network. What are three characteristics of a peer-to-peer network? (Choose three.)
• better security
• easy to create
• better device performance when acting as both client and server
• lacks centralized administration
• less cost to implement
• scalable





Thursday, November 19, 2015

Program Nested IF

PROGRAM MENENTUKAN PANGGILAN SESEORANG DENGAN NESTED IF


        Pada program ini kita akan membahas tentang program menentukan panggilan seseorang dengan nested if dengan menginputkan jenis kelamin dan umur. 
        Berikut flowchartnya 
       Dari flowchart diatas, dapat dibuat coding sebagai berikut 
main ()
{
    char jenis_kelamin[2];
    int umur;
    printf ("masukkan jenis kelamin anda (f/m) : ");
    scanf ("%s", &jenis_kelamin);
    printf ("masukkan umur anda : ");
    scanf ("%d", &umur);
    if (strcmp(jenis_kelamin,"f")==0)
    {
        if (umur<16)
        {
            printf ("Panggil dengan awalan Miss");
        }
        else
        {
            printf ("Panggil dengan awalan Ms");
        }
    }
    else if(strcmp(jenis_kelamin,"m")==0)
    {
        if (umur<16)
        {
            printf ("Panggil dengan awalan Master");
        }
        else
        {
            printf ("Panggil dengan awalan Mr");
        }
    }
    getch();
}

       Hasilnya 


Monday, November 16, 2015

Konversi Suhu dengan bahasa c

Membuat Program Mengkonversi Suhu dengan Menggunakan Bahasa C


         Suhu atau biasa disebut juga dengan temperatur merupakan derajat panas atau dingin dari suatu benda. Ada beberapa skala satuan suhu, misalnya Celcius (C), Reamur (R), Fahrenheit (F), dan Kelvin (K).

         Kali ini saya akan membuat program dengan menggunakan bahasa c tentang mengkonversi, berikut coding nya : 
main ()
{
    char inputandari[2], inputanke[2];
    float inputanangka;
    printf ("Selamat datang di program kami 'mengkonversi suhu'");
    printf ("\nSilahkan masukkan nilainya suhunya ");
    scanf ("%f", &inputanangka);
    printf ("Anda ingin ingin mengkonversi dari (R/F/K/C) ");
    scanf ("%s", &inputandari);
    printf ("Anda ingin ingin mengkonversi ke (R/F/K/C) ");
    scanf ("%s", &inputanke);
    if (strcmp(inputandari,"R")==0)
    {
        if (strcmp(inputanke,"R")==0)
        {
            float hasil = inputanangka;
            printf ("%.2f R", hasil);
        }
        else if (strcmp(inputanke,"C")==0)
        {
            float hasil = 4.00/5.00*inputanangka;
            printf ("%.2f C", hasil);
        }
        else if (strcmp(inputanke,"F")==0)
        {
            float hasil = 4.00/5.00*(inputanangka-32);
            printf ("%.2f F", hasil);
        }
        else if (strcmp(inputanke,"K")==0)
        {
            float hasil = 4.00/5.00*(inputanangka-273);
            printf ("%.2f K", hasil);
        }
        else
        {
            printf ("maaf inputan yang anda masukkan salah");
        }
    }
    else if (strcmp(inputandari,"F")==0)
    {
        if (strcmp(inputanke,"F")==0)
        {
            float hasil = inputanangka;
            printf ("%.2f F", hasil);
        }
        else if (strcmp(inputanke,"C")==0)
        {
            float hasil = 9.00/5.00*inputanangka+32;
            printf ("%.2f C", hasil);
        }
        else if (strcmp(inputanke,"R")==0)
        {
            float hasil = 9.00/4.00*inputanangka+32;
            printf ("%.2f R", hasil);
        }
        else if (strcmp(inputanke,"K")==0)
        {
            float hasil = 9.00/5.00*(inputanangka-273)+32;
            printf ("%.2f K", hasil);
        }
        else
        {
            printf ("maaf inputan yang anda masukkan salah");
        }
    }
    else if (strcmp(inputandari,"K")==0)
    {
        if (strcmp(inputanke,"K")==0)
        {
            float hasil = inputanangka;
            printf ("%.2f K", hasil);
        }
        else if (strcmp(inputanke,"C")==0)
        {
            float hasil = inputanangka+273;
            printf ("%.2f C", hasil);
        }
        else if (strcmp(inputanke,"R")==0)
        {
            float hasil = 9.00/4.00*inputanangka+32;
            printf ("%.2f F", hasil);
        }
        else if (strcmp(inputanke,"K")==0)
        {
            float hasil = 9.00/5.00*(inputanangka-273)+32;
            printf ("%.2f K", hasil);
        }
        else
        {
            printf ("maaf inputan yang anda masukkan salah");
        }
    }
     else if (strcmp(inputandari,"C")==0)
    {
        if (strcmp(inputanke,"C")==0)
        {
            float hasil = inputanangka;
            printf ("%.2f C", hasil);
        }
        else if (strcmp(inputanke,"R")==0)
        {
            float hasil = 5.00/4.00*inputanangka;
            printf ("%.2f R", hasil);
        }
        else if (strcmp(inputanke,"F")==0)
        {
            float hasil = 5.00/9.00*(inputanangka-32);
            printf ("%.2f F", hasil);
        }
        else if (strcmp(inputanke,"K")==0)
        {
            float hasil = inputanangka-273;
            printf ("%.2f K", hasil);
        }
        else
        {
            printf ("maaf inputan yang anda masukkan salah");
        }
    }
    getch();
    system("cls");
    main ();
    getch();
}

           Hasilnya 


Sunday, November 15, 2015

Penggunaan Operator Aritmatika Pada Bahasa C

Penggunaan Operator Aritmatika Pada Bahasa C
 
       
        Bahasa C menyediakan beberapa operator aritmatika yaitu : 
             1.     *             Berfungsi sebagai perkalian
             2.     /              Berfungsi sebagaipembagian
             3.     +             Berfungsi sebagai penambahan
             4.     -              Berfungsi sebagai pengurangan
             5.    %             Berfungsi sebagai modulus (sisa pembagian)

             Contoh pengunaan operator aritmatika ini pada bahasa c 
main ()
{
    int a=20;
    int b=2;
    int c;
    printf ("Contoh Pengunaan operator aritmatika pada bahasa C");
    c=a*b;
    printf ("\n%d x %d = %d", a, b, c);
    c=a/b;
    printf ("\n%d / %d = %d", a, b, c);
    c=a+b;
    printf ("\n%d + %d = %d", a, b, c);
    c=a-b;
    printf ("\n%d - %d = %d", a, b, c);
    c=a%b;
    printf ("\n%d %% %d = %d", a, b, c);
    getch();
}

              Hasilnya 
  
 
             Contoh Kasus : Jika diketahui suatu fungsi 
  Jika x=1.5
      Penyelesaiannya :
 main ()
{
    float x=1.5;
    float y;

    y = 3*(x*x)+5*1.5-10;
    printf ("hasil dari fungsi diatas jika x=1.5 adalah\n %.2f", y);
    getch();
}

      Hasilnya



Pengunaan gets() dan scanf()

Fungsi Dan Penggunaan Gets() dan Scanf()
    gets()
           Fungsi ini adalah fungsi yang sempurna dalam penginputan string. Fungsi ini seperti menambal kekurangan dari scanf() ketika menginput string. Tentu saja, fungsi ini hanya bisa menginput string. Dengan fungsi ini kita bisa menambahkan spasi dalam string inputan juga
                Contoh penggunaan gets()
main ()
{
    char nama[20];
    char alamat[20];
    printf ("masukkan nama anda : ");
    gets(nama);
    printf ("masukkan alamat anda : ");
    gets(alamat);
    printf ("\nNama   : %s", nama);
    printf ("\nAlamat : %s", alamat);
    getch();
}

       Hasilnya

scanf()
             Fungsi ini dapat menginput berbagai macam jenis data. Penggunaanya mirip dengan printf(), yaitu harus menggunakan conversion specifier. Seperti halnya printf, conversion specifier harus disesuaikan dengan jenis data yang ada pada arguments.
             Contoh penggunaan  scanf()

main ()
{
    char nama[20];
    char alamat[20];
    printf ("masukkan nama anda : ");
    scanf("%s", &nama);
    printf ("masukkan alamat anda : ");
    scanf("%s", &alamat);
    printf ("\nNama   : %s", nama);
    printf ("\nAlamat : %s", alamat);
    getch();
}
          
           Hasilnya

        
resep donat empuk ala dunkin donut resep kue cubit coklat enak dan sederhana resep donat kentang empuk lembut dan enak resep es krim goreng coklat kriuk mudah dan sederhana resep es krim coklat lembut resep bolu karamel panggang sarang semut