Jumat, 11 Maret 2016
Kamis, 10 Oktober 2013
Delphi 7 ( Perhitungan Nilai, Input Biodata dan Perhitungan Casir dengan Pindah form )
16.02
No comments
UNIT 1
implementation
uses
unit2,unit3,unit4;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.Show;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Form3.Show;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
Form4.Show;
end;
end.
UNIT 2
implementation
uses
unit1;
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
var nilai_tugas,nilai_uts,nilai_uas,tugas,uts,uas,total:real;
var keterangan:string;
begin
tugas:=StrToFloat(Edit3.Text);
uts:=StrToFloat(Edit4.Text);
uas:=StrToFloat(Edit5.Text);
nilai_tugas:=(tugas*30)/100;
nilai_uts:=(uts*35)/100;
nilai_uas:=(uas*35)/100;
total:=(nilai_tugas+nilai_uts+nilai_uas);
Edit6.Text := FloatToStr(total);
if total >= 65 then
Edit7.Text := 'lulus'
else
Edit7.Text := 'tidak lulus';
end;
end.
UNIT 3
implementation
uses
unit1;
{$R *.dfm}
procedure TForm3.Button1Click(Sender: TObject);
var nama,tempat,kelamin,status,nama_anda,tempat_anda,kelamin_anda,status_anda:string;
var nim,umur,nim_anda,umur_anda:integer;
begin
nama:=string(Edit1.Text);
nim:=StrToInt(Edit2.Text);
umur:=StrToInt(Edit3.Text);
tempat:=String(Edit4.Text);
kelamin:=string(Edit5.Text);
status:=string(Edit6.Text);
Label3.Caption:=Edit1.Text;
Label4.Caption:=Edit2.Text;
Label9.Caption:=Edit3.Text;
Label10.Caption:=Edit4.Text;
Label11.Caption:=Edit5.Text;
Label12.Caption:=Edit6.Text;
end;
end.
UNIT 4
implementation
uses
unit1;
{$R *.dfm}
procedure TForm4.Button1Click(Sender: TObject);
var harga,diskon,total:real;
begin
harga:=StrToFloat(Edit2.Text);
diskon:=(harga*10)/100;
total:=harga-diskon;
Edit4.Text:=FloatToStr(diskon);
Edit5.Text:=FloatToStr(total);
end;
procedure TForm4.Button2Click(Sender: TObject);
var uang,kembali,total:real;
begin
uang:=StrToFloat(Edit6.Text);
total:=StrToFloat(Edit5.Text);
kembali:=uang-total;
Edit7.Text:=FloatToStr(kembali);
end;
procedure TForm4.Button3Click(Sender: TObject);
begin
close;
end;
end.
implementation
uses
unit1;
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
var nilai_tugas,nilai_uts,nilai_uas,tugas,uts,uas,total:real;
var keterangan:string;
begin
tugas:=StrToFloat(Edit3.Text);
uts:=StrToFloat(Edit4.Text);
uas:=StrToFloat(Edit5.Text);
nilai_tugas:=(tugas*30)/100;
nilai_uts:=(uts*35)/100;
nilai_uas:=(uas*35)/100;
total:=(nilai_tugas+nilai_uts+nilai_uas);
Edit6.Text := FloatToStr(total);
if total >= 65 then
Edit7.Text := 'lulus'
else
Edit7.Text := 'tidak lulus';
end;
end.
UNIT 3
implementation
uses
unit1;
{$R *.dfm}
procedure TForm3.Button1Click(Sender: TObject);
var nama,tempat,kelamin,status,nama_anda,tempat_anda,kelamin_anda,status_anda:string;
var nim,umur,nim_anda,umur_anda:integer;
begin
nama:=string(Edit1.Text);
nim:=StrToInt(Edit2.Text);
umur:=StrToInt(Edit3.Text);
tempat:=String(Edit4.Text);
kelamin:=string(Edit5.Text);
status:=string(Edit6.Text);
Label3.Caption:=Edit1.Text;
Label4.Caption:=Edit2.Text;
Label9.Caption:=Edit3.Text;
Label10.Caption:=Edit4.Text;
Label11.Caption:=Edit5.Text;
Label12.Caption:=Edit6.Text;
end;
end.
UNIT 4
implementation
uses
unit1;
{$R *.dfm}
procedure TForm4.Button1Click(Sender: TObject);
var harga,diskon,total:real;
begin
harga:=StrToFloat(Edit2.Text);
diskon:=(harga*10)/100;
total:=harga-diskon;
Edit4.Text:=FloatToStr(diskon);
Edit5.Text:=FloatToStr(total);
end;
procedure TForm4.Button2Click(Sender: TObject);
var uang,kembali,total:real;
begin
uang:=StrToFloat(Edit6.Text);
total:=StrToFloat(Edit5.Text);
kembali:=uang-total;
Edit7.Text:=FloatToStr(kembali);
end;
procedure TForm4.Button3Click(Sender: TObject);
begin
close;
end;
end.
Minggu, 09 Juni 2013
FUNGSI, CLASS, REKURSIF, FAKTORIAL, QUEUE, DAN STACK
01.40
No comments
#include
#include
#define nil NULL
#define max 5
#define stack_max 5
#include
using namespace std;
//FAKTORIAL===================================================================//
int faktorial(int f){
int rumus;
if(f==0)
return 1;
else
rumus = f*faktorial(f-1);
cout<<" "<l='A';
head=data1;
data2=(struct linked*)malloc(sizeof(struct linked));
data2->l='B';
data1->next=data2;
data3=(struct linked*)malloc(sizeof(struct linked));
data3->l='C';
data2->next=data3;
data3->next=nil;
//LINKED LIST=================================================================//
for(char ulang='y'; ulang=='y' || ulang=='Y';){
cout<<"================================================================================"<>pilih;
system("cls");
switch(pilih){
case 1: cout<<"================================================================================"<>r;
cout<<" = "<>f;
cout<<" = "<>sisi;
cout<<"MASUKAN PANJANG : "; cin>>panjang;
cout<<"MASUKAN LEBAR : "; cin>>lebar;
cout<<"LUAS PERSEGI : "<l<l<l<>kode;
switch(kode){
case 1: if(antri.belakang==(max-1))
{
cout<<"ANTRIAN PENUH"<>x;
antri.data[antri.belakang]=x;
cout<<"DATA "<<" "<>x;
antri.belakang++;
antri.data[antri.belakang]=x;
cout<<"DATA "<<" "<0 && kode<4);
return 0;
break;
case 6: do{
cout<>pilihan;
switch(pilihan){
case 1: if(tumpuk.top==(stack_max-1))
{
cout<<"TUMPUKAN PENUH"<>x;
tumpuk.top++;
tumpuk.data[tumpuk.top]=x;
}
break;
case 2: if(tumpuk.top==-1)
{
cout<<"TUMPUKAN KOSONG"<=0; i--)
{
cout<<"TUMPUKAN : "<0 && pilihan<4);
break;
case 7: cout<<"ANDA TELAH KELUAR DARI PROGRAM"< : "; cin>>ulang;
system("cls");
}
}
FUNGSI, CLASS, REKURSIF, FAKTORIAL, QUEUE, DAN STACK
01.40
No comments
#include
#include
#define nil NULL
#define max 5
#define stack_max 5
#include
using namespace std;
//FAKTORIAL===================================================================//
int faktorial(int f){
int rumus;
if(f==0)
return 1;
else
rumus = f*faktorial(f-1);
cout<<" "<l='A';
head=data1;
data2=(struct linked*)malloc(sizeof(struct linked));
data2->l='B';
data1->next=data2;
data3=(struct linked*)malloc(sizeof(struct linked));
data3->l='C';
data2->next=data3;
data3->next=nil;
//LINKED LIST=================================================================//
for(char ulang='y'; ulang=='y' || ulang=='Y';){
cout<<"================================================================================"<>pilih;
system("cls");
switch(pilih){
case 1: cout<<"================================================================================"<>r;
cout<<" = "<>f;
cout<<" = "<>sisi;
cout<<"MASUKAN PANJANG : "; cin>>panjang;
cout<<"MASUKAN LEBAR : "; cin>>lebar;
cout<<"LUAS PERSEGI : "<l<l<l<>kode;
switch(kode){
case 1: if(antri.belakang==(max-1))
{
cout<<"ANTRIAN PENUH"<>x;
antri.data[antri.belakang]=x;
cout<<"DATA "<<" "<>x;
antri.belakang++;
antri.data[antri.belakang]=x;
cout<<"DATA "<<" "<0 && kode<4);
return 0;
break;
case 6: do{
cout<>pilihan;
switch(pilihan){
case 1: if(tumpuk.top==(stack_max-1))
{
cout<<"TUMPUKAN PENUH"<>x;
tumpuk.top++;
tumpuk.data[tumpuk.top]=x;
}
break;
case 2: if(tumpuk.top==-1)
{
cout<<"TUMPUKAN KOSONG"<=0; i--)
{
cout<<"TUMPUKAN : "<0 && pilihan<4);
break;
case 7: cout<<"ANDA TELAH KELUAR DARI PROGRAM"< : "; cin>>ulang;
system("cls");
}
}
Senin, 20 Mei 2013
QUEUE LINKED LIST
10.00
No comments
#include
#include
#include
#include
#include
struct node{
int data;
struct node *link;
};
struct node *cur,*first,*last;
int create();
int insert();
int delte();
int display();
int create()
{
printf("\nENTER THE FIRST ELEMENT: ");
cur=(struct node *)malloc(sizeof(struct node));
scanf("%d",&cur->data);
cur->link=NULL;
first=cur;
last=cur;
}
int insert()
{
printf("\nENTER THE NEXT ELEMENT: ");
cur=(struct node *)malloc(sizeof(struct node));
scanf("%d",&cur->data);
cur->link=NULL;
last->link=cur;
last=cur;
}
int delte()
{
if(first==NULL)
{
printf("\t\nQUEUE IS EMPTY\n");
}
else
{
cur=first;
first=first->link;
cur->link=NULL;
printf("\n DELETED ELEMENT IS %d\n",cur->data);
free(cur);
}
}
int display()
{
cur=first;
printf("\n");
while(cur!=NULL)
{
printf("\t%d",cur->data);
cur=cur->link;
}
}
int main()
{
int ch;
while(1)
{
printf("\nPROGRAM QUEUE LINKED LIST\n");
printf("\n 1. CREATE \n 2. INSERT \n 3. DELETE \n 4. DISPLAY \n 5. EXIT \n");
printf("\nENTER YOUR CHOICE : ");
scanf("%d",&ch);
system("cls");
switch(ch)
{
case 1:
create();
display();
cout<
Rabu, 20 Maret 2013
Menghitung Volum Bangun Ruang
10.30
No comments
sedot lagi gan materi ini
#include
#include
float v_balok(float a, float b, float c){
return (a*b*c);
}
float v_kubus(float d){
return (d*d*d);
}
float v_kerucut(float e, float f){
float pi = 3.14;
return (pi*e*e*f)/3;
}
float v_bola(float g){
float pi = 3.14;
return (4*pi*g*g*g)/3;
}
int main(){
char pil;
float pi = 3.14;
float p, l, t, s, r;
int kode;
for(char ulang = 'y'; ulang == 'y' || ulang =='Y' ; ){
cout<<" PROGRAM MENGHITUNG BANGUN RUANG "<>ulang;
system("cls");
}
}
09.59
No comments
sedot sedot ilmunya
#include
using namespace std;
class mahasiswa{
public:
int algoritma() {return krs_algoritma;}
int organisasi() {return krs_organisasi;}
int ski() {return krs_ski;}
int diskrit(){return krs_diskrit;}
int arab(){return krs_arab;}
int islam(){return krs_islam;}
int so(){return krs_so;}
int ppk(){return krs_ppk;}
int sks_algoritma(int);
void sks_organisasi(int);
void sks_ski(int);
void sks_diskrit(int);
void sks_arab(int);
void sks_islam(int);
void sks_so(int);
void sks_ppk(int);
private:
int krs_algoritma;
int krs_organisasi;
int krs_ski;
int krs_diskrit;
int krs_arab;
int krs_islam;
int krs_so;
int krs_ppk;
};
int mahasiswa::sks_algoritma(int x){krs_algoritma=x;}
void mahasiswa::sks_organisasi(int x){krs_organisasi=x;}
void mahasiswa::sks_ski(int x){krs_ski=x;}
void mahasiswa::sks_diskrit(int x){krs_diskrit=x;}
void mahasiswa::sks_arab(int x){krs_arab=x;}
void mahasiswa::sks_islam(int x){krs_islam=x;}
void mahasiswa::sks_so(int x){krs_so=x;}
void mahasiswa::sks_ppk(int a){krs_ppk=a;}
int main(){
mahasiswa pak_sumar, pak_awik, bu_herawati, pak_landung, tim, pak_mukalam, pak_bambang, tim_ppk;
pak_sumar.sks_algoritma(4);
pak_awik.sks_organisasi(3);
bu_herawati.sks_ski(2);
pak_landung.sks_diskrit(2);
tim.sks_arab(2);
pak_mukalam.sks_islam(2);
pak_bambang.sks_so(4);
tim_ppk.sks_ppk(1);
cout<<"NIM : 12651088"<
Langganan:
Postingan (Atom)