tugas algoritma dan struktur data

 


assalamualaikum wr.wb

 

berikut lampiran tugas pertemuan 5 

Nama :  Adinda Putri Angelika
NIM : 3420210006
Prodi : Teknik Informatika
Fakultas : Sains dan Teknologi

 menggunakan Borland C++




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

//Nama : Adinda Putri Angelika
//NIM : 3420210006
//Prodi : Teknik Informatika

void main()
{
char kode, lagi;

//deklarasi label
atas :
clrscr();
   cout<<"MASUKAN KODE BARANG [A/B/C]: ";
   kode = getche();
   cout<<'\n';
   switch (kode) {
    case 'A' : case 'a':
      cout<<"Alat Perkakas"; break;
      case 'B' : case 'b':
      cout<<"Alat Berkebun"; break;
      case 'C' : case 'c':
      cout<<"Alat jahit"; break;
      default:
      cout<<"Anda Salah Memasukan Kode";
   }
   cout<<'\n';
   cout<<"\nIngin Pilih Lagi [Y/T]: ";
   lagi = getche();
   if(lagi == 'Y' || lagi == 'y') goto atas;
   getch();
}




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

//Nama : Adinda Putri Angelika
//NIM : 3420210006
//Prodi : Teknik Informatika

void main()
{
char kode,lagi; char nama[50],bonus[50];
   int jml;float harga,total,pot,ppn,grand;
lagi:
clrscr();
printf("Masukan kode buku novel [1/2/3]: ");cin>>kode;
   printf("Jumlah pembelian buku novel : ");cin>>jml;
switch (kode) {
    case '1':
      strcpy (nama,"Solo Leveling"); harga = 75000;
         break;
      case '2':
         strcpy (nama,"Trash of the Count's Family"); harga = 80000;
         break;
      case '3':
         strcpy (nama,"Omniscient reader's view point"); harga = 85000;
   }
    total = harga * jml; ppn = 0.1 * total;

      if (jml>2) {
      strcpy(bonus,"photocard & pen");
         pot = 0.1 * total;
      } else {
      strcpy(bonus,"Maaf Tidak Dapat Bonus");
         pot = 0;
      }
      grand = total + ppn - pot;
      clrscr();
      puts("           ***TOKO POP UP OFFICIAL***");
      puts("             Jl. Matraman raya no 46-5");
      puts("--------------------------------------------");
      cout<<"Nama Buku   : "<<nama<<endl;
      cout<<"Harga Buku  : "<<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 <conio.h>
#include <iostream.h>

//Nama : Adinda Putri Angelika
//NIM : 3420210006
//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 KIM DOKJA");
puts("********************************");
cout<<"Nama Penyewa      : ";cin>>nama;
cout<<"Kode Kamar [1/2/3]: ";cin>>kode;



if (kode == '1' || kode == '1')
{
strcpy(tipe,"Regression Room");
harga = 400000;
}
else if (kode == '2' || kode == '2')
{
strcpy(tipe,"Unbreakable faith Room");
harga = 500000;
}
else if (kode == '3' || kode == '3')
{
strcpy(tipe," Lamarck's Giraffe Room");
harga = 600000;
}
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 KIM DOKJA");
puts("******************************");
cout<<"Nama Penyewa      : "<<nama<<endl;
cout<<"Kode Kamar [1/2/3]: "<<kode<<endl;
cout<<"Lama Menginap     : ";cin>>lama;
puts("******************************");
if (lama>=5)
{
strcpy(souvenir,"Fourth wall");
}
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();
}

tenkyuu 💜

Komentar

Postingan populer dari blog ini

UAS Analisis Dan Perancangan Sistem Berorientasi Objek

DATA WAREHOUSE