Wednesday, November 19, 2014

java programming language

java is a programming language 

                                java is an innovative programming language that has become the language of choice for programs that need to run on variety of different computer systems.                                   


        evolution of java      

            in 1990 sun micro systems decided to develop a special software that could manipulate electronic devices. year 1991 team announced a new language it named "oak".
after wards in year 1992 a team called green project develop first application with the new language oak. year 1993 is the year world wide web (WWW) appear on internet. green project team came with the idea of developing a web page with new language. team developed a web browser called "hot java" in year 1994. finally oak was renamed to "java". java introduced as the leader for internet programming language. 

features of java

- java is compiled and interpreted
- platform independent
- fully object oriented
- robust & secure
- distributed
- multithreaded 
- high performance 
java is compiled and interpreted 



java is platform independent 
                                       
            the JVM (java virtual machine) is the environment in which java programs execute.
it is a software that is implemented on top of real hardware and operating system.when the source code.(.java files) is compiled it is translated into byte codes and then placed into(.class) files. the JVM executes these byte codes.

java application programming interface (java API) 
                                           
                                                      java API is a set of software components that provides the facilities you need to develop fully fledged interactive applications in java.


installing jdk 

      downloading and installing j2se software on windows platform to download j2se development and download j2se on your machine. the java platform or (jdk) can be downloaded
form the sun. formerly know as the java development kit or jdk downloading java is really about downloading the java platform that comes in three editions j2me j2se and j2ee if you are learning java then you should start by downloading j2ee. once you have downloaded the j2se on your system you are ready to install. in the following section we will learn how to install jdk development environment on your machine. here are the step to install jdk on your windows machine.

step 1
                                                                           
double click the jdk downloaded file the executable extracts the required contents to the temporary directory and then licence agreement screen appears. on the license agreement page read and accept the license and the click the next button.



step 2
             the custom setup screen appears as follows


    

step 3
            click on the change button to change the installation directory to "c:\jdk1.5.0_06" as shown in the following screen and click on the "ok" button after clicking on the "OK" button installation begins.

 
step 4
            in the next window installer asks for the installing the run time as shown in the following screen.


step 5
          click on next button install the j2se run time on your machine. next screen shows the browser selection.
step 6
           once the installation is finished it shows you the final screen indications the success now you have successfully installed j2se on your machine. installer shows the following final conformation window as shown below.



                                  configuring the installation on windows machine
                                     
                                                 in this section we will add some settings to the windows environment so that the java compiler and run time becomes available for compiling and running the java application. go to the control panel and double click on "system properties" and go to the advance tab. select environment variables.



add  "c:\jdk1.5.0_06" to path variable in system variables.




click here to download java keywords

pseudo codes

pseudo codes

                           pseudo code is structured English like way of representing the solution to a problem. it is considered a first draft because pseudo code is like English and has some precision to it , it does not have the very definite precision of a programming language. a computer cannot execute pseudo code. it can be translated in to a variety of programming language

data declaration 


            it is important to define all data used by a program within the pseudo code as the following is one of the fundamental concepts in programming. 
                    program = data + algorithm (logic)
           there are 3 main things to con ceder when declaring data in programs 
       1. data type   - specify the type of value that can be stored.
          2. data usage - whether the data item is used as a variable or a constant
          3. data scope - specify the limit of access within the program


                data type 

1.simple data
       data items which can store single values
                        name : string
                        age    : integer
                        marks: real
2.complex data
      data item which allows you to store collection of values.
                       class marks (10): array of integer
                       student data : record of
                       name            : string
                       age               : integer

               data usage 


     1.variables
                variables are data items of any type whose contents may change in value as the programs executes.
            counter = counter+1
            massage = "hello world"

     2.constants 
               constants are either literal values or data items whose contents do not change as the program executes.
           counter = counter+1
           massage = "hello world"
           pi : real values 3.524

                        data scope 

   1.global 
           data which is accessible by the procedure in which it is defined and by all procedures directly subordinate to that procedure


   2.local
           data which is accessible only by the procedure in which it is defined. 

                   data declaration within a program
      global data:
      pi : real value3.524
      local data:
      counter,total : integer


constructs 
1. sequence
      a saris of instructions executed one after the other
e.g;
     input number of items purchased   
       input price per item
       total cost = number of items purchased * price per item
       display total cost

2. selection
      a selection control structure is the presentation of a condition and the choice between two actions the choice depending on whether the condition is true or false.

e.g;
      IF condition THEN
                command sequence 1
        ELSE
                command sequence 2
        END IF
  
      IF average >50 THEN
                display "pass"
         ELSE
                display "fail"
        END IF
                                                 if the choice is between more than two alternatives then we need a multiple selector.

       CASE statement
                 1 : command sequence 1
                 2 : command sequence 2
      ELSE
                 default command sequence
      END CASE

e.g:
      IF average >= 80 THEN
                              grade :="A"
                          ELSE IF average >= 65 THEN
                                                    grade ="B"
                                               IF average >=50 THEN
                                                                 grade ="C"
                                                                ELSE IF average >=35
                                                                      grade ="S"
                                                                ELSE
                                                                     grade ="F"
                                                            END IF
                                                END IF
                                END IF
                 END IF

3. repetition 
          the repetition control structure can be defined as the presentation of instruction to be performed rapidly as long as the condition is true.
     while loop
              WHILE condition P is true DO 
                           statement block
                    END DO
     repeat / until loop
             REPEAT
                          statement block
                  UNTIL condition P is false 
     for loop
            FOR x = to 10 DO
                          statement block
                 END DO


procedure / function 

      procedure: a selection of program that carries out some well defined operation on data specify by parameter. it can be called from any ware in the program and different parameters can be provided for each call.
      function: the different between a procedure and the function is that the function is that the function will return a single value after called where as a procedure do a particular task but not necessarily return a value.

            important points regarding function / procedures
       
                                 to return a value from a function it should be assigned to the function name. each module can defined its own data. the data item passed into the function at the time of call are called parameters. the parameters may be input or output based on their role. input parameters only carry value into the module. output parameters take a result back to the caller.

how to use pen drive as a ram

how to use pen drive as a ram
                             to make your pen drive of large size of ram. which will your system faster. how to do this follow bellow steps.

1.insert your pen drive and delete all items (minimum 2 GB)

2. next right click my computer click on properties
    menu.

3. now click on advance system properties. click on advance tab 

4.click on performance settings. now will show performance options.

5.next click on advance.
6.click change icon.
7.now you will see your pen device. select your drive and mark custom settings

8. change initial size 1020
                maximum size 1020 and click on set

9. next click OK button and restart you computer to
    take the effect.

Flowcharts

flowcharts

a flowchart is a diagrammatic representation of the processes involved in arriving at a solution to a problem.



                      structured programming

 the structured programming uses three control constructs namely
       1. sequence 
       2. selection
       3. repetition

  1. sequence flowcharts to input two numbers and there after
      calculate and display the average.


  2. selection flowchart to input 2 numbers and there after             evaluate and display the maximum value 

  3. repetition flowchart to calculate and display the first 5 
      natural numbers



how to use pen drive as a ram

how to use pen drive as a ram
                             to make your pen drive of large size of ram. which will your system faster. how to do this follow bellow steps.

1.insert your pen drive and delete all items (minimum 2 GB)

2. next right click my computer click on properties
    menu.

3. now click on advance system properties. click on advance tab 

4.click on performance settings. now will show performance options.

5.next click on advance.
6.click change icon.
7.now you will see your pen device. select your drive and mark custom settings

8. change initial size 1020
                maximum size 1020 and click on set

9. next click OK button and restart you computer to
    take the effect.

object oriented programming in java (OOPs)

object oriented programming 
                                    object oriented programming is an emerging major programming paradigm. an object is a particular instance of a class and consists, essentially, of data which defines its characteristics and current status together with procedures or "methods" which operate on the object.


computer program 
                        computer program is a sequence instructions that when performed in a computer carry out a particular task.two ways to run a program. 
       1.sequential processing 
       2.concurrent processing 

1. sequential processing 
            the instruction are performed one after the other the computer. the program is stored in the memory and instructions are fetch one by one and execute within the CPU.

2. concurrent processing 
            the instructions are performed in parallel within the computer. this may be done using multiple processors or using the same processor with time sharing.


concept of algorithm 
                      when we want to design and implement a program it is important to develop a 'blueprint' of the program which details the step by step procedure in arriving at the solution. such 'blueprint' is celled an algorithm.

comparison of programming styles in java

comparison of programming styles

1.structured programming
                     developed during the 1950s after edger dijstardijistar's insightful comments           into the harmful nature of the GO to statement.dijikstar and others subsequently               created a set of acceptable structures in programming that would enable
      development without GO to statements.

2.unstructured programming 
                 this is a programming style that was used before 'structured' programming and         predominantly used with lower level languages.they accomplished the required                 control of the program by using GOTO statements.

generation of programming languages

generation of programming languages

  1st generation  machine language
                     * data represented in 1s & 0s 
                 * this digit may correspond to electricity's being on/ off in the computer also
                 * correspond to a magnetic charge being present/ absent on storage media 
    
          e.g: ASCII & Unicode

 2nd generation assembly language
                     * use abbreviations/ mnemonics 
                 * that automatically converted to appropriate sequence of 1st & 0s 

       e.g: ADD

3rd generation high level procedural language
               * people more understand in these English like programming languages
               * in this generation it is designed to express the logic,procedures
               * that can solve general problems

4th generation task oriented language
              * very high level languages,designed to solve specific problems
              * require little special training on the part of the user 
              * non procedural & focus on specifying specific task 
              * it used to develop financial models

      e,g: IFPS

5th generation problem & constraint languages
                * computer language that incorporates the concepts of artificial intelligence to                    allow a person to provide system 
             * a problem & some constraint, then request a solution.




What is mean by programming?

what is mean by programming?

computer programming is the art of making a computer do what you want it to do.at the very simplest level consists of issuing a sequence of commands to a computer to achieve an objective writing software,computer programs,is describe how to do something.

what is mean by program?

what is mean by program?

a program is a set of instructions that are grouped together to accomplish a task or task. these instructions can be given to a computer