Wednesday, July 11, 2018

constants , final and autoload functions [BCA Sem-3]


Q: What is Class constants ?
A constant is, just like the name implies, a variable that can never be changed. When you declare a constant, you assign a value to it, and after that, the value will never change. Normally, simple variables are just easier to use, but in certain cases constants are preferable, for instance to signal to other programmers (or your self, in case you forget) that this specific value should not be changed during runtime.
Class constants are just like regular constants, except for the fact that they are declared on a class and therefore also accessed through this specific class. Just like with static members, you use the double-colon (Scope resolution) operator to access a class constant. Here is a basic example
class user
{
    const DefaultUsername = "RAJARAM";
    const MinimumPasswordLength = 6;
}

echo "The default username is " . user::DefaultUsername;
echo "The minimum password length is " . user::MinimumPasswordLength;
?>

As you can see, it's much like declaring variables, except there is no access modifier - a constant is always publically available. As required, we immediately assign a value to the constants, which will then stay the same all through execution of the script. To use the constant, we write the name of the class, followed by the double-colon operator and then the name of the constant.

Q: Explain The "final" keyword
In some cases you may want to prevent a class from being inherited from or a function to be overridden. This can be done with the final keyword, which simply causes PHP to throw an error if anyone tries to extend your final class or override your final function.
A final class could look like this:
final class Animal
{
    public $name;
}
A class with a final function could look like this:
class Animal
{
    final public function Greet()
    {
        return "The final word!";   
    }
}
The two can be combined if you need to, but they can also be used independently, as seen in the examples above.

Q:EXPLAIN Autoloading Classes
The spl_autoload_register() function registers any number of autoloaders, enabling for classes and interfaces to be automatically loaded if they are currently not defined. By registering autoloaders, PHP is given a last chance to load the class or interface before it fails with an error.
If one class depends on another, if your application ever changes, you have to work extra hard to be sure that the relationships between your classes are maintainable. But with autoloading classes in PHP this may not be necessary.
·         __autoload( ) — Attempt to load undefined class , void __autoload ( string $class )
·         spl_autoload_register() - Register given function as __autoload() implementation


Example #1 Autoload example
This example attempts to load the classes MyClass1 and MyClass2 from the files MyClass1.php and MyClass2.php respectively.
spl_autoload_register(function ($class_name) {
    include $class_name . '.php';
});

$obj  = new MyClass1();
$obj2 = new MyClass2();
?>
Example #2 Autoloading with exception handling
This example throws an exception and demonstrates the try/catch block.
spl_autoload_register(function ($name) {
    echo "Want to load $name.\n";
    throw new Exception("Unable to load $name.");
});

try {
    $obj = new NonLoadableClass();
} catch (Exception $e) {
    echo $e->getMessage(), "\n";
}
?>
Example #3
Image.php
  class Image {
       
      function __construct() {
          echo 'Class Image loaded successfully
';
      }

  }
?>
Test.php
  class Test {
       
      function __construct() {
          echo 'Class Test working
';
      }

  }
?>
Myprg.php
function __autoload($class_name) {
    if(file_exists($class_name . '.php')) {
        require_once($class_name . '.php');   
    } else {
        throw new Exception("Unable to load $class_name.");
    }
}

try {
    $a = new Test();
    $b = new Image();
} catch (Exception $e) {
    echo $e->getMessage(), "\n";
}
?>

Thursday, August 10, 2017

Explain in brief EDVAC, ENIAC OR Write note on EDVAC, ENIAC.

EDVAC, the first modern stored program computer to be designed, used a central control unit that only interpreted four instructions. All ofthe arithmetic-related instructions were passed on to its arithmetic unit and further decoded there. ENIAC consumed an estimated 174 kW. By comparison, a typical personal computer may use around 400 W;over four hundred times less. ENIAC were able to process between 5and 100 operations per second A modern "commodity" microprocessor (as of 2007 )can process billions of operations per second. and many of these operations are more complicated and useful than early computer operations.

Define the programming tehchnique ?

Computer program, a set of instructions in a programming language, intended to be executed on a computer to perform a task. the term usually implies a self -contained entity, as opposed to a routine or a library.

Program, in computer science, synonymous with software: a sequence of instructions that can be executed by a computer. The term can refer to the original source code or to the executable(machine language) version. The term program implies a degree of completeness; that is a source code program comprises all statements and files necessary for complete interpretation or compilation , and executable program can be loaded into a given environment and executed independently of other programs.

Source code, in computer science, human readable program statements written in the high level or assembly language, as opposed to object code, which is derived from the source code and designed to be machine readable.

Object code,in computer science. the code, generated by a compiler or an assembler, that was translated from the source code of program. The term most commonly refers to machine code that can be directly executed by the system's central processing unit (CPU) but it can also be assembly language source code or variation of machine code Pre-programming tools available as follows:

Algorithm:
Algorithm, in mathematics. method of solving a problem by repeatedly using a simpler computational method. A basic example is the process of long division in arithmetic. The term algorithm is now applied to many kinds of problem solving that employ a mechanical sequence of steps, as in setting up computer program. The sequence may be displayed in the form of a flowchart in order to make it easier to follow. 

As with algorithms used in arithmetic, algorithms for computers can range from the simple to the highly complex. In all cases. however. the task that the algorithm is to accomplish must be definable. The definition may involve mathematical or logic terms or a compilation of data or written instructions. In terms of ordinary computer usage, this means that algorithms must be programmable, even if the tasks themselves turn out to have no solution. In computational devices with a built-in microcomputer logic, this logic is a form of algorithm. As computers increase in complexity more and more software algorithms are taking the form of what is called hard software. That is, they are increasingly becoming part of the basic circuitry of computers or are easily attached adjuncts, as well as standing alone in special devices such as payroll machines. Many different applications algorithms are now available, and highly advanced systems such as artificial intelligence algorithms may become common in the future.

Flow chart:
Flow chart sequential diagram employed in many fields to show the step-by-step procedures used in performing a task. as in manufacturing, or solving a problem. as in an algorithm. Flowcharts are commonly used in the designing of computer programs.

Saturday, June 4, 2016

//C first program  example
#include "stdio.h" 

void main()
{
  printf("Hello i am kalpesh rakholiya \n");
  
}
 
 

In Above program
  • first statement include STanDard Input Output library functions from stdio.h file to your program.
  • compilation of  C language program start from main function and it will return by default integer value but if you write void keyword then it will not return any value
  • void means nothing to return , or having no value.
  • printf functions definition is compiled from stdio.h file and it will be print string on the screen of output.
  • string is always in double quotation while character is always in single quotation.

Sunday, May 22, 2016

computer fundamental acronyms

EDVAC : ELECTRONIC DISCRETE VARIABLE AUTOMATIC COMPUTER

UNIVAC :UNIVERSAL VARIABLE AUTOMATIC COMPUTER
4GL :4TH GENERATION LANGUAGE
AGP: ACCELERATOR GRAPHIC PORT
AI: ARTIFICIAL INTELLIGENCE
ALU: ARITHMETIC AND LOGICAL UNIT
MU: MEMORY UNIT
CPU: CENTERAL PROCESSING UNIT
ANSI: AMERICAN NATIONAL STANDARD INSTITUTE
ASCII: AMERICAN STANDARD CODE FOR INFORMATION INTERCHANGE
BASIC :BEGINNERS ALL PURPOSE SYMBOLIC INSTRUCTION CODE
BCD :BINARY CODED DECIMAL
BIOS: BASIC INPUT OUTPUT SYSTEM
BIT: BINARY DIGIT
BPI: BITS PER INCHES
DPI: DOTS PER INCHES
CAD: COMPUTER ADDED DESIGN
CAM: COMPUTER ADDED MEMORY
CD-ROM: COMPACT DISK – READ ONLY MEMORY
C-DAC: CENTER OFR DEVELOPING ADVANCED COMPUTING
CGA :COLOR GRAPHIC ADAPTER
COBOL : COMMON BUSINESS ORIENTED LANGUAGE
CPI :CHARACTER PER INCH
CPS: CHARACTER PER SECOND
CPU: CENTRAL PROCESSING UNIT
CRT: CATHODE RAY TUBE
CTD: CARTRIDGE TAP DRIVE
CU :CONTROL UNIT
DBMS: DATABASE MANAGEMENT SYSTEM
RDBMS: RELATIONAL DATABASE MANAGEMENT SYSTEM
DDL :DATA DEFINITION LANGUAGE
DLL :DYNAMIC LINK LIBRARY
DMP :DOT MATRIX PRINTER
DOS :DISK OPERATING SYSTEM
DSS :DECISION SUPPORT SYSTEM
MIS :MANAGEMENT INFORMATION SYSTEM
TPS :TRANSACTION PROCESS SYSTEM
DTP :DESK TOP PUBLISHING
EBCDIC: EXTEDED BINARY CODED DECIMAL INTERCHAGE CODE
EDP: ELECTRONIC DATA PROCESSING
EDSAC: ELECTRONIC DELAY STORAGE AUTOMATIC CALCULATOR
EGA: ENHANCED GRPAHIC ADAPTER
ENIAC :ELECTRONIC NUMERICAL INTEGRATOR AND CALCULATOR
EPROM :ERASABLE PROGRAMMABLE READ ONLY MEMORY
FAT :FILE ALLOCATION TABLE
FDD :FLOPPY DISK DRIVE
FIFO: FIRST IN FIRST OUT
LIFO: LAST IN FIRST OUT
FORTRAN :FORMULA TRANSLATION LANGUAGE
FTP : FILE TRANSFER PROTOCOL
HTTP: HYPERTEXT TRANSFER PROTOCOL
SMTP: SIMPLE MAIL TRANSFER PROTOCOL
GB :GIGA BYTE
GIGO: GARBAGE IN GARBAGE OUT
GUI: GRAPHICAL USER INTERFACE
CLI: COMMAND LINE INTERFACE
HDD: HARD DISK DRIVE
IC :INTEGRATED CHIP
IRG: INTER RECORD GAP
KB :KILOBYTE
KBPS: KILOBYTE PER SECOND
MBPS: MEGABYTE PER SECOND
LAN :LOCAL AREA NETWORK
WAN :WIDE AREA NETWORK
MAN :Metropolitan Area Network
PAN :Personal Area Network
LCD :Liquid Crystal Display
LED :Light emitted diode
LSB :Least Significant Bit
LSI :Large scale integration
MODEM: Modulation – Demodulation
MICR: Magnetic Ink Character Reader
MSB :Most Significant Bit
SSI :SMALL SCALE INTEGRATION
MSI :MEDIUM SCALE INTEGRATION
VLSI: VERY LARGE SCALE INTEGRATION
ULSI: ULTRA LARGE SCALE INTEGRATION
KIPS: KNOWLEDGE INFORMATION PROCESSING SYSTEM
LIPS: LOGIC INFORMATION PROCESSING SYSTEM
DIPS: DATA INFORMATION PROCESSING SYSTEM
CRL :CAMPUTATIONAL RESEARCH LABORATORIES
SAW :SURFACE ACOUSTIC WAVE
OMR :OPTICAL MARK READER
OCR : OPTICAL CHARACTE READER
OBR :OPTICAL BARCODE READER
VDU :VISUAL DISPLAY UNIT
GPD :GAS PLASMA DISPLAY
ELD :ELECTRO LUMINESCENT DISPLAY
PDP :PLASMA DISPLAY PANEL
RAM :RANDOM ACCESS MEMORY
PROM: PROGRAMMABLE READ ONLY MEMORY
EEPROM: ELECTRICALLY ERASABLE PROGRAMMABLE READ ONLY MEMORY
EPROM :ERASABLE PROGRAMMABLE READ ONLY MEMORY
DVD :DIGITAL VERSATILE DISC
HVD :HOLOGRAPHIC VERSATILE DISC
USB :UNIVERSAL SERIAL BUS
GIS :GEOGRAPHICAL INFORMATION SYSTEM
GPS :GLOBAL POSITIONING SYSTEM
WI-MAX: WORLDWIDE INTEROPERABILITY FOR MICROWAVE ACCESS
WI-FI: WIRELESS FIDELITY
UTP: UNSHIELDED TWISTED PAIR
STP: SHIELDED TWISTED PAIR
CDPD: CELLULAR DIGITAL PACKET DATA
FDM :FREQUENCY DIVISON MULTIPLEXING
TDM :TIME DIVISION MULTIPLEXING
STDM :STATISTCAL TIME DIVISION MULTIPLEXING
WDM: WAVELENGTH DIVISON MULTIPLEXING
PCM: PULSE CODE MODULATED
TCP/IP: TRANSMISSION CONTROL PROTOCOL / INTERNET PROTOCOL
UDP: USER DATAGRAM PROTOCOL
POP: POST OFFICE PROTOCOL
ADSL: ASYNCHRONOUS DIGITAL SUBSCRIBER LINES
ARP :ADDRESS RESOLUTION PROTOCOL
ATM :ASYNCHRONNOUS TRANSFER MODE
AUI :ACCESS UNIT INTERFACE
ATP :APPLE TALK TRANSMISSION PROTOCOL
BNC :BRITISH NAVAL CONNECTOR
CCITT :INTERNATIONAL CONSULTANT COMMITTEE OF TELEGRAPHY AND TELEPHONEY
CIDR :CLASLESS INTERDOMAIN ROUTING
CRC :CYCLIC REDUNDANCY CHECK
CSMA/CA: CARRIER SENSE MULTIPLE ACCESS WITH COLLISION AVOIDANCE
CSMA/CD: CARRIER SENSE MULTIPLE ACCESS WITH COLLISION DETECTION
CSU :CHANNEL SERVICE UNIT
DBA :DATABASE ADMINISTRATOR
DABPA :DEFENCE ADVANCED REASERCH PROJECT AGENCY
DAMA :DEMAND ASSIGNED MULTIPLE ACCESS
DDS :DIGITAL DATA SERVICE
DLC: DATA LINK CONTROL
DNS: DOMAIN NAME SYSTEM
DQDB: DISTRIBUTED QUEUE DUAL BUS
DSL :DIGITAL SUBSCRIBER LINES
DSU :DATA SERVICE UNIT
DTE :DATA TERMINAL EQUIPMENT
ECP :ERROR CORRECTION PROTOCOL
EDI :ELECTRONIC DATA INTERCHANGE
EMI :ELECTRO MAGNETIC INTERFACE
FDDI: FREQUENCY DISTRIBUTED DATA INTERFACE
FTTN: FIBER TO THE NEIGHBORHOOD
HA :HIGH AVAILABILITY
HIPPI: HIGH PERFORMANCE PARELLEL INTERFACE
ICI :INTERFACE CONTROL INFORMATION
ICMP :INTERNET CONTROL MESSAGE PROTOCOL
IEEE :INSTITUTE OF ELECTRICAL AND ELECTRONIC ENGINEER
IF: INTERMEDIATE FREQUENCY
IMP: INTERFACE MESSAGE PROCESSORS
IPX: INTERNETWORK PACKAGE EXCHANGE
ISDN: INTEGRATED SERVICES DIGITAL NETWORK
ITU: INTERNATIONAL TELECOMMUNICATION UNION
LLC :LOGICAL LINK CONTROL
MAC: MEDIA ACCESS POING
MIB: MANAGEMENT INFORMATION BASE
MNP: MICRO-COM NETWORK PROTOCOL
NBP: NAME BINDINT PROTOCOL
NFS: NETWORK FILE SYSTEM
NIC: NETWORK INTERFACE CARD
NIU: NETWORK INTERFACE UNIT
NTFS: NETWORK FILE SYSTEM
OSI :OPEN SYSTEM INTERCONNECTION
OSPF: OPEN SHORTEST PATH FIRST
PBC :PORT BYPASS CIRCUIT
PBX :PRIVATE BRANCH EXCHANGE
PCMP: PULSE CODE MODULATION
PRI :PRIMARY RATE INTERFACE
PSPDN: PACKET SWITCHED PUBLIC DATA NETWORK
PSTN :PUBLIC SWITCHED TELEPHONE NETWORK
RF :REDIO FREQUENCY
RIP: ROUTING INFORMATION PROTOCOL
RPC: REMOTE PROCEDURE CALLS
SAN: STORAGE AREA NETWORK
SAP: SERVICE ACCESS UNIT
SCPC: SINGLE CHANNEL PER CARRIER
SMDS: SWITCHED MULTIMEGABIT DATA SERVICE
SMPS: SWITCH MODE POWER SUPPLY
SMI :STRUCTURE OF MANAGEMENT INFORMATION
SNA :SYSTEM NETWORK ARCHITECTURE
SNMP: SIMPLE NETWORK MANAGEMENT PROTOCOL
SONET: SYNCHORONOUS OPTICAL NETOWRK
SPX :SEQUENCED PACKET EXCHANGE
SSCOP :SERVICE SPECIFIC CONNECTION ORIENTED PROTOCOL
STP: SHIELDED TWISTED PAIR
TA :TERMINAL ADAPTER
TDMA :TIME DIVISON MULTIPLE ACCESS
TIP :TERMINAL INTERFACE PROCESSOR
TSS :TELECOMMUNICATION STANDARDISATION SECTOR
VCI :VIRTUAL CIRCUITS IDENTIFIER
VPI: VIRTUAL PATH IDENTIFIER
VSAT :VERY SMALL APERTURE TERMINAL
XDR: EXTERNAL DATA REPRESENTATION
A/D: ANALOG TO DIGITAL
ABC: ATANASOFF BERRY COMPUTER
ALGOL :ALGORITHMIC LANGUAGE
AM :AMPLITUDE MODULATION
BARC: BHABHA ATOMIC RESEARCH CENTRE
B-ISDN: BROADBAND INTEGRANTED SERVICE DIGITAL NETWORK
CASE :COMPUTER AIDED SOFTWARE ENGINEERING
CDC :CONTROL DATA CORPORATION
CISC : COMPLEX INSTRUCTION SET COMPUTER
CODASYL: CONFERNECE ON DATA SYATEMS LANGUAGE
CPS :CHARACTERS PER SECOND
CSCW :COMPUTER SUPPORTED COOPERATIVE WORKING
D/A: DIGITAL TO ANALOG
DAT :DIGITAL AUDIO TAPE
DDL :DATA DEFINATION LANGUAGE
DML :DATA MANIPULATIN LANGUAGE
DNA :DIGITAL NETWORK ARCHITECTURE
DDS :DIGITAL DATA STORAGE
DRDO: DEFENSE REASEARCH AND DEVELOPMENT ORGANIZATION
DSN :DISTRIBUTED SYSTEMS NETWORK
ERNET: EDUCATION AND RESEARCH NETWORK
EPIC :EXPLICITLY PARALLEL INSTRUCTION COMPUTING
FEP :FRONT END PROCESSOR
FMS :FILE MANAGEMENT SYSTEM
FSK :FREQUENCY SHIFT KEYING
HP: HEWLETT PACKARD
HZ: HERTZ
IBG: INTER BLOCK GAP
IBM :INTERNATIONAL BUSINESS MACHINES
IRG :INTER RECORD GAP
ISAM: INDEXED SWQUENTIAL ACCESS METHOD
JCL :JOB CONTROL LANGUAGE
KB :KILO BYTES
LPM: LINES PER MINUTE
LSD: LEAST SIGNIFICANT DIGIT
MAR: MEMORY ADDRESS REGISTER
MBR: MEMORY BUFFER REGISTER
MFT: MULTIPROGRAMMING WITH FIXED TASKS
MHZ: MEGA HERTZ
MIDI: MUSICAL INSTRUMENT DIGITAL INTERFACE
MSD: MOST SIGNIFICANT DIGIT

Thursday, February 18, 2016

Book Review

પુસ્તકની બાહ્ય સમીક્ષા

શીર્ષક : વર્ડપ્રેસની મદદથી સ્વયં તમારી વેબસાઈટ બનાવો આવરણ: આ પુસ્તક વર્ડપ્રેસ એકેડેમી દ્વારા અંગ્રેજીમાં બહાર પાડવામાં આવ્યું છે તેણે માર્ક બેનેટ્યુ દ્વારા લખવામાં આવ્યું છે અને તેના પર વર્ડપ્રેસ નો સિમ્બોલ છે જે દર્શાવે છેકે આ પુસ્તક વર્ડપ્રેસ વિષેની માહિતી ધરાવે છે અને તેનું ટાઈટલ તેણે યથાર્થ બનાવે છે. આ એક ઈ-પુસ્તક છે , જે અક્ષરનાદ નામના બ્લોગ પરથી ડાઉનલોડ કરી શકાય છે. લેખક : માર્ક બેનેટ્યુ એક વેબસાઈટ ડેવેલોપર, પ્રશિક્ષક , ઈન્ટરનેટ માર્કેટર અને સાહસીક છે. તે અમેરિકા નાં ફિલાડેલ્ફિયામાં રહે છે અને પ્રભાવશાળી વેબસાઈટ બનાવા અંગે તે શીખવે છે. ભાષાંતરિત કરનાર : જીજ્ઞેશ અધ્યારૂ એક સિવિલ ઇજનેર છે અને ગુજરાતી બ્લોગ નાં શોખ ને કરને અક્ષરનાદ નામની ગુજરાતી વેબસાઈટ સંચાલિત કરે છે. વર્ડપ્રેસની મદદ થી ધંધાકીય વેબસાઈટ નિર્માણ માં તેમને પ્રવેશ કર્યો છે. પ્રકાશક : વર્ડપ્રેસ એકેડેમી (અંગ્રેજીમાં ) અને અક્ષરનાદ.કોમ (ગુજરાતી) વિજાણું પત્રનું સરનામું : adhyaru19@gmail.com પ્રાપ્તિ સ્થાન : www.aksharnaad.com પાના ની સંખ્યા : ૩૩ ગ્રંથ નું કદ : ક્રાઉન ૭ * ૪.૫

પુસ્તકની આંતરિક સમીક્ષા

ગ્રંથ નો હેતુ : આ ગ્રંથ નો હેતુ વાચક ને વર્ડપ્રેસ માં વેબસાઈટ બનાવા માટે નાં પ્રશિક્ષણ અંગે નો છે. તેમજ વેબસાઈટ કઈ રીતે બનાવવી અને તેણે કઈરીતે પ્રભાવશાળી બનાવવી તેની તલસ્પર્શી માહિતી થી તરબોળ આ પુસ્તક વર્ડપ્રેસ એકેડેમી દ્વારા અંગ્રેજી ભાષા માં બહાર પાડવા માં આવ્યું છે અને આ પુસ્તક માં સમાવિષ્ટ પ્રકરણો એ મૂળ પુસ્તક નાં પ્રથમ બે વિભાગ આ ગુજરાતી પુસ્તક માં સમાવિષ્ટ છે .

ગ્રંથ ની વિષયવસ્તુ : આ પુસ્તક માં સમાવિષ્ટ મુદ્દાઓ નીચે મુજબ છે , જે ને લેખકે ગુજરાતી ભાષા માં ભાષાંતર કરતી વખતે પણ તેની ટેકનીકલ ભાષામાં સરળ બનાવી ને ખુબજ સારી રીતે ભાષાંતરિત કર્યા છે.  વર્ડપ્રેસ વેબહોસ્ટીંગ વિકલ્પો  મુખ્ય વિભાવના અને અભિગમ – સાઈટનાં મૂળ ઘટક તત્વો તથા યોજના  થીમ પસંદગી અને તમારી પસંદગી માટેના વિકલ્પો  ધંધાકીય વેબસાઈટ માટે વર્ડપ્રેસની રૂપરેખા ઘડવી  પોસ્ટ , પેજ અને લિંક વિશેની સમજણ  સાઈડબાર અને વીજગેટ વાપરવા  વિષયવસ્તુ નું સર્જન – વર્ડપ્રેસ બિલ્ટઈન વિઝુઅલ એડીટર  પ્લગઈન ઉમેરવા અને સુચવેલા પ્લગઈનનો સમૂહ  મૂળ થીમ , વિશેષ શૈલી , રૂપરેખા તથા ગોઠવણ  વિન્ડોઝ લાઈવ રાઈટર અને બ્લોગ સાથે વિષયવસ્તુનું સર્જન

Tuesday, November 25, 2014

Short term course from Academic staff college Sardar Patel University Vallabhvidhya Nagar on E-Commerce and E-Business. The Tour of GVK [Sense-Reach -Care] 108 Emergency Servicd center of Gujarat

Wednesday, November 12, 2014

What Is Internet



What Is Internet ?

It seems like everything a person does today is on the internet. A person can go to school, apply for jobs, manage their money, and even meet the love of their life online. There are apps for just about everything. Many people still wonder how the internet came to be as popular as it is.
In 1962 J.C.R Licklinder came up with an idea that computers from different parts of the globe can be linked together. This would allow the sharing of information to be quick and easy. He led a research team to further develop this concept. Throughout the 1960s research was conducted at by top professors to develop this concept and how to make it a possibility. The Us Department of Defense gave contracts to companies including ARPANET to further research how to send information by using computers. This grow developed protocols on how to join separate computer network and make them one network. In the 1970s researchers were able to use communication protocols to lead to internet workng. This allows network to join each other and be able to share their information.
In 1981 the National Science Foundation funded more research the on the idea of information sharing over computers. The Computer Science Network was given funded and developed the Internet protocol suite which is now known as the IP address. At this time the supercomputer was developed which allowed researchers to use it to communicate their research findings and share educational stats with each other. In the late 1980 the development of internet service providers (isp) were used for commercial purposes. This also allowed for private connections to the internet and computers to be established. By the early 1990s businesses were able to connect to each other around the globe. By the mid 1990s the internet was set up to carry a large amount of traffic and new features were developed for personal use.
During the 1990s the internet became a cultural revolution. The average person was learning how to send and receive emails, stay in touch with instant messaging, use the internet to make phone calls, search the world wide web, and even make purchases using the computer. During this time connection to the internet was available by use of the telephone lines. Microsoft then developed their operating systems (Windows) that was easy enough for the average person to use. Over the next couple of years new developments were made to allow for high speed internet connection and fiber optic networks. Other areas of the world were also learning how to use the internet and use it for communication purposes. Even today the internet continues to grow as new developments are made.

Tuesday, October 21, 2014

IF condition statement in javascript , Switch case statement in javascript

  • CONDITIONAL STATEMENTS:
  • Conditional statements in JavaScript are used to perform different actions based on different conditions.
  • Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do this.
  • In JavaScript we have the following conditional statements:
  • if statement - use this statement if you want to execute some code    

                       only if a specified condition is true

  • if...else statement - use this statement if you want to execute some code if the condition is true and another code if the condition is false
  • if...else if....else statement - use this statement if you want to select

                                             one of many blocks of code to be executed

  • switch statement - use this statement if you want to select one of

                               many blocks of code to be executed

IF STATEMENT:

  • You should use if statement if you want to execute some code only if a specified condition is true.

Syntax:
        If <condition>
{
JavaScript code executed if condition becomes true.
}

Example:
<script language = "javascript">
var x = 5,y=6;
if (x>y)
{
document.write(' x is greater');
}
</script>

IF...ELSE STATEMENT:

  • If you want to execute some code if a condition is true and another code if the condition is not true, use if....else statement.

Syntax:

            if (condition) 
            { 
Code to be executed if condition is true 
            } 
            else 
            { 
Code to be executed if condition is not true
            } 

 

Example:
<script language = "javascript">
x = 5;
y = 6;
if (x > y)
{
document.write('x is greater');
}
else
{
document.write('y is greater');
}
</script>

IF…ELSE IF…ELSE STATEMENT:
  • It is used when user have two or more condition to check for execution of code.

Syntax:
          if <condition1>
{
          Code if condition 1 is true;
}
else if <condition2>
{
          Code if condition 2 is true;
}
else
{
          Code if no condition becomes true;
}

Example:
            <script language = "javascript">
                        x=5;
     y=6;
     z=7;
     if(x>y && x>z)
     {
                 document.write('x is greater');
     }
     else if(y>x && y>z)
     {
                 document.write('y is greater');
     }
     else
     {
                 document.write('z is greater');
     }
            </script>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


SWITCH STATEMENT:

  • use the switch statement to select one of many blocks of code to be executed

 

Syntax:
        switch (n)

          { 
    case 1: 
               Execute code block 1 
               break;     
    case 2: 
               Execute code block 2 
               break; 
    default: 
               Code to be executed if n is 
               Different from case 1 and 2
           } 
 


  • First we have a single expression n (most often a variable), that is evaluated once.

 

  • The value of the expression is then compared with the values for each case in the structure.
  • If there is a match, the block of code associated with that case is executed.

 

  • Use break to prevent the code from running into the next case automatically.