Program Counter Digital

Jul 25, 2009 6 Comments by Sahabat

Program Counter Digital

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
uses wincrt;
 
label awal;
const
days : array [0..6] of string[9] =
     ('minggu','senin','selasa','rabu','kamis','jumat','sabtu');
 
var
operator,i,j,u,y,m,d,dow : integer;
uang,harga, pulsa,pilihan,c        : longint;
hp                : string;
 
{pernghitungan uang-harga}
function hitung(a,b : longint):longint;
begin
  hitung:= b-a
end;
 
procedure simpati(var pulsa:longint);
label simpati1;
var nominal : longint;
begin
  clrscr  ;
  simpati1:
  writeln('daftar harga SIMPATI');
  writeln('v 5   =====     6.000');
  writeln('v 10  =====    12.000');
  writeln('v 20  =====    21.000');
  writeln('v 50  =====    50.000');
  writeln('v 100 =====    98.000');
  writeln;
  writeln('masukkan nominal pulsa');
  readln (nominal);
  case nominal of
    5  : pulsa := 6000;
    10 : pulsa := 12000;
    20 : pulsa := 21000;
    50 : pulsa := 50000;
    100: pulsa := 98000;
    else begin
      pulsa := 0;
      writeln ('salah, tulis nominal');
      goto simpati1;
    end;
  end;
end;
 
procedure as(var pulsa:longint);
label as1;
var nominal : longint;
begin
  as1:
  writeln('daftar harga Kartu As');
  writeln('v 5   =====     6.000');
  writeln('v 15  =====    18.000');
  writeln('v 25  =====    29.000');
  writeln('v 50  =====    54.000');
  writeln('v 100 =====   108.000');
  writeln;
  writeln('masukkan nominal pulsa');
  readln (nominal);
  case nominal of
    5  : pulsa := 6000;
    15 : pulsa := 18000;
    25 : pulsa := 29000;
    50 : pulsa := 54000;
    100: pulsa := 108000;
    else begin
      pulsa := 0;
      writeln ('salah, tulis nominal');
      goto as1;
    end;
  end;
end;
 
procedure MENTARI(var pulsa:longint);
label im31;
var nominal : longint;
begin
  im31:
  writeln('daftar harga MENTARI');
  writeln('v 5   =====     6.000');
  writeln('v 10  =====    11.000');
  writeln('v 20  =====    21.000');
  writeln('v 50  =====    50.000');
  writeln('v 100 =====    98.000');
  writeln;
  writeln('masukkan nominal pulsa');
  readln (nominal);
  case nominal of
    5  : pulsa := 6000;
    10 : pulsa := 11000;
    20 : pulsa := 21000;
    50 : pulsa := 50000;
    100: pulsa := 98000;
    else begin
      pulsa := 0;
      writeln ('salah, tulis nominal');
      goto im31;
    end;
  end;
end;
 
procedure im3(var pulsa:longint);
label im32;
var nominal : longint;
begin
  im32:
  writeln('daftar harga im3');
  writeln('v 5   =====     6.000');
  writeln('v 10  =====    11.000');
  writeln('v 20  =====    20.000');
  writeln('v 50  =====    48.000');
  writeln('v 100 =====    95.000');
  writeln;
  writeln('masukkan nominal pulsa');
  readln (nominal);
  case nominal of
    5  : pulsa := 6000;
    10 : pulsa := 11000;
    20 : pulsa := 20000;
    50 : pulsa := 48000;
    100: pulsa := 95000;
    else begin
      pulsa := 0;
      writeln ('salah, tulis nominal');
      goto im32;
    end;
  end;
end;
 
procedure XL(var pulsa:longint);
label xl1;
var nominal : longint;
begin
xl1:
writeln('daftar harga XL');
writeln('v 5   =====     6.000');
writeln('v 10  =====    11.000');
writeln('v 20  =====    21.000');
writeln('v 50  =====    47.000');
writeln('v 100 =====    95.000');
writeln;
writeln('masukkan nominal pulsa');
readln (nominal);
 
case nominal of
5  : pulsa := 6000;
10 : pulsa := 11000;
20 : pulsa := 21000;
50 : pulsa := 47000;
100: pulsa := 95000;
else begin
     pulsa := 0;
     writeln ('salah, tulis nominal');
     goto xl1;
     end;
 end;
end;
 
{program utama}
begin
  {GetDate(y,m,d,dow : word); }
  {program untuk menampilkan date belum bisa keluar...
  bantuin dounk masss....}
 
  awal:
  for j:=7 to 11 do
  begin
    for i:=1 to j do
    write('=');
    writeln;
  end;
  writeln('================================');
  writeln('********************************');
  writeln('                                ');
  writeln('selamat datang di counter digital');
  writeln('                                 ');
  writeln;
  writeln('********************************');
  writeln('================================ ');
 
  for j:=11 downto 7 do
  begin
    for i:=1 to j do
    write('=');
    writeln;
  end;
  writeln('                       zen design');
  readln;
  clrscr;
  writeln('================================');
  writeln('********************************');
  writeln('                                ');
  writeln('    kami ada untuk anda         ');
  writeln('tekan    enter    untuk  memulai ');
  writeln('transaksi  anda');
  writeln('********************************');
  writeln('================================ ');
 
  readln;
  clrscr;
 
  writeln('1. Telkomsel');
  writeln('2. Indosat');
  writeln('3. XL');
  writeln;
  writeln('silahkan pilih operator anda');
  readln (operator);
  clrscr;
 
  case operator of
    1 :
      begin
        writeln('1. Simpati');
        writeln('2. Kartu As');
        readln (pilihan);
        clrscr;
        case pilihan of
          1 : simpati(pilihan); {memanggil procedure simpati}
          2 : as(pilihan);    {mamanggil procedure as}
        end;
      end;
    2 :
      begin
        writeln('1. MENTARI');
        writeln('2. im3');
        readln (pilihan);
        clrscr;
        case pilihan of
          1 : MENTARI(pilihan);
          2 : im3(pilihan);
        end;
      end;
    3 :
      begin
         readln (pilihan);
         XL(pilihan);
         clrscr;
      end
 else begin
      writeln ('maaf anda salah pilih');
      goto awal; {mengembalikan program ke label awal}
 
      end;
 end;
 
clrscr;
writeln ('masukan nomer hepe'); readln(hp);    {input nomer hape}
clrscr;
 
writeln ('masukkan uang anda'); readln (uang); {input uang}
clrscr;
 
if uang > pilihan then
   begin
    harga:=hitung(pilihan,uang);    { memanggil fungsi hitung}
    writeln('=============================');
    writeln('           BERHASIL ');
    writeln;
    writeln('transaksi ke nomor  ',hp);
    writeln('');
    writeln('sisa uang anda Rp.',harga);
    writeln('============================');
 
    while harga > 6000 do       {6000 adalah harga minimal voucher}
    begin                      {supaya pelanggan dapat melakukan trakdaksi lagi}
    writeln('saldo anda masih bisa untuk melanjutkan transaksi');
    readln(u);
    goto awal;
    end;
 
    writeln(days[dow],',',m:0,'/',d:0,'/',y:0); {yang ini belum bisa ditampilkan.. bantuin dounk mass}
   end
   else begin
    writeln('=========================');
    writeln('    TRANSAKSI GAGAL');
    writeln('saldo anda tidak mencukupi');
    writeln('==========================');
    writeln;
    writeln('     TERIMA KASIH');
   end;
end.

MUHAMMAD ZAINAL MUTTAQIN
x.mbozen@gmail.com

Kata Kunci

contoh algoritma counter, Program c counter pulsa, program free pascal dan flocart rata rata penjualan toko.

Pascal
Sahabat

Tentang Penulis

Penulis adalah sahabat-sahabat yg menyumbang tulisan di nusinau.com untuk dimuat dengan bijaksana. Silakan kirim tulisannya ke nusinau[at]gmail[dot]com atau ke admin[at]nusinau[dot]com. Butuh diskusi cepat? colek di twitter @nusinau

6 Responses to “Program Counter Digital”

  1. zombie says:

    agak rumit juga nieh..

  2. elya says:

    bgaimana program menempilkan nilai tertinggi dan terendah dengan 5 buah data

  3. oeLzii says:

    kalau program yang untuk mencetak kuadrat dari bilangan 1,2,3dan 4 gimana ya..?

  4. Muklis says:

    jd penasaran gmn cara bwt program menghitung hari,tanggal,bulan,tahunnya?,
    dah sempat Q cb n utak atik tp nihil,….!!!
    g bgitu rumit kok programnya…

    tiga kata : “like this program”

  5. chi says:

    kok untuk yang XL gag muncul yah????

Leave a Reply

You must be logged in to post a comment.