Quiz Pra Uts

  • April 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Quiz Pra Uts as PDF for free.

More details

  • Words: 273
  • Pages: 8
KODE

JENIS

KEGIATAN

HARGA DEWASA

ANAK

PBL

PAINT BALL

Merayap

35000

30000

FLX

FLYING FOX

Flying

75000

70000

ADV

ADVENTURE

Jeram

45000

40000

Ketentuan Soal ! Buat Input untuk jumlah wahana,perusahaan,dan tanggal Boking,juga kode dan jumlah peserta juga usia Ketentuan kode ada ditabel di atas Maka Bayar=harga * jumlah peserta Keseluruhan=jumlah total bayar dari wahana Input uang bayar Maka uang kembali =uang bayar-keseluruhan

#include <stdio.h>#include #include main(){ //ini declare yg bukan array char boking[10],prshn[6],lagi; //ini declare yg array char kode[10][3],*jns[10],*kgtn[10],usia[10]; int s,r; long harga[10],jml[10],bayar[10],ksl=0,ubay,ukem; awal: cout<<"WAHANA OUTBOUND SEJAHTERA"<<endl; cout<<"******************************************"<<endl<<endl; cout<<"Wahana PBL / PAINT BALL"<<endl; cout<<"Wahana FLX / FLYING FOX"<<endl; cout<<"Wahana ADV / ADVENTURE"<<endl<<endl; //input data yg tdk berulang cout<<"******************************************"<<endl<<endl; cout<<"Masukan Jumlah WAHANA = ";cin>>s; cout<<"Masukan Perusahaan = ";cin>>prshn; cout<<"Masukan Tanggal Booking = ";cin>>boking;

for(r=1;r<=s;r++) { //input data yg berulang cout<<"******************************************"<<endl<<endl; cout<<"Masukan WAHANA [PBL/FLX/ADV]= ";cin>>kode[r]; cout<<"Masukan Jumlah Peserta = ";cin>>jml[r]; cout<<"Masukan Usia PILIH [ 1.Dewasa / 2.Kecil ] = ";cin>>usia[r]; //rumus perbandingan if (strcmp(kode[r],"PBL")==0||strcmp(kode[r],"pbl")==0) { jns[r]="PAINT BALL"; kgtn[r]="Merayap"; if(usia[r]=='1') { harga[r]=35000; } else if(usia[r]=='2') { harga[r]=30000; } else { harga[r]=0; } } =>> Buat hingga 3 Kondisi yang ada

else { jns[r]="=="; kgtn[r]="=="; harga[r]=0; } bayar[r]=harga[r]*jml[r]; ksl=ksl+bayar[r]; // end for } clrscr(); //ini output title gotoxy(1,1); cout<<"******************************************"<<endl; gotoxy(4,2); cout<<"WAHANA OUTBOUND SEJAHTERA"<<endl; gotoxy(1,3); cout<<"******************************************"<<endl; gotoxy(4,4); cout<<"Perusahaan = "<<prshn<<endl; gotoxy(4,5); cout<<"No Boking = "<
gotoxy(1,6); cout<<"******************************************"<<endl; gotoxy(2,7); cout<<"NO JENIS KEGIATAN JUMLAH HARGA BAYAR"<<endl; gotoxy(1,8); cout<<"******************************************"<<endl; //12345678901234567890123456789012345678901234567890 for(r=1;r<=s;r++) { //tampilan output gotoxy(2,r+10);cout<

Related Documents

Quiz Pra Uts
April 2020 15
Quiz Pra Uts
April 2020 14
Tugas Pra Uts
April 2020 21
Pra
November 2019 64