Ini dya gan aplikasi yg baru ane buat ..
Sekalian buat nyetor kedosen, ane pengen nge share ke agan semua nih ..
Walaupun blom sempoerna banget nih gan , semoga aja agan" disini bisa ngesempurnain ..
Cekidot gan !!!
ngacir
Spoiler for Coding:
#include <stdio.h>
#include <conio.h>
#include <string.h>
//starting Program
main()
{
//inputan
long int hjam, totalbayar,
hlebihjam;
int lama, masuk, keluar;
char nama[25], jenis[10],kode,
lanjut, terakhir[50];
clrscr();
data:
printf("\n");
printf("\t\t | WELCOME
TO PARKIRAN MODERN |\n");
printf("\t
----------------------------
--------------------------
\n");
printf("\t| | |
| |\n");
printf("\t| Kode | Kendaraan |
1 Jam Pertama | 1 Jam Selanjutnya |
\n");
printf("\t| | |
| |\n");
printf
("\t|------------------------
----------------------------
--|\n");
printf("\t| | |
| |\n");
printf("\t| 1 | Motor | Rp.
2.000; | Rp. 500; |\n");
printf("\t| | |
| |\n");
printf("\t| 2 | Mobil | Rp.
3.000; | Rp. 1.500; |\n");
printf("\t| | |
| |\n");
printf("\t| 3 | Truk/Bis |
Rp. 5.000; | Rp. 3.000; |\n");
printf("\t| | |
| |\n");
printf("\t
----------------------------
--------------------------
\n");
printf("\tNomer Plat= \t");;
gets (nama);
printf("\tKode Kendaraan
[1,2,3]:\t");
scanf("%s",& kode);
printf("\tJam Masuk:\t");
scanf("%d", & masuk);
printf("\tJam Keluar:\t");
scanf("%d", & keluar);
clrscr();
//HITUNG
if(kode=='1')
{
hjam=2000L;
hlebihjam=500L;
strcpy(jenis,"Motor");
}
else if(kode=='2')
{
hjam=3000L;
hlebihjam=1500L;
strcpy(jenis,"Mobil");
}
else if(kode=='3')
{
hjam=5000L;
hlebihjam=3000L;
strcpy(jenis,"Truck/Bis");
}
printf("selesai\n");
//output
printf("\n
\t--------------------------
------------------\n");
printf("\n\tNomer Plat=%
s",nama);
printf("\n
\t--------------------------
------------------\n");
printf("\tHarga 1 Jam
Pertama = Rp.%ld\n", hjam);
printf("\tJenis Kendaraan
= %s\n", jenis);
lama=keluar-masuk;
printf("\tDurasi Parkir =
%d Jam \n", lama);
totalbayar=(lama-1)
*hlebihjam+hjam;
printf("\n\tTotal Harga
Parkir sebesar =Rp.%ld", totalbayar);
//print
printf("\n\t\n");
printf("\n
\t--------------[THANK YOU]
------------------\n");
printf("\n\t\n");
printf("\n\tApakah anda
akan melakukan entri ulang [Y/N]");
scanf("%s",&lanjut);
//looping
if (lanjut=='y'|| lanjut=='Y')
goto data;
else
goto selesai;
getch();
selesai:
}
Sebelumnya makasih banget nih gan udah mau mampir bentaran ..
Ane minta sundulannya gan biar ampe atas biar bisa dikoreksi ama Master Of C++ gan