Monday, October 31, 2022

TUGAS MATERI PERTEMUAN 7



 



Nama : Reza Hidayatulloh
Nim : 3420210019
Prodi : Teknik Informatika



Tugas1


#include <iostream.h>
#include <conio.h>
#include <stdio.h>


 //Nama : Reza Hidayatulloh
 //Nim  : 3420210019
 //Prodi: Teknik Informatika

void main()
{
int i;
   int a = 5;
   int b = 10;
   cout<<"-------------------------------\n";
   cout<<" No  A     B    A*A  B*B\n";
   cout<<"-------------------------------\n";
   for(i=1;i<=10;i++)
   {
    gotoxy(2,3+i);cout<<i;
      gotoxy(6,3+i);cout<<a;
      gotoxy(12,3+i);cout<<b;
      gotoxy(17,3+i);cout<<a*a;
      gotoxy(22,3+i);cout<<b*b;
      a=a+4;
      b=b+2;
      cout<<"\n";
   }
   cout<<"-------------------------------\n";
   getch();
}

Tugas2

#include <iostream.h>
#include <conio.h>
#include <stdio.h>


 //Nama : Reza Hidayatulloh
 //Nim  : 3420210019
 //Prodi: Teknik Informatika

void judul(){
   puts("====================================");
   puts("\tContoh Array Dimensi 1");
   puts("====================================");
   }

 void main()
 {
  judul();
   int i;
   float harga [5];
   harga[0]=1000;
   harga[1]=2000;
   harga[2]=3000;
   harga[3]=4000;
   harga[4]=5000;
   harga[5]=6000;
   printf("Variable harga 1 adalah %.0f\n",harga[1]);
   printf("Variable harga 3 adalah %.0f\n",harga[3]);
   for(i=1;i<=3;i++)
   {
    cout<<endl;
   }
   puts("Nilai dari Seluruh Variabel adalah:");
   for(i=0;i<5;i++)
   {
    printf("variabel harga %d adalah %.0f\n",i,harga[i]);
   }
   getch();
 }


Tugas3


#include <iostream.h>
#include <conio.h>
#include <stdio.h>


 //Nama : Reza Hidayatulloh
 //Nim  : 3420210019
 //Prodi: Teknik Informatika

void judul () {
    puts("========================================");
   puts(" Contoh Array Dimensi 2 ");
   puts("========================================");
}

void main() {
judul();
   int i;
   char hari[7][10]={"Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"};
   printf("Hari ke 4 adalah %s\n",hari[4]);
   printf("Hari ke 5 adalah %s\n",hari[5]);
   for(i=1;i<=5;i++) { cout<<endl; }
   puts("Nilai dari seluruh variable hari adalah:");
   for(i=0;i<7;i++) {
   printf("Variable hari %d adalah %s\n",i,hari[i]);
   }
   getch();
}

Friday, October 28, 2022

TUGAS MATERI PERTEMUAN 6

 

Nama : Reza Hidayatulloh

Nim   : 3420210019

Prodi: Teknik Informatika

tugas 1



/*---------------------------*/
/* Program for - bilangan naik */
/*---------------------------*/

#include <stdio.h>
#include <conio.h>
#include <iostream.h>

//Nama : Reza Hidayatulloh
//Nim    : 3420210019
//Prodi : Teknik Informatika

void main ()
{
int a;
   for (a=1;a<=10;a++)
   {
    cout<<"Ini Adalah Baris Ke - " <<a<<endl;
   }
   getch ();
   }

tugas 2


#include <iostream.h>

#include <conio.h>


//Nama : Reza hidaytulloh

//Nim  : 3420210019

//Prodi: Teknik Informatika


void main()

{

puts ("---------------------------");

puts ("   Program For Bersarang   ");

puts ("---------------------------");

int a,b;

   for (a=1;a<=4;a++) {

    for (b=2;b<=2;b++) {

    printf("Latihan Algoritma \n");

      cout<<endl;

      }

   }

   getch ();

}


tugas 3


#include <stdio.h>
#include <iostream.h>
#include <conio.h>

//Nama : Reza hidaytulloh
//Nim  : 3420210019
//Prodi: Teknik Informatika

void main()
{
int a,b;
   for (a=1;a<=5;a++)
   {
    printf ("\n");
for (b=a;b<=5;b++)
      {
      printf ("%d",a);
      }
   }
   getch ();
}

tugas 4


#include <stdio.h>
#include <iostream.h>
#include <conio.h>

//Nama : Reza hidaytulloh
//Nim  : 3420210019
//Prodi: Teknik Informatika

void main()
{
int a,b;
   char lagi;

 atas:
  clrscr();
   cout<<"Masukan Bilangan = ";cin>>a;
   b = a % 2;
   printf ("Nilai %d %% 2 adalah = %d",a,b);
   printf ("\n\nIngin Hitung Lagi [Y/T] : ");
   lagi = getche ();
   if (lagi == 'Y' || lagi == 'y') { goto atas; }
   getch();
 }

tugas 5

#include <stdio.h>
#include <iostream.h>
#include <conio.h>

//Nama : Reza hidaytulloh
//Nim  : 3420210019
//Prodi: Teknik Informatika

void main()
{
int bil = 1;
    while (bil<=10)
    {
    printf (" %d ",bil);
      bil++;
    }
    bil = 2;
    cout<<endl;
    do
    {
    printf (" %d ",bil);
      bil+=2;
    } while (bil <=10);
   getch();
 }

tugas 6

#include <stdio.h>
#include <iostream.h>
#include <conio.h>

//Nama : Reza hidaytulloh
//Nim  : 3420210019
//Prodi: Teknik Informatika

void main()
 {
    int bil = 2;
    int b=0;
    do
    {
    if (bil <20) { printf (" %d +",bil); }
else {printf (" %d = ",bil); }
      b = b + bil;
      bil = bil + 2;
    } while (bil<=20);
    cout<<b;
   getch();
 }

tugas7

#include <stdio.h>
#include <iostream.h>
#include <conio.h>

//Nama : Reza hidaytulloh
//Nim  : 3420210019
//Prodi: Teknik Informatika

void main()
 {
    int a,b,c;
    for (a=2;a<=10;a+=2)
    {
    b=2; c=0;
      do
      {
      c = c + b;
         if (a == b) {cout<<b<<" = "<<c;} else {cout<<b<<" + ";}
         b = b + 2;
      }while (b<=a);
      cout<<endl;
    }
   getch();
 }

tugas 8



#include <stdio.h>
#include <iostream.h>
#include <conio.h>

//Nama : Reza hidaytulloh
//Nim  : 3420210019
//Prodi: Teknik Informatika

void main()
{
    int a,b,c;
    for (a=1;a<=9;a+=2)
    {
    b=1; c=1;
      do
      {
      c = c * b;
         if (a == b) {cout<<b<<" = "<<c;} else {cout<<b<<" * ";}
         b = b + 2;
      }while (b<=a);
      cout<<endl;
    }
   getch();
 }


Tuesday, October 18, 2022

TUGAS MATERI PERTEMUAN 5

 






Nama : Reza Hidayatulloh
Nim : 3420210019
Prodi : Teknik Informatika


#include <iostream.h>
#include<stdio.h>
#include <conio.h>

//Nama : Reza hidaytulloh
//Nim  : 3420210019
//Prodi: Teknik Informatika

void main  ()
 {
 char kode, lagi;

 //Deklarasi Label
 atas:
 clrscr();
 cout<<"input your size catalog shirt [S/M/L] : ";
 kode = getche ();
 cout<<'\n';
 switch (kode) {
   case 'S': case 's':
 cout<<"why not"; break;
   case 'M': case 'm':
 cout<<"suicidal anthem"; break;
   case 'L': case 'l':
 cout<<"calvin klein"; break;
   default:
   cout<<"Anda Salah Memasukan Kode";
 }
 cout<<'\n';
 cout<<"\nYou want buy more? [Y/T]: ";
 lagi = getche();
 if(lagi == 'Y' || lagi == 'y') goto atas;
 getch();
}



#include <stdio.h>
#include <iostream.h>
#include <conio.h>

//Nama : Reza Hidayatulloh
//Nim  : 3420210019
//prodi: Teknik Informatika
 void main  ()
 {
  char kode, lagi; char nama[50], bonus[50];
   int jml; float harga, total, pot, ppn, grand;
 lagi:
  clrscr();
   puts("****************************************");
   printf("Masukan Kode laptop [1/2/3]: ");cin>>kode;
   printf("Jumlah Pembelian laptop    : ");cin>>jml;
   switch (kode)  {
    case '1':
      strcpy(nama,"asus tuf gaming"); harga = 9000000;
         break;
      case '2':
      strcpy(nama,"msi gf63 thin 11c"); harga = 8000000;
         break;
      default:
      strcpy(nama,"acer nitro");
         harga = 9000000;
   }

   total = harga * jml; ppn = 0.1 * total;

   if(jml>5) {
    strcpy(bonus,"keyboard srgb");
      pot = 0.1 * total;
   } else {
    strcpy(bonus,"Maaf ya Tidak Dapat Bonus");
      pot = 0;
   }
   grand = total + ppn - pot;
   clrscr();
   puts("-----------------------------------------");
   puts("          ***Berkah Jaya***");
   puts("           Jl. Kesetiaan No.01");
   puts("-----------------------------------------");
   cout<<"Nama laptop : "<<nama  <<endl;
   cout<<"Harga laptop: "<<harga <<endl;
   cout<<"Bonus       : "<<bonus <<endl;
   cout<<"Total Bayar : "<<total <<endl;
   cout<<"Potongan    : "<<pot   <<endl;
   cout<<"PPN         : "<<ppn   <<endl;
   cout<<"Grand Total : "<<grand <<endl;
   puts("-----------------------------------------");
   puts("           ***Terima Kasih***            ");
   cout<<"           Input Data Lagi...?";cin>>lagi;
   if (lagi == 'y' || lagi == 'y') {goto lagi;}

getch();
 }



#include <stdio.h>
#include <iostream.h>
#include <conio.h>

//Nama : Reza hidaytulloh
//Nim  : 3420210019
//Prodi: Teknik Informatika

void main()

{

char nama[20],tipe[20],souvenir[20];
char kode,lagi;
int lama;
float harga,total,admin=200000,ubay,ukem;



awal:

clrscr();
puts("PENGINAPAN ATIKA HOTEL");
puts("********************************");
cout<<"Nama Penyewa      : ";cin>>nama;
cout<<"Kode Kamar [S/F/D]: ";cin>>kode;



if (kode == 'S' || kode == 's')
{
strcpy(tipe,"Superior Room");
harga = 400000;
}
else if (kode == 'F' || kode == 'f')
{
strcpy(tipe,"Family Room");
harga = 300000;
}
else if (kode == 'D' || kode == 'd')
{
strcpy(tipe,"Deluxe Room");
harga = 200000;
}
else
{
puts("******************************");
cout<<"Kode kamar yang anda masukan salah, ingin input lagi?";
cin>>lagi;
switch(lagi)
{
case 'Y':
case 'y':
goto awal;
default:
goto akhir;
}
}


clrscr();
puts("PENGINAPAN ATIKA HOTEL");
puts("******************************");
cout<<"Nama Penyewa      : "<<nama<<endl;
cout<<"Kode Kamar [S/F/D]: "<<kode<<endl;
cout<<"Lama Menginap     : ";cin>>lama;
puts("******************************");
if (lama>=5)
{
strcpy(souvenir,"Selimut Batik");
}
else
{
strcpy(souvenir,"Tidak Dapat");
}

total = (harga * lama) + admin;


cout<<"Tipe Kamar \t\t: "<<tipe<<endl;
cout<<"Lama Menginap \t\t: "<<lama<<" hari"<<endl;
cout<<"Souvenir \t\t: "<<souvenir<<endl;
printf("Biaya Sewa \t\t: Rp.%8.2f \n",harga);
printf("Biaya Administrasi \t: Rp.%8.2f \n",admin);
printf("Total Biaya Sewa \t: Rp.%8.2f \n",total);
puts("******************************");
cout<<"Uang Bayar : ";cin>>ubay;
ukem = ubay - total;
   cout<<"Uang kembali : "<<ukem<<endl;
   cout<<"Ingin input lagi [Y/T] ";cin>>lagi;
switch(lagi)

{
case 'Y':
case 'y':
goto awal;
default:
goto akhir;
}

akhir:
getch();
}








Tuesday, September 27, 2022

TUGAS MATERI PERTEMUAN 4

 


assalamualaikum wr.wb

Nama :Reza Hidayatulloh

Nim   :3420210019

Prodi :Teknik Informatika



1
#include <stdio.h>
#include <iostream.h>
#include <conio.h>

//Nama : Reza Hidayatulloh
//Nim  : 3420210019
//Prodi: Teknik Informatika

void main()
{
  //deklarasi variable
  int absen,tugas,uts,uas;
  float total;

  puts("program menghitung nilai mahasiswa");
  puts("************************************");
  printf("masukan nilai absen: ");scanf("%d",&absen);
  cout<<"masukan nilai tugas: ";cin>>tugas;
  printf("masukan nilai uts: ");scanf("%i",&uts);
  cout<<"masukan nilai uas: ";cin>>uas;

  //proses perhitungan
  total = (absen*0.1)+(tugas*0.2)+(uts*0.3)+(uas*0.4);
  puts("************************************");
  cout<<"total adalah: "<<total<<" (bentuk tidak terformat)\n";
  printf("total adalah: %.2f (bentuk yang terformat)\n",total);
  puts("************************************");

  //kondisi
  if (total >=75 )
  { cout<<"selamat anda lulus"; }
  else
  { cout<<"maaf anda tidak lulus"; }
  getch();
}
















2
#include <stdio.h>
#include <iostream.h>
#include <conio.h>

//Nama : Reza Hidayatulloh
//Nim  : 3420210019
//Prodi: Teknik Informatika

void main()
{
  int pilih;
  char huruf [20];

  printf ("Silakan Pilih Program [1/2]:") ; cin >> pilih;
  //scanf ("%d", & pilih);
  /*
  There are two problems with using scanf() to get a number:
  First, validation/error handling is poor.
  The second problem is that of leaving characters in the buffer.
  Sumber: https://faq.cprogram.com/cgi-bin/smartfaq.cgi?
  */
  if (pilih == 1)
   {
   clrscr();
   puts ("************************");
   puts ("\Contoh Program Strlen");
   puts ("************************");
   cout <<"Masukan Sembarang Kata = "; gets (huruf);
   cout <<"Panjang Kata Yang Diinput = "<<strlen(huruf);
   getch() ;
   }

  else if (pilih == 2)
   {
   clrscr();
   puts ("************************");
   puts ("\Contoh Program Strcmp");
   puts ("************************");

   char a1 [] = "S";
   char a2 [] = "s";
   char b1 [] = "S";

   cout <<"Hasil Perbandingan "<<a1<<" dan "<<a2<< "->";
   cout <<strcmp (a1,a2) <<endl;
   cout <<"Hasil Perbandingan "<<a2<<" dan "<<a1<< "->";
   cout <<strcmp (a2,a1) <<endl;
   cout <<"Hasil Perbandingan "<<a1<<" dan "<<b1<< "->";
   cout <<strcmp (a1,b1) <<endl;

  getch();
  }
  else
  {
  printf ("Maaf Pilihan Anda Salah..");
  }
}








#include <stdio.h>
#include <iostream.h>
#include <conio.h>

//Nama : Reza Hidayatulloh
//Nim  : 3420210019
//Prodi: Teknik Informatika

void main()
{
  char gol,jab[10];
  long gapok;
  cout<<endl<<"data jabatan"<<endl
  <<"***************************"<<endl;
  cout<<"masukan golongan [1/2/3/4]: ";cin>>gol;
  if(gol=='1')
  {
    strcpy(jab,"direktur");
    gapok=7000000;
  }
  else if(gol=='2')
  {
    strcpy(jab,"manajer");
    gapok=5000000;
  }
  else if(gol=='3')
  {
    strcpy(jab,"supervisor");
     gapok=4000000;
  }
  else if(gol=='4')
  {
    strcpy(jab,"karyawan");
    gapok=3000000;
  }
  else
  {
    printf("golongan %c tidak terdaftar.\n",gol);
    strcpy(jab,"none");
    gapok=0;
  }
  cout<<"jabatan = "<<jab<<endl;
  cout<<"gaji pokok = "<<gapok<<endl;
  getch();
}






#include <stdio.h>
#include <iostream.h>
#include <conio.h>

//Nama : Reza hidaytulloh
//Nim  : 3420210019
//Prodi: Teknik Informatika
void main()
{
  char kode,ukuran,merk[15]="none";
  long harga=0;
  cout<<"kode baju [1/2/3] : ";cin>>kode;
  cout<<"ukuran [S/M]    : ";cin>>ukuran;
  if (kode=='1')
  {
    strcpy(merk,"SLIPKNOT");
    if (ukuran=='S' || ukuran =='s') { harga=45000; } else { harga=60000; }
  }
  else if (kode=='2')
  {
    strcpy(merk,"REEBOK");
    //bentuk penulisan if versi singkat
    if (ukuran=='S' || ukuran == 's') harga=65000; else harga=75000;
  }
  else if (kode=='3')
  {
  strcpy(merk,"SUICIDE ANTHEM");
  if (ukuran=='S' || ukuran =='s') harga=120000; else harga=125000;
  }
  else
  {
    cout<<"salah kode baju"<<endl;
  }
  cout<<"merk baju : "<<merk<<endl;
  cout<<"harga baju : "<<harga<<endl;
  getch();
}

Tuesday, September 20, 2022

TUGAS MATERI PERTEMUAN 3

 Nama : Reza Hidayatulloh

Nim    : 3420210019

Prodi   :Teknik Informatika



 










Monday, September 12, 2022

TUGAS MATERI PERTEMUAN 2

 



Assalamualaikkum wr.wb

Lampiran Tugas Programming Basic Algoritma

Nama :Reza Hidayatulloh

Nim   :3420210019

Prodi :Teknik Informatika


Lampiran tugas 1 menggunakan software Borland C++


Pseudo code in Borland C++
#include <iostream.h>
#include <conio.h>

void main () {
   //Name : Reza Hidayatulloh
   //Nim  : 3420210019
   //Prodi: Teknik Informatika
   cout<<"this is my first C++ program.."<<endl;
   cout<<"Name : Reza Hidayatulloh"<<endl;
   cout<<"Nim  : 3420210019"<<endl;
   cout<<"Prodi: Teknik Informaika";
   getch();
}
Lampiran Tugas 2 menggunakan Software Borland C++
pseudo code in Borland C++

#include <iostream.h>
#include <conio.h>
#include <stdio.h>
/*
 Name  : Reza Hidayatulloh
 Nim   : 3420210019
 Prodi : Teknik Informatika
 */
 void main()
 {
   const float phi = 3.14;
   int finger =7;
   float area;
   printf("finger value is %d \n",finger);
   area = finger * finger * phi;
   printf("the area of the circle is %.2f",area);
   getch();
 }

Sekian dan Terima Kasih.
Wassalamualaikum wr.wb




Sunday, April 17, 2022

 HAPPY EARTH DAY


Nama kelompok : Aufa Munadil Al - Khoir (3420210024)

                              Reza Hidayatulloh (3420210019)

                              La Ode Ian (3420210002)

                              Raihan Fawaid (3420210030)

                              M. Aditya Auliadin (3420210014)


Untuk memperingati hari bumi kami membuat poster ini :


Selama 50 tahun terakhir, Hari Bumi telah dirayakan oleh miliaran orang di seluruh dunia, setiap tahun setiap tanggal 22 April, untuk bergabung bersama dalam mempromosikan kesadaran akan kesehatan lingkungan kita.  Mengapa kita harus terus merayakan liburan ini?  Beberapa orang mungkin menganggapnya sebagai hari libur lain, atau alasan untuk mengenakan mahkota bunga dan hijau, mirip dengan Hari St. Patrick, tetapi dengan keprihatinan serius tentang lingkungan kita yang berubah sedang dipelajari dan ditangani hari ini oleh para ilmuwan, politisi, dan iklim muda terkemuka.  para aktivis perubahan, beberapa orang beradaptasi dengan cara hidup yang lebih ramah lingkungan — setiap hari, tidak hanya pada 22 April setiap tahun.  Beri isyarat pengomposan, daur ulang, penggunaan kembali, carpooling, thrifting, dan sedotan logam untuk menyelamatkan kura-kura.

SEJARAH HARI BUMI

Ide untuk Hari Bumi awalnya lahir pada tahun 1969, ketika seorang Senator AS bernama Gaylord Nelson, menyaksikan efek dari tumpahan minyak besar-besaran di Santa Barbara, CA.  Dia menyerukan agar semua orang Amerika mengambil sikap untuk lingkungan pada tahun 1970, dan ribuan perguruan tinggi dan universitas di seluruh Amerika Serikat mengorganisir protes untuk Bumi yang sehat dan berkelanjutan.  Ini termasuk polusi udara dari pabrik dan jalan raya, serta hilangnya habitat hewan dan kepunahan hewan.  Karena demonstrasi nasional ini, Hari Bumi pertama membantu menciptakan Badan Perlindungan Lingkungan Amerika Serikat dan tindakan Udara Bersih, Air Bersih, dan Spesies Terancam Punah menjadi undang-undang.

 Hari ini, kami memiliki kekhawatiran yang sama, dan sayangnya mereka bahkan lebih berantakan daripada tumpahan minyak asli itu.  Meningkatnya bencana alam, cuaca ekstrem, dan meningkatnya suhu global mungkin tampak mustahil bagi satu manusia, apalagi jutaan atau bahkan miliaran manusia, untuk memperlambat, atau menghentikan.  Telah dilaporkan bahwa terumbu karang sedang sekarat, kita melihat gambar hewan di darat dan di laut dengan sampah di perut atau di sekitar tubuh mereka, dan pabrik perusahaan dan perusahaan besar di seluruh dunia terus mencemari udara dan ruang hidup kita.  Tapi tindakan kecil, seperti memungut sampah di trotoar yang mungkin berakhir di leher binatang atau di laut, masih memberikan dampak — langkah ke arah yang benar, dan perubahan penting