TUGAS KELOMPOK PERTEMUAN 5 MINGGU 5
07.25
By
Unknown
TUGAS KELOMPOK
0
komentar
1. Ini program c++nya
#include <cstdlib>
#include <iostream>
#include <fstream>
using namespace std;
ofstream varfile;
struct str_liburan{
int a,b,c,d;
};
class liburan{
private : int p,n;
str_liburan kdn;
public : liburan();
void input();
int sum();
void output();
};
liburan::liburan(){cout<<"\t\t ============================="<<endl;
cout<<"\t\t || SELAMAT DATANG DI ||"<<endl;
cout<<"\t\t || KIDS FUN ||"<<endl;
cout<<"\t\t || JOGJA ||"<<endl;
cout<<"\t\t ============================= "<<endl;
cout<<"\n\t================================================================"<<endl;
cout<<"\t| Harga tiket KIDS FUN |"<<endl;
cout<<"\t================================================================"<<endl;
cout<<"\t| 1. Senin - Sabtu = Rp 40.000 | 2. Minggu = Rp 50.000 |"<<endl;
cout<<"\t================================================================"<<endl;
}
void liburan::input(){cout<<"\nMasukkan pilihan hari = ",cin>>kdn.a;
if(kdn.a==1){kdn.c=20000;}
else if(kdn.a==2){kdn.d=30000;}
}
int liburan::sum(){if (kdn.a==1){
cout<<"\t================================================"<<endl;
cout<<"\t| Menu Pilihan | Harga/jam |"<<endl;
cout<<"\t================================================"<<endl;
cout<<"\t| 1 |Sepeda air | Rp 25.000 |"<<endl;
cout<<"\t| 2 |Bom-bom car | Rp 50.000 |"<<endl;
cout<<"\t| 3 |Go kart | Rp 100.000 |"<<endl;
cout<<"\t| 4 |Motor koin | Rp 25.000 |"<<endl;
cout<<"\t| 5 |Kereta mini | Rp 25.000 |"<<endl;
cout<<"\t================================================"<<endl;
cout<<"\nMau main berapa kali ?? = ",cin>>n;kdn.b=0;
for(int i=0;i<n;i++){
cout<<"\nMasukkan pilihan = ",cin>>p;
if(p==1){kdn.b=kdn.b+25000;cout<<"Anda memilih Sepeda Air"<<endl;}
else if(p==2){kdn.b=kdn.b+50000;cout<<"Anda memilih bom bom car"<<endl;}
else if(p==3){kdn.b=kdn.b+100000;cout<<"Anda memilih go kart"<<endl;}
else if(p==4){kdn.b=kdn.b+25000;cout<<"Anda memilih motor koin"<<endl;}
else if(p==5){kdn.b=kdn.b+25000;cout<<"Anda memilih Kereta mini"<<endl;}}
cout<<"\n++ Terimakasih Telah Berkunjung di KIDS FUN ++"<<endl;
varfile.open("Tiket.txt");
varfile<<" \t\tNota Pembayaran Kids Fun"<<endl<<endl<<endl;
varfile<<" Harga tiket senin - sabtu = Rp. "<<kdn.c<<" "<<endl;
varfile<<" Total harga Wahana yang di pilih = RP. "<<kdn.b<<" "<<endl;
varfile<<" TOTAL HARGA = Rp. "<<kdn.c+kdn.b<<" "<<endl<<endl<<endl;
varfile<<"TERIMAKASIH ATAS KUNJUNGANNYA"<<endl;
}
if(kdn.a==2){
cout<<"\t====================================="<<endl;
cout<<"\t|Pilih wahana | Harga/jam|"<<endl;
cout<<"\t===================================="<<endl;
cout<<"\t| 1 |Sepeda air | Rp 35000 |"<<endl;
cout<<"\t| 2 |Bom bom car | Rp 60000 |"<<endl;
cout<<"\t| 3 |Go kart | Rp 120000|"<<endl;
cout<<"\t| 4 |Motor koin | Rp 35000 |"<<endl;
cout<<"\t| 5 |Kereta mini | Rp 40000 |"<<endl;
cout<<"\t===================================="<<endl;
cout<<"\nMau berapa wahana ?? = ",cin>>n;kdn.b=0;
for(int i=0;i<n;i++){
cout<<"\nMasukkan pilihan = ",cin>>p;
if(p==1){kdn.b=kdn.b+35000;cout<<"Anda memilih Sepeda Air"<<endl;}
else if(p==2){kdn.b=kdn.b+60000;cout<<"Anda memilih Bom Bom car"<<endl;}
else if(p==3){kdn.b=kdn.b+120000;cout<<"Anda memilih Go kart"<<endl;}
else if(p==4){kdn.b=kdn.b+35000;cout<<"Anda memilih Motor Koin"<<endl;}
else if(p==5){kdn.b=kdn.b+40000;cout<<"Anda memilih Kereta mini"<<endl;
cout<<"\n++ Terimakasih Telah Berkunjung di KIDS FUN ++"<<endl;
varfile.open("Tiket.txt");
varfile<<" \t\tNota Pembayaran Kids Fun"<<endl<<endl<<endl;
varfile<<" Harga tiket senin - sabtu = Rp. "<<kdn.d<<" "<<endl;
varfile<<" Total harga Wahana yang di pilih = RP. "<<kdn.b<<" "<<endl;
varfile<<" TOTAL HARGA = Rp. "<<kdn.d+kdn.b<< " "<<endl<<endl<<endl;
varfile<<"TERIMAKASIH ATAS KUNJUNGANNYA"<<endl;
}
}
}
}
int main(int argc, char *argv[])
{
liburan z;
z.input();
z.sum();
system("PAUSE");
return EXIT_SUCCESS;
}
#berikut adalah print screen setelah di runing
a
# selain itu di folder yang sama akan ada notepad yang isinya merupakan total harga yang harus di bayar
2.programnya dalam bentuk raptor
#include <cstdlib>
#include <iostream>
#include <fstream>
using namespace std;
ofstream varfile;
struct str_liburan{
int a,b,c,d;
};
class liburan{
private : int p,n;
str_liburan kdn;
public : liburan();
void input();
int sum();
void output();
};
liburan::liburan(){cout<<"\t\t ============================="<<endl;
cout<<"\t\t || SELAMAT DATANG DI ||"<<endl;
cout<<"\t\t || KIDS FUN ||"<<endl;
cout<<"\t\t || JOGJA ||"<<endl;
cout<<"\t\t ============================= "<<endl;
cout<<"\n\t================================================================"<<endl;
cout<<"\t| Harga tiket KIDS FUN |"<<endl;
cout<<"\t================================================================"<<endl;
cout<<"\t| 1. Senin - Sabtu = Rp 40.000 | 2. Minggu = Rp 50.000 |"<<endl;
cout<<"\t================================================================"<<endl;
}
void liburan::input(){cout<<"\nMasukkan pilihan hari = ",cin>>kdn.a;
if(kdn.a==1){kdn.c=20000;}
else if(kdn.a==2){kdn.d=30000;}
}
int liburan::sum(){if (kdn.a==1){
cout<<"\t================================================"<<endl;
cout<<"\t| Menu Pilihan | Harga/jam |"<<endl;
cout<<"\t================================================"<<endl;
cout<<"\t| 1 |Sepeda air | Rp 25.000 |"<<endl;
cout<<"\t| 2 |Bom-bom car | Rp 50.000 |"<<endl;
cout<<"\t| 3 |Go kart | Rp 100.000 |"<<endl;
cout<<"\t| 4 |Motor koin | Rp 25.000 |"<<endl;
cout<<"\t| 5 |Kereta mini | Rp 25.000 |"<<endl;
cout<<"\t================================================"<<endl;
cout<<"\nMau main berapa kali ?? = ",cin>>n;kdn.b=0;
for(int i=0;i<n;i++){
cout<<"\nMasukkan pilihan = ",cin>>p;
if(p==1){kdn.b=kdn.b+25000;cout<<"Anda memilih Sepeda Air"<<endl;}
else if(p==2){kdn.b=kdn.b+50000;cout<<"Anda memilih bom bom car"<<endl;}
else if(p==3){kdn.b=kdn.b+100000;cout<<"Anda memilih go kart"<<endl;}
else if(p==4){kdn.b=kdn.b+25000;cout<<"Anda memilih motor koin"<<endl;}
else if(p==5){kdn.b=kdn.b+25000;cout<<"Anda memilih Kereta mini"<<endl;}}
cout<<"\n++ Terimakasih Telah Berkunjung di KIDS FUN ++"<<endl;
varfile.open("Tiket.txt");
varfile<<" \t\tNota Pembayaran Kids Fun"<<endl<<endl<<endl;
varfile<<" Harga tiket senin - sabtu = Rp. "<<kdn.c<<" "<<endl;
varfile<<" Total harga Wahana yang di pilih = RP. "<<kdn.b<<" "<<endl;
varfile<<" TOTAL HARGA = Rp. "<<kdn.c+kdn.b<<" "<<endl<<endl<<endl;
varfile<<"TERIMAKASIH ATAS KUNJUNGANNYA"<<endl;
}
if(kdn.a==2){
cout<<"\t====================================="<<endl;
cout<<"\t|Pilih wahana | Harga/jam|"<<endl;
cout<<"\t===================================="<<endl;
cout<<"\t| 1 |Sepeda air | Rp 35000 |"<<endl;
cout<<"\t| 2 |Bom bom car | Rp 60000 |"<<endl;
cout<<"\t| 3 |Go kart | Rp 120000|"<<endl;
cout<<"\t| 4 |Motor koin | Rp 35000 |"<<endl;
cout<<"\t| 5 |Kereta mini | Rp 40000 |"<<endl;
cout<<"\t===================================="<<endl;
cout<<"\nMau berapa wahana ?? = ",cin>>n;kdn.b=0;
for(int i=0;i<n;i++){
cout<<"\nMasukkan pilihan = ",cin>>p;
if(p==1){kdn.b=kdn.b+35000;cout<<"Anda memilih Sepeda Air"<<endl;}
else if(p==2){kdn.b=kdn.b+60000;cout<<"Anda memilih Bom Bom car"<<endl;}
else if(p==3){kdn.b=kdn.b+120000;cout<<"Anda memilih Go kart"<<endl;}
else if(p==4){kdn.b=kdn.b+35000;cout<<"Anda memilih Motor Koin"<<endl;}
else if(p==5){kdn.b=kdn.b+40000;cout<<"Anda memilih Kereta mini"<<endl;
cout<<"\n++ Terimakasih Telah Berkunjung di KIDS FUN ++"<<endl;
varfile.open("Tiket.txt");
varfile<<" \t\tNota Pembayaran Kids Fun"<<endl<<endl<<endl;
varfile<<" Harga tiket senin - sabtu = Rp. "<<kdn.d<<" "<<endl;
varfile<<" Total harga Wahana yang di pilih = RP. "<<kdn.b<<" "<<endl;
varfile<<" TOTAL HARGA = Rp. "<<kdn.d+kdn.b<< " "<<endl<<endl<<endl;
varfile<<"TERIMAKASIH ATAS KUNJUNGANNYA"<<endl;
}
}
}
}
int main(int argc, char *argv[])
{
liburan z;
z.input();
z.sum();
system("PAUSE");
return EXIT_SUCCESS;
}
#berikut adalah print screen setelah di runing
a
# selain itu di folder yang sama akan ada notepad yang isinya merupakan total harga yang harus di bayar
2.programnya dalam bentuk raptor
0 komentar: