Tips for heathy life

Tips for heathy life

Minggu, 02 November 2008

Dispay array in C++ programme

I want to share program that display array in C++. You can use this code but if you copy this code and paste in your blog/website, please insert this link of article. #include <> #include <> #include <> void main ( ) { clrscr( ); int nilai[6] = {4,2,3,5,1,6}; int i; for(i=1;i<6 i=""><<"="; cout <<:i endl=""&g...

How to display 10 integer and summation of that integer in C++?

I want to share how to display 10 integer and summation. You can use this code but if you copy this code and paste in your blog/website, please insert this link of article. --------------------- #include #include void main ( ) { clrscr( ); int i,x,jml; int index[10] = {1,2,3,4,5,6,7,8,9,10}; for(i=1;i<11 br="" i=""> { cout<<"Input integer number- "< cin< jml=x; jml=jml+x; cout<<"Total of integer = "< } getch( ); } Normal 0 false false false EN-US ...

How make program that calculates flat wake in C++?

I want to share program that calculate flat wake in C++. You can use this code but if you copy this code and paste in your blog/website, please insert this link of article. -------- #include#includevoid main ( ){ const float phi=3.14; float r,a,t,kell,luas; int kode; char pilih; awal : cout<<"||======================================||"<<<"||Program menghitung rumus bangun datar ||"<<<"||======================================||"<<<"\n 1. Keliling Lingkaran "<<<"2. Luas Segitiga "<<<"\n...

How make display date in pascal?

I want to share program that display date in Pascal. You can use this code but if you copy this code and paste in your blog/website, please insert this link of article. Date Programme (input,output); uses wincrt; const teks='Input date on mm dd yy(0 0 0 to stop)'; typestring=string[20]; arraytipestring=array[1..12] of tipestring; var month,day,year:integer; outputdate:tipestring; namemonth:arraytipestring; Procedure displaynamemonth(var namemonth:arraytipestring); begin namemonth[1] :='Januari'; namemonth[2] :='Februari'; namemonth[3]...

BUBLE ASCENDING in Pascal

Program Buble_Ascending_09; uses wincrt; var i,k, temp:integer; L:array[1..5] of integer; flag:boolean; begin clrscr; L[1]:=1; L[2]:=50; L[3]:=10; L[4]:=3; L[5]:=2; flag:=false; i:=1; while (i<5 and="" br="" do="" flag="" not=""> begin flag:=true; for k:=5 downto 1 do if(L[k] begin temp:=L[k]; L[k]:=L[k-1]; L[k-1]:=temp; flag:=false; end; inc(i); end; begin for i:=1 to 5 do writeln(L[i],' '); writeln; end; en...

STACK in Pascal

Program ArrayStack; uses wincrt; const max=10; var Top,i:byte; Pil,temp,e:char; Stack:array [1..max] of char; Procedure PushAnim; begin for i:=1 to 18 do begin gotoxy(23+i,7);write(temp);{delay(30); } gotoxy(23,7);clrEol; end; for i:=1 to 14-top do begin {delay(30); } gotoxy(41,6+i);write(' '); gotoxy(41,7+i);write(temp); end; end; Procedure PopAnim(temp:char); begin for i:=1 to 14-top do begin {delay(30); } gotoxy(41,22-i-top);write(temp);{delay(30); } gotoxy(41,21-i-top);ClrEol; end; end; Procedure Push(e:char); begin inc(top); Stack[top]:=e; PushAnim; end; Procedure...

ARRAY in Pascal

uses wincrt; var data:array[1..7,1..7] of byte; baris,kolom:integer; begin for baris:=1 to 7 do begin for kolom:=1 to 7 do if (baris=kolom) or (baris+kolom=8) or (baris=4) or (kolom=4) then data[baris,kolom]:=0 else data[baris,kolom]:=1; end; for baris:=1 to 7 do begin for kolom:=1 to 7 do write(' ',data[baris,kolom]); writeln; end; e...

Jumat, 31 Oktober 2008

Selection Operator 1 in Java

String status = ""; int grade = 80; //mendapatkan status pelajar status = (grade >= 60)?"Passed":"Fail"; //print status System.out.println( status...

Logical NOT Operator in Java

boolean val1 = true; boolean val2 = false; System.out.println(!val1); System.out.println(!val...

Relation Operator

I want to share about relation operator. You can use this code but if you copy this code and paste in your blog/website, please insert this link of article. ---------------- int i = 37; int j = 42; int k = 42; System.out.println("Nilai variabel..."); System.out.println(" i = " + i); System.out.println(" j = " + j); System.out.println(" k = " + k); //lebih besar dari System.out.println("Lebih besar dari..."); System.out.println(" i > j = " + (i > j)); //false System.out.println(" j > i = " + (j > i)); //true System.out.println(" k >...

VERIFIED PASSWORD and USER NAME in Java SE

String user=""; String pwd=""; user = JOptionPane.showInputDialog("Masukkan username anda : "); pwd = JOptionPane.showInputDialog("Masukkan password anda: "); String msg = "Welcome to java programming language, " + user + " !"; String msg2 = " Verfikasi password anda: " + "password anda = "+pwd; JOptionPane.showMessageDialog(null, msg); JOptionPane.showMessageDialog(null, msg...

Kamis, 30 Oktober 2008

Find for the last word from JOPTIONPANE version in J2SE

Normal 0 false false false EN-US X-NONE X-NONE ...

Find for the last word from BUFFEREDREADER version in J2SE

Normal 0 false false false EN-US X-NONE X-NONE ...

Average FIGURE FROM THREE in J2SE

Normal 0 false false false EN-US X-NONE X-NONE ...