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();
}








No comments:

Post a Comment