Jumat, 18 November 2011
Program progres bar(c++)
#include "conio.h"
#include "stdlib.h"
#include "dos.h"
#include "screen.cpp"
int main(void)
{
unsigned short int i, j, x;
Screen *layar = new Screen();
layar->setCursorPos(3,3);layar->writeString("Contoh Progress Bar");
layar->setCursorPos(4,3);layar->writeString("-------------------");
layar->setCursorPos(5,3);layar->writeString("Waktu Jeda Maks 3 detik : ");
layar->setCursorPos(8, 3);layar->writeChar(0xb3);
layar->setCursorPos(8,30);layar->writeChar(0xb3);
layar->setCursorPos(7, 3);layar->writeChar(0xda);
layar->setCursorPos(7,30);layar->writeChar(0xbf);
layar->setCursorPos(9, 3);layar->writeChar(0xc0);
layar->setCursorPos(9,30);layar->writeChar(0xd9);
Selasa, 15 November 2011
Contoh program penjualan (c++)
#include "conio.h"
#i nclude "iostream.h"
#include "stdio.h"
main()
{
struct
{
char kosir[3], nasir[30], pasword[7];
}ksr;
struct
{
char kobar, nabar[20];
int harga, jumli, total, bayar, kembali;
}brng;
contoh Penjualan tiket (c++)
#include "conio.h"
#include "iostream.h"
#include "stdio.h"
main()
{
char kosir[3], kopal[3], nasir[30], napal[30], nampang[30], alpang[30], jk, kelamin[15], ulang;
int jumli, harga, total, diskon, totkes, ubay, kembali;
awal:
clrscr();
puts("********************************************");
puts("* PENJUALAN TIKET KAPAL LAUT PELNI *");
puts("********************************************");
Senin, 14 November 2011
Buat bingkai (c++)
#include "conio.h"
#include "dos.h"
#include "stdlib.h"
#include "screen.cpp"
int main(void)
{
UCHAR i, j;
Screen *layar = new Screen();
layar->setAttribute(0x09);
layar->setCursorPos( 5,10);layar->writeChar(0xda);
layar->setCursorPos( 5,70);layar->writeChar(0xbf);
layar->setCursorPos(20,10);layar->writeChar(0xc0);
layar->setCursorPos(20,70);layar->writeChar(0xd9);
kalkulator (c++)
#include "math.h"
#include "stdlib.h"
#include "screen.cpp"
#include "keyboard.cpp"
#include "mouse.cpp"
int main(void)
{
Screen *layar = new Screen();
Keyboard *tombol = new Keyboard(layar);
Mouse *tikus = new Mouse();
UCHAR *str, str2[11];
double n1, n2, nh;
int a, b;
USHORT x, y, i;
Minggu, 13 November 2011
25 Strategi yang Menjamin Blog Anda Sukses
1. Kerja keras, kerja keras, dan kerja keras.
2. Jadilah ahli di bidangnya
3. Kenali audience anda
4. Mulai menulis sekarang juga!
5. Banyaklah menulis
6. Simpan draft untuk posting anda
7. Tulis posting yang unik!
8. Tulis posting yang berdasar riset
9. Tulis posting yang ringkas
2. Jadilah ahli di bidangnya
3. Kenali audience anda
4. Mulai menulis sekarang juga!
5. Banyaklah menulis
6. Simpan draft untuk posting anda
7. Tulis posting yang unik!
8. Tulis posting yang berdasar riset
9. Tulis posting yang ringkas
login (c++)
#include "conio.h"
#include "dos.h"
#include "string.h"
#include "stdlib.h"
#include "screen.cpp"
#define KEY_INT 0x16
#define KEY_BACKSPACE 0x08
#define KEY_RETURN 0x0d
#define KEY_TAB 0x09
#define KEY_SPACE 0x20
#define NULL 0x00
#define TRUE 1
UCHAR *getString(Screen *scr, UCHAR *str, UCHAR max);
UCHAR *getPwdString(Screen *scr, UCHAR *pwd, UCHAR max);
int main(void)
{
Screen *layar = new Screen();
UCHAR *nama, nama2[21], *sandi=0, *login, login2[21];
UCHAR i, re;
unsigned short int cocok;
#include "dos.h"
#include "string.h"
#include "stdlib.h"
#include "screen.cpp"
#define KEY_INT 0x16
#define KEY_BACKSPACE 0x08
#define KEY_RETURN 0x0d
#define KEY_TAB 0x09
#define KEY_SPACE 0x20
#define NULL 0x00
#define TRUE 1
UCHAR *getString(Screen *scr, UCHAR *str, UCHAR max);
UCHAR *getPwdString(Screen *scr, UCHAR *pwd, UCHAR max);
int main(void)
{
Screen *layar = new Screen();
UCHAR *nama, nama2[21], *sandi=0, *login, login2[21];
UCHAR i, re;
unsigned short int cocok;
menghitung volume kubus (c++)
#include "conio.h"
#include "iostream.h"
float volkubus(float sisi);
main()
{
#include "iostream.h"
float volkubus(float sisi);
main()
{
eject cdroom (menggunakan visual c 2008)
#include "stdafx.h"
#include "windows.h"
#include "mmsystem.h"
int _tmain(int argc, _TCHAR* argv[])
{
MCI_OPEN_PARMS open;
DWORD flags;
BOOL bOpenDrive = TRUE;
ZeroMemory(&open, sizeof(MCI_OPEN_PARMS));
#include "windows.h"
#include "mmsystem.h"
int _tmain(int argc, _TCHAR* argv[])
{
MCI_OPEN_PARMS open;
DWORD flags;
BOOL bOpenDrive = TRUE;
ZeroMemory(&open, sizeof(MCI_OPEN_PARMS));
listing program game stack (mengunakan c++)
#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
char pil;
int jml;
void delay();
struct node
{
char kar;
node *next;
};
node *tail; //ekor
node *now;
node *head;
void buatnodebaru()
{
tail=NULL;
head=NULL;
}
void push(char ch)
{
now=new node;
if(head==NULL)
{
now->kar=ch;
now->next=NULL;
tail=now;
head=now;
}
else
{
now->kar=ch;
now->next=NULL;
tail->next = now;
tail=now;
}
}
void enqueue()
{
int i;
char temp;
gotoxy(1,6);
cout<<" ";
gotoxy(1,8);
cout<<" ";
gotoxy(1,6);
cout<<"masukkan @ karakter : ";
cin>>temp;
gotoxy(1,6);
cout<<" ";
push(temp);
for(i=1;i<= 75-jml*6;i++)
{
gotoxy(i+1,20);cout<<" O";
gotoxy(i,21); cout<<"=("<<now->kar<<")=";
gotoxy(i+1,22);cout<<"| |";
delay();
if(i!=75-jml*6)
{
gotoxy(i+1,20);cout<<" ";
gotoxy(i,21);cout<<" ";
gotoxy(i+1,22);cout<<" ";
}
}
}
void dequeue()
{
if(head==NULL)
{
gotoxy(1,8); cout<<"antrean kosong !";
delay();
}
else
{
jml=jml-1;
char delete_element=head->kar;
node *temp;
temp=head;
head=head->next;
delete temp;
for(int i=69;i<=76;i++)
{
gotoxy(i+1,20); cout<<" O";
gotoxy(i,21); cout<<"=("<<delete_element<<")=";
gotoxy(i+1,22); cout<<"| |";
delay();
gotoxy(i+1,20); cout<<" ";
gotoxy(i,21); cout<<" ";
gotoxy(i+1,22); cout<<" ";
}
int byk=0;
while(byk!=jml)
{
byk=byk+1;
for(int i=69-byk*6;i<=75-byk*6;i++)
{
gotoxy(i+1,20); cout<<" O";
gotoxy(i,21); cout<<"=("<<head->kar<<")=";
gotoxy(i+1,22); cout<<"| |";
delay();
if(i!=75-byk*6)
{
gotoxy(i+1,20); cout<<" ";
gotoxy(i,21); cout<<" ";
gotoxy(i+1,22); cout<<" ";
}
}
}
}
}
void input()
{
gotoxy(1,1);cout<<"1.Enqueue";
gotoxy(1,2);cout<<"2.Dequeue";
gotoxy(1,3);cout<<"3.Exit";
do
{
gotoxy(1,4);cout<<"masukkan pilihan anda[1/2/3] : ";
gotoxy(32,4);cin>>pil;
gotoxy(32,4);cout<<" ";
switch(pil)
{
case '1':
{
if(jml<10)
{
jml=jml+1;
enqueue();
}
else
{
gotoxy(1,8); cout<<"antrean penuh !";
delay();
gotoxy(1,8); cout<<" ";
}
break;
}
case '2':
{
dequeue();
break;
}
case '3':
{
exit(1);
break;
}
}
}while(1);
}
void main()
{
buatnodebaru();
jml=0;
clrscr();
input();
getch();
}
void delay()
{
for(int y=1;y<100;y++)
for(int x=1;x<100;x++)
for(int p=1;p<100;p++)
cout<<"";
}
#include <conio.h>
#include <stdlib.h>
char pil;
int jml;
void delay();
struct node
{
char kar;
node *next;
};
node *tail; //ekor
node *now;
node *head;
void buatnodebaru()
{
tail=NULL;
head=NULL;
}
void push(char ch)
{
now=new node;
if(head==NULL)
{
now->kar=ch;
now->next=NULL;
tail=now;
head=now;
}
else
{
now->kar=ch;
now->next=NULL;
tail->next = now;
tail=now;
}
}
void enqueue()
{
int i;
char temp;
gotoxy(1,6);
cout<<" ";
gotoxy(1,8);
cout<<" ";
gotoxy(1,6);
cout<<"masukkan @ karakter : ";
cin>>temp;
gotoxy(1,6);
cout<<" ";
push(temp);
for(i=1;i<= 75-jml*6;i++)
{
gotoxy(i+1,20);cout<<" O";
gotoxy(i,21); cout<<"=("<<now->kar<<")=";
gotoxy(i+1,22);cout<<"| |";
delay();
if(i!=75-jml*6)
{
gotoxy(i+1,20);cout<<" ";
gotoxy(i,21);cout<<" ";
gotoxy(i+1,22);cout<<" ";
}
}
}
void dequeue()
{
if(head==NULL)
{
gotoxy(1,8); cout<<"antrean kosong !";
delay();
}
else
{
jml=jml-1;
char delete_element=head->kar;
node *temp;
temp=head;
head=head->next;
delete temp;
for(int i=69;i<=76;i++)
{
gotoxy(i+1,20); cout<<" O";
gotoxy(i,21); cout<<"=("<<delete_element<<")=";
gotoxy(i+1,22); cout<<"| |";
delay();
gotoxy(i+1,20); cout<<" ";
gotoxy(i,21); cout<<" ";
gotoxy(i+1,22); cout<<" ";
}
int byk=0;
while(byk!=jml)
{
byk=byk+1;
for(int i=69-byk*6;i<=75-byk*6;i++)
{
gotoxy(i+1,20); cout<<" O";
gotoxy(i,21); cout<<"=("<<head->kar<<")=";
gotoxy(i+1,22); cout<<"| |";
delay();
if(i!=75-byk*6)
{
gotoxy(i+1,20); cout<<" ";
gotoxy(i,21); cout<<" ";
gotoxy(i+1,22); cout<<" ";
}
}
}
}
}
void input()
{
gotoxy(1,1);cout<<"1.Enqueue";
gotoxy(1,2);cout<<"2.Dequeue";
gotoxy(1,3);cout<<"3.Exit";
do
{
gotoxy(1,4);cout<<"masukkan pilihan anda[1/2/3] : ";
gotoxy(32,4);cin>>pil;
gotoxy(32,4);cout<<" ";
switch(pil)
{
case '1':
{
if(jml<10)
{
jml=jml+1;
enqueue();
}
else
{
gotoxy(1,8); cout<<"antrean penuh !";
delay();
gotoxy(1,8); cout<<" ";
}
break;
}
case '2':
{
dequeue();
break;
}
case '3':
{
exit(1);
break;
}
}
}while(1);
}
void main()
{
buatnodebaru();
jml=0;
clrscr();
input();
getch();
}
void delay()
{
for(int y=1;y<100;y++)
for(int x=1;x<100;x++)
for(int p=1;p<100;p++)
cout<<"";
}
listing program game iseng" (c++)
#include <iostream.h>
#include <conio.h>
int main()
{
int ganjil;
do
{
cout<<"Masukkan bilangan ganjil (1-19): ";
cin>>ganjil;
}while(ganjil%2==0);
for(int i=0; i<=ganjil; i+=2)
{
for(int j=0; j<ganjil-i;j+=2)
{
cout<<" ";
}
for(int z=0;z<=i;z++)
{
cout<<"*";
}
cout<<endl;
}
ganjil = ganjil - 2;
for(int i=0; i<ganjil; i+=2)
{
for(int j=0; j<=i+2;j+=2)
{
cout<<" ";
}
for(int z=1;z<=ganjil-i;z++)
{
cout<<"*";
}
cout<<endl;
}
getch();
return 0;
}
#include <conio.h>
int main()
{
int ganjil;
do
{
cout<<"Masukkan bilangan ganjil (1-19): ";
cin>>ganjil;
}while(ganjil%2==0);
for(int i=0; i<=ganjil; i+=2)
{
for(int j=0; j<ganjil-i;j+=2)
{
cout<<" ";
}
for(int z=0;z<=i;z++)
{
cout<<"*";
}
cout<<endl;
}
ganjil = ganjil - 2;
for(int i=0; i<ganjil; i+=2)
{
for(int j=0; j<=i+2;j+=2)
{
cout<<" ";
}
for(int z=1;z<=ganjil-i;z++)
{
cout<<"*";
}
cout<<endl;
}
getch();
return 0;
}
Langganan:
Postingan (Atom)