Sunday, April 24, 2011

C + + program to calculate the area of ​​a circle, square area, circumference of a circle

Calculate the area of ​​a circle, square or circle around the area may need branching to the program, and for now I use a switch case.
Directly to the heart of the matter, I've created this program as simple as possible to avoid mistakes for new programmers to learn,,
This time I give direct his script c + +, so you can simply copy and paste :




#include <iostream.h>
#include <conio.h>
#include <iomanip.h>

main() {
     int l,p,r,pil,t;
     float Luas,Kel;
     const float phi=3.14;
     bool jwb;

cek:
cout<<"Pilihan menu :\n";
cout<<"[1] Luas Lingkaran \n";
cout<<"[2] Luas Persegi \n";
cout<<"[3] Keliling Lingkaran \n";
cout<<"Masukkan pilihan anda : ";cin>>pil;

switch (pil){
    case 1 :
       cout<<"Masukkan jari-jari : ";cin>>r;
      Luas=phi*(r*r);
      cout<<"\nLuas Lingkaran : "<<Luas<<endl<<endl;
      cout<<"Anda ingin mengulang?[1=ya,0=tdk] ";cin>>jwb;
      if(jwb==1)
        goto cek;
      else
        cout<<"Terima kasih";
      break;
   case 2 :
       cout<<"Masukkan panjang : ";cin>>p;
      cout<<"Masukkan lebar : ";cin>>l;
      Luas=p*l;
      cout<<"\nLuas Persegi : "<<Luas<<endl<<endl;
      cout<<"Anda ingin mengulang?[1=ya,0=tdk] ";cin>>jwb;
      if(jwb==1)
        goto cek;
      else
        cout<<"Terima kasih";
      break;
   case 3 :
       cout<<"Masukkan jari-jari : ";cin>>r;
      Kel=(phi*r)*2;
      cout<<"\nKeliling Lingkaran : "<<Kel<<endl<<endl;
      cout<<"Anda ingin mengulang?[1=ya,0=tdk] ";cin>>jwb;
      if(jwb==1)
        goto cek;
      else
        cout<<"Terima kasih";
      break;
   default :
       cout<<"Maaf pilihan menu yang anda inputkan tidak terdaftar ";}

getch();}



And when you run the program, the display will come out like this



You now can select the menu :)

Saturday, April 23, 2011

Do - while structure in java

Do-while structures similar to the while loop, only difference is located at
placement condition only. On the structure while the condition is located at the beginning of the block
repetition, sedagkan on the structure of do-while loop is located at the end of the block. Process
repetition will be performed at least once even if it turns out the condition is not fulfilled
(is false).


A common form of writing:
initialization
do {
/ / statement that will be repeated
...
iteration
} while (condition);



example program :


the results of the program will be like this :

Calculate interest and investment in java

Calculating Investment and bank interest may be thought of difficult and complicated, but this time I'll share a little about how to make the program
For this program I'm using JCreator Version 4:50 for those who use other programs can adapt.

Let us write codingnya,


import java.io.*;
class inputBilangan
{
   public static void main(String[]args)throws IOException


        String temp;
            double  bilangan;
        double pokok;   
        double sukubunga;
        double bunga;
        double total;


    InputStreamReader isr = new InputStreamReader(System.in);   
    BufferedReader bil = new BufferedReader (isr);

  System.out.print(" Saldo Rekening Anda: ");         

    temp = bil.readLine();
    bilangan = Integer.parseInt(temp);
   
   
        sukubunga = 0.10;    // sama dengan 10%
        bunga = bilangan * sukubunga;

        total = bilangan + bunga;
   
 
System.out.println("\n Saldo yang anda inputkan " + "adalah  : " + bilangan);  
System.out.println(" Bunga yang dihasilkan " + "adalah     : " + bunga);  
System.out.println(" Investasi selama 1 tahun " + "adalah  : " + total);   
  }
}



and it looks like this will be





hopefully useful

How to create password form in visual basic

Create a password is just a simple form if we know the coding required. First let's first appearance design, make the display as in the example below.



after the design is complete, let us type the coding on the button "OK",
okay coding has been completed, let's try running the program if password is wrong then it will exit the display as below
but if true, would exit the display like this,
so easy and simple is not it? good luck.



 



How to create login form in visual basic


Friday, April 22, 2011

Visual basic program conversion value

This time I will try to give a little explanation to make a conversion program value.
just, make a design look like this

After the design is complete, let's start with the coding in the button "OK"
type coding as shown in the picture


Coding is completed, the "exit" button type coding :
unload me


For coding "cancel" :
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus



Last step to run the program, the program will look like this
For the lazy writing I include examples of program coding:)
pass: ndrebekool

conversion value 

Monday, April 18, 2011

If the application in visual basic

For the second post, I want to discuss how to apply if the counting broad
straight course towards the problem, before make a design below,



After finished designing, enter the code in the page write the script as below 


last step is to run your program, good luck 
pass : ndrebekool
download sample program 



how to separating the warning username and password in java

Many are still difficulties in breaking pop up a username and password, so today I will explain how to break the pop-up username and password.
we just go coding in the login button,
type a script like the one below.

when you finish, let's try running the program.
and pop ups that will appear like this.


 Among my posts, may be useful :)

Sunday, April 3, 2011

Program Switch in Java

Switch statement is an alternative statement for the election statement. Usually
used to simplify the complexity of many if statement
containing conditions. The general form of writing is:

Switch (expression) {
case value1:
/ / statement which will be made if the same expression value1
break;
case value2:
/ / statement that will be done if the expression equal to value2
break;
...
nilaiN case:
/ / statement which will be made if the same expression nilaiN
break;
default:
/ / statement which will be made if all values
defined above do not have the same expression
}


Sample program Java

class DemoSwitch1 {
public static void main(String[] args) {
int noHari = 4;
switch (noHari) {
case 1:
System.out.println("Hari ke-" + noHari + " adalah Minggu");
break;
case 2:
System.out.println("Hari ke-" + noHari + " adalah Senin");
break;
case 3:
System.out.println("Hari ke-" + noHari + " adalah Selasa");
break;
case 4:
System.out.println("Hari ke-" + noHari + " adalah Rabu");
break;
case 5:
System.out.println("Hari ke-" + noHari + " adalah Kamis");
break;
case 6:
System.out.println("Hari ke-" + noHari + " adalah Jum\'at");
break;
case 7:
System.out.println("Hari ke-" + noHari + " adalah Sabtu");
break;
default:
System.out.println("Tidak ada hari ke-" + noHari);
}
}