SlideShare a Scribd company logo
#include <stdio.h>
#include <conio.h>
#include <iostream.h>
#include <iomanip.h>
struct
{
char jenis_hewan[20],jenis_perawatan[20],kjh[10],kp[10];
int biaya_perawatan,jumlah_hewan;
int subtotal;
}penitipan[10];
main()
{
char lagi,pilih,nama_pemilik[10],nama_petugas[10];
int a,jumlah;
double total_bayar,uang_bayar,uang_kembali;
cout << " =========================================================== " << endl;
cout << " SELAMAT DATANG " << endl;
cout << " DI " << endl;
cout << " PENITIPAN HEWAN PELIHARAAN " << endl;
cout << " MEAOW PET CARE " << endl;
cout << " =========================================================== " << endl;
cout << " " << endl;
cout << " PILIH MENU = " << endl;
cout << " 1. INPUT DATA " << endl;
cout << " 2. LOG OUT " << endl;
cout << " " << endl;
cout << " =========================================================== " << endl;
cout << " " << endl;
cout << " INPUT PILIHAN ANDA [1/2] = " ; cin >> pilih;
if (pilih == '1')
goto awal;
else if (pilih == '2')
goto akhir;
awal:
clrscr();
cout << "
======================================================================== " <<
endl;
cout << " SILAHKAN INPUT DATA ANDA
" << endl;
cout << "
======================================================================== " <<
endl;
cout << "
" << endl;
cout << " PENITIPAN HEWAN PELIHARAAN
" << endl;
cout << " MEAOW PET CARE
" << endl;
cout << "
" << endl;
cout << "
======================================================================== " <<
endl;
cout << " | KODE HEWAN | JENIS HEWAN | KODE JENIS | JENIS | BIAYA PERAWATAN
| " << endl;
cout << " | | | PERAWATAN | PERAWATAN |
| " << endl;
cout << "
======================================================================== " <<
endl;
cout << " | K | KUCING | 1 | LUX | Rp.250.000,-
| " << endl;
cout << " | | | 2 | INTENSIF | Rp.300.000,-
| " << endl;
cout << "
------------------------------------------------------------------------ " <<
endl;
cout << " | H | HAMSTER | 1 | LUX | Rp.150.000,-
| " << endl;
cout << " | | | 2 | INTENSIF | Rp.100.000,-
| " << endl;
cout << "
======================================================================== " <<
endl;
cout << " " << endl;
cout << " NAMA PETUGAS = " ; cin >> nama_petugas;
cout << " NAMA PEMILIK = " ; cin >> nama_pemilik;
cout << " JUMLAH DATA PELIHARAAN = " ; cin >> jumlah;
cout << endl;
for (a=1; a<=jumlah; a++)
{
cout << "
======================================================================== " <<
endl;
cout << " DATA HEWAN KE - " << a << endl;
cout << " KODE JENIS HEWAN [K/H] = " ; cin >> penitipan[a].kjh;
cout << " KODE PERAWATAN [1/2] = " ; cin >> penitipan[a].kp;
if (strcmpi(penitipan[a].kjh,"K")== 0)
{
strcpy(penitipan[a].jenis_hewan,"KUCING");
if(penitipan[a].kp == "1"||penitipan[a].kp == "1")
{
penitipan[a].jenis_perawatan,"LUX";
penitipan[a].biaya_perawatan = 250000;
penitipan[a].jumlah_hewan = 0;
}
else
{
penitipan[a].jenis_perawatan,"INTENSIF";
penitipan[a].biaya_perawatan = 300000;
penitipan[a].jumlah_hewan = 0;
}
}
else if ( strcmpi(penitipan[a].kjh,"H")== 0)
{
strcpy(penitipan[a].jenis_hewan,"HAMSTER");
if(penitipan[a].kp == "1"||penitipan[a].kp == "1")
{
penitipan[a].jenis_perawatan,"LUX";
penitipan[a].biaya_perawatan = 150000;
penitipan[a].jumlah_hewan = 0;
}
else
{
penitipan[a].jenis_perawatan,"INTENSIF";
penitipan[a].biaya_perawatan = 100000;
penitipan[a].jumlah_hewan = 0;
}
}
cout << " JUMLAH HEWAN = " ; cin >> penitipan[a].jumlah_hewan;
cout << " " << endl;
penitipan[a].subtotal = penitipan[a].biaya_perawatan *
penitipan[a].jumlah_hewan;
}
clrscr();
cout << " ================================================= " << endl;
cout << " OUTPUT " << endl;
cout << " PENITIPAN HEWAN PELIHARAAN " << endl;
cout << " MEAOW PET CARE " << endl;
cout << " ================================================= " << endl;
cout << " " << endl;
cout << " NAMA PETUGAS = " << nama_petugas << endl;
cout << " NAMA PEMILIK = " << nama_pemilik << endl;
cout << " " << endl;
cout << "
======================================================================== " <<
endl;
cout << " NO. JENIS HEWAN JENIS BIAYA JUMLAH HEWAN
SUBTOTAL " << endl;
cout << " PERAWATAN PERAWATAN
" << endl;
cout << "
======================================================================== " <<
endl;
for ( a=1; a<=jumlah; a++)
{
cout << setiosflags(ios::left) <<setw(7) << a;
cout << setiosflags(ios::left) <<setw(13) << penitipan[a].jenis_hewan;
cout << setiosflags(ios::left) <<setw(15) << penitipan[a].jenis_perawatan;
cout << setiosflags(ios::left) <<setw(6) << penitipan[a].biaya_perawatan;
cout << setiosflags(ios::left) <<setw(23) << penitipan[a].jumlah_hewan;
cout << setiosflags(ios::left) <<setw(8) << penitipan[a].subtotal<<endl;
}
cout << "
======================================================================== " <<
endl;
cout << endl;
cout << " Total Bayar = " <<
total_bayar << endl;
total_bayar=total_bayar + penitipan[a].subtotal;
cout << " Uang Bayar = " ; cin >>
uang_bayar;
uang_kembali = uang_bayar - penitipan[a].subtotal;
cout << " Uang Kembali = " <<
uang_kembali;
cout << endl;
cout << " " << endl;
cout << " " << endl;
cout << " " << endl;
cout << " INPUT DATA LAGI [Y/T] = " ; cin >> lagi;
if(lagi=='Y'||lagi=='y')
goto awal;
else
goto akhir;
getch();
akhir:
}

More Related Content

Viewers also liked (9)

PPT
Kucing anggora
Mira Kurniasari
 
PDF
Power point
cepi riyana
 
PPTX
Contoh Slide Presentasi Powerpoint yang Baik dan Menarik
Muhammad Noer
 
PDF
Contoh Desain Slide Presentasi Ilmiah Kreatif dan Menarik #1
Arry Rahmawan
 
PDF
Contoh Presentasi Power Point Tentang Pendidikan
Mustofa Thovids
 
PDF
Contoh Desain Slide Presentasi Ilmiah Kreatif dan Menarik #2
Arry Rahmawan
 
PDF
Contoh Desain Slide Presentasi Ilmiah Kreatif dan Menarik #5
Arry Rahmawan
 
PDF
Contoh Desain Slide Presentasi Ilmiah Kreatif dan Menarik #3
Arry Rahmawan
 
PDF
Contoh Desain Slide Presentasi Ilmiah Kreatif dan Menarik #4
Arry Rahmawan
 
Kucing anggora
Mira Kurniasari
 
Power point
cepi riyana
 
Contoh Slide Presentasi Powerpoint yang Baik dan Menarik
Muhammad Noer
 
Contoh Desain Slide Presentasi Ilmiah Kreatif dan Menarik #1
Arry Rahmawan
 
Contoh Presentasi Power Point Tentang Pendidikan
Mustofa Thovids
 
Contoh Desain Slide Presentasi Ilmiah Kreatif dan Menarik #2
Arry Rahmawan
 
Contoh Desain Slide Presentasi Ilmiah Kreatif dan Menarik #5
Arry Rahmawan
 
Contoh Desain Slide Presentasi Ilmiah Kreatif dan Menarik #3
Arry Rahmawan
 
Contoh Desain Slide Presentasi Ilmiah Kreatif dan Menarik #4
Arry Rahmawan
 

Recently uploaded (20)

PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PPTX
AVL ( audio, visuals or led ), technology.
Rajeshwri Panchal
 
PPTX
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
Market Insight : ETH Dominance Returns
CIFDAQ
 
PDF
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
AVL ( audio, visuals or led ), technology.
Rajeshwri Panchal
 
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Market Insight : ETH Dominance Returns
CIFDAQ
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
Ad

Struct

  • 1. #include <stdio.h> #include <conio.h> #include <iostream.h> #include <iomanip.h> struct { char jenis_hewan[20],jenis_perawatan[20],kjh[10],kp[10]; int biaya_perawatan,jumlah_hewan; int subtotal; }penitipan[10]; main() { char lagi,pilih,nama_pemilik[10],nama_petugas[10]; int a,jumlah; double total_bayar,uang_bayar,uang_kembali; cout << " =========================================================== " << endl; cout << " SELAMAT DATANG " << endl; cout << " DI " << endl; cout << " PENITIPAN HEWAN PELIHARAAN " << endl; cout << " MEAOW PET CARE " << endl; cout << " =========================================================== " << endl; cout << " " << endl; cout << " PILIH MENU = " << endl; cout << " 1. INPUT DATA " << endl; cout << " 2. LOG OUT " << endl; cout << " " << endl; cout << " =========================================================== " << endl; cout << " " << endl; cout << " INPUT PILIHAN ANDA [1/2] = " ; cin >> pilih; if (pilih == '1') goto awal; else if (pilih == '2') goto akhir; awal: clrscr(); cout << " ======================================================================== " << endl; cout << " SILAHKAN INPUT DATA ANDA " << endl; cout << " ======================================================================== " << endl; cout << " " << endl; cout << " PENITIPAN HEWAN PELIHARAAN " << endl; cout << " MEAOW PET CARE " << endl; cout << " " << endl; cout << " ======================================================================== " << endl;
  • 2. cout << " | KODE HEWAN | JENIS HEWAN | KODE JENIS | JENIS | BIAYA PERAWATAN | " << endl; cout << " | | | PERAWATAN | PERAWATAN | | " << endl; cout << " ======================================================================== " << endl; cout << " | K | KUCING | 1 | LUX | Rp.250.000,- | " << endl; cout << " | | | 2 | INTENSIF | Rp.300.000,- | " << endl; cout << " ------------------------------------------------------------------------ " << endl; cout << " | H | HAMSTER | 1 | LUX | Rp.150.000,- | " << endl; cout << " | | | 2 | INTENSIF | Rp.100.000,- | " << endl; cout << " ======================================================================== " << endl; cout << " " << endl; cout << " NAMA PETUGAS = " ; cin >> nama_petugas; cout << " NAMA PEMILIK = " ; cin >> nama_pemilik; cout << " JUMLAH DATA PELIHARAAN = " ; cin >> jumlah; cout << endl; for (a=1; a<=jumlah; a++) { cout << " ======================================================================== " << endl; cout << " DATA HEWAN KE - " << a << endl; cout << " KODE JENIS HEWAN [K/H] = " ; cin >> penitipan[a].kjh; cout << " KODE PERAWATAN [1/2] = " ; cin >> penitipan[a].kp; if (strcmpi(penitipan[a].kjh,"K")== 0) { strcpy(penitipan[a].jenis_hewan,"KUCING"); if(penitipan[a].kp == "1"||penitipan[a].kp == "1") { penitipan[a].jenis_perawatan,"LUX"; penitipan[a].biaya_perawatan = 250000; penitipan[a].jumlah_hewan = 0; } else { penitipan[a].jenis_perawatan,"INTENSIF"; penitipan[a].biaya_perawatan = 300000; penitipan[a].jumlah_hewan = 0; } } else if ( strcmpi(penitipan[a].kjh,"H")== 0) { strcpy(penitipan[a].jenis_hewan,"HAMSTER"); if(penitipan[a].kp == "1"||penitipan[a].kp == "1") { penitipan[a].jenis_perawatan,"LUX"; penitipan[a].biaya_perawatan = 150000; penitipan[a].jumlah_hewan = 0; } else {
  • 3. penitipan[a].jenis_perawatan,"INTENSIF"; penitipan[a].biaya_perawatan = 100000; penitipan[a].jumlah_hewan = 0; } } cout << " JUMLAH HEWAN = " ; cin >> penitipan[a].jumlah_hewan; cout << " " << endl; penitipan[a].subtotal = penitipan[a].biaya_perawatan * penitipan[a].jumlah_hewan; } clrscr(); cout << " ================================================= " << endl; cout << " OUTPUT " << endl; cout << " PENITIPAN HEWAN PELIHARAAN " << endl; cout << " MEAOW PET CARE " << endl; cout << " ================================================= " << endl; cout << " " << endl; cout << " NAMA PETUGAS = " << nama_petugas << endl; cout << " NAMA PEMILIK = " << nama_pemilik << endl; cout << " " << endl; cout << " ======================================================================== " << endl; cout << " NO. JENIS HEWAN JENIS BIAYA JUMLAH HEWAN SUBTOTAL " << endl; cout << " PERAWATAN PERAWATAN " << endl; cout << " ======================================================================== " << endl; for ( a=1; a<=jumlah; a++) { cout << setiosflags(ios::left) <<setw(7) << a; cout << setiosflags(ios::left) <<setw(13) << penitipan[a].jenis_hewan; cout << setiosflags(ios::left) <<setw(15) << penitipan[a].jenis_perawatan; cout << setiosflags(ios::left) <<setw(6) << penitipan[a].biaya_perawatan; cout << setiosflags(ios::left) <<setw(23) << penitipan[a].jumlah_hewan; cout << setiosflags(ios::left) <<setw(8) << penitipan[a].subtotal<<endl; } cout << " ======================================================================== " << endl; cout << endl; cout << " Total Bayar = " << total_bayar << endl; total_bayar=total_bayar + penitipan[a].subtotal; cout << " Uang Bayar = " ; cin >> uang_bayar; uang_kembali = uang_bayar - penitipan[a].subtotal; cout << " Uang Kembali = " << uang_kembali; cout << endl; cout << " " << endl; cout << " " << endl; cout << " " << endl; cout << " INPUT DATA LAGI [Y/T] = " ; cin >> lagi; if(lagi=='Y'||lagi=='y')