Thursday, 12 September 2013

function- part2

Advantages of the modular programming :

                (a) Easy to understand
                (b) Easy to debug
                (c) Easy to modify
                (d) Resuability of code.

(i) Pre-defined Functions : These functions are defined in the header files.

        e.g. stdio.h (printf() , scanf( ))

                conio.h ( clrscr( ) , getch( ) )

(ii) User-defined functions : These functions are defined by the user for there own prupose.

        These functions contains the following components :

                (a) Function Prototype.

                (b) Function call

                (c) Function definition

(a) Function Prototype : The function prototype is used to                                           specify the layout of the function.

The function prototype specifies the following information :

        (i) The function name

        (ii) The number of arguments the function requires

        (iii) The type of arguments

        (iv) The returntype.


The general form is ,

                returntype functionname(argument list);


Example 1 :

        int sum(int ,int);

        It specifies that there will be a function with the name
        sum( ) and this function will take two arguments and both are of type integers and the sum() will also return   the integer type value.

        float average(float,float,float);

        It speicifes that there will be a function with the name         average( ) and this function will take the three arguments     and all of them are of type float and the average( ) will   return the float type value .

        void show(char , int );
       
        It speicfies that there will be a function with the name         show( ) and this function will take the two arguments and the first argument will be of type char and the    second argument will be of the type int and the function         will not return any value.


(b) Function Call :

        Consider the following statement ,

                main( )
                {

                        ::      :       :       :       :

                        clrscr( );

                        :       :       :       :       :       :
                        :       :       :       :       :       :      
                }

                In the above mentioned code , we are calling the                 clrscr() function in the main( ) .

                The clrscr() function will be known as the Called                Function and the main( ) function will be known as the calling function .

Tuesday, 10 September 2013

Oops function (part 1)

Functions :

Function is the block of code which is used to perform a particular operation.

There are two type of the functions :

          (i)  Pre-defined functions

          (ii) User -defined functions .

Monolithic Programming : In this case , we write the entire logic in the single program.

The disadvantages of the monolithic programming are,

                   (a) Difficult to understand.
                   (b) Difficult to modify
                   (c) Difficult of debug.
    [Bug means computer program error and debugging is the process of locating and removing the computer program error.]

 Modular Programming : In the case of the modular programming , we divide the entire complex program into the simple sub-programs or modules.These modules are also known as functions.

First Room Temperature, Solid State MASER

First Room Temperature, Solid State MASER
Conventional MASER technology works by amplifying microwaves using crystals such as ruby - this process is known as 'masing'. However, the MASER has had little technological impact compared to the LASER because getting it to work has always required extreme conditions that are difficult to produce; either extremely low pressures, supplied by special vacuum chambers and pumps, or freezing conditions at temperatures close to absolute zero (-273.15 °C), supplied by special refrigerators. To make matters worse, the application of strong magnetic fields has often also been necessary, requiring large magnets.
Now, the team from NPL and Imperial have demonstrated masing in a solid-state device working in air at room temperature with no applied magnetic field. This breakthrough means that the cost to manufacture and operate MASERs could be dramatically reduced, which could lead to them becoming as widely used as LASER technology.The researchers suggest that room-temperature MASERs could be used to make more sensitive medical instruments for scanning patients, improved chemical sensors for remotely detecting explosives; lower-noise read-out mechanisms for quantum computers and better radio telescopes for potentially detecting life on other planets.
Conventional MASER technology works by amplifying microwaves using hard inorganic crystals such as ruby. However, masing only works when the ruby is kept at a very low temperature. The team in this new study have discovered that a completely different type of crystal, namely p-terphenyl doped with pentacene, can replace ruby and replicate the samemasing process at room temperature. As a curious twist, the pentacene dopant turns the otherwise colourless p-terphenyl crystal an intense reddish pink - making it look just like ruby!
The twin challenges the team currently face are getting the MASER to work continuously, as their first device only works in pulsed mode for fractions of a second at a time. They also aim to get it to operate over a range of microwave frequencies, instead of its current narrow bandwidth, which would make the technology more useful.
In the long term, the team have a range of other goals including the identification of different materials that can mase at room temperature while consuming less power than pentacene-doped p-terphenyl. They will also focus on creating new designs that could make the MASER smaller and more portable.

Monday, 9 September 2013

3G

Long Mp3 3G technology services is the latest in mobile communication services. 3G here is a term that denotes "third generation". The 3G service is the third innovation, the analog cellular technology generation is the first generation innovation, digital mobile is the second generation,

The 3G mobile service is the best technology for the true multimedia cell phone that are typically known as smart phones. These phones feature an increased bandwidth and wonderful transfer rates. The phone is also able to play various web-based applications and the various audio and video files designed to be played on a phone.

The 3G services comprise of several cellular access technologies. The three most common cellular technologies are the CDMA2000, which is based on 2G Code Division Multiple Access, the WCDMA or the Wideband Code Division Multiple Access and the TD-SCDMA – the Time-division Synchronous Code-division Multiple Access

The 3G service networks have an amazing data transfer speed. In fact it can transfer data for up to 3 Mbps that means that it would take almost 15 seconds to download a 3-minute long MP3 song. In comparison, the fastest 2G phones can only achieve up to 144Kbps which means that using them it would take about 8 minutes to download a 3-minute song.

Why 3G is better than 2g?
  1. Use of higher order modulation:   16QAM is used in the downlink instead of QPSK to enable data to be transmitted at a higher rate. This provides for maximum data rates of 14 Mbps in the downlink. QPSK is still used in the uplink where data rates of up to 5.8 Mbps are achieved. The data rates quoted are for raw data rates and do not include reductions in actual payload data resulting from the protocol overheads.
  2. Shorter Transmission Time Interval (TTI):   The use of a shorter TTI within 3G HSPA reduces the round trip time and enables improvements in adapting to fast channel variations and provides for reductions in latency.
  3. Use of shared channel transmission:   Sharing the resources enables greater levels of efficiency to be achieved and integrates with IP and packet data concepts.
  4. Use of link adaptation:   By adapting the link it is possible to maximize the channel usage.
  5. Fast Node B scheduling:   The use of fast scheduling within 3G HSPA with adaptive coding and modulation (only downlink) enables the system to respond to the varying radio channel and interference conditions and to accommodate data traffic which tends to be "bursty" in nature.
  6. Node B based Hybrid ARQ:   This enables 3G HSPA to provide reduced retransmission round trip times and it adds robustness to the system by allowing soft combining of retransmissions.
 The first country to start 3G service on a great scale was Japan where by 2005 nearly 40% of consumers used 3G network only. With 2G technology becoming outdated in Japan,almost all the 2G networks have now been shifted to 3G networks.
3G gives the ability to transfer both voice as well as non-voice based Data at a much faster level. While marketing 3G services, video telephony is famously referred as a killer application. 3G networks have not been upgraded from 2G networks and do not function on the same frequency spectrum. For 3G services new networks need to be fitted and new frequencies are allocated to the mobile operators.
3G HSPA of High Speed packet Access is the combination of two technologies, one of the downlink and the other for the uplink that can be built onto the existing 3G UMTS or W-CDMA technology to provide increased data transfer speeds.
The original 3G UMTS / W-CDMA standard provided a maximum download speed of 384 kbps. With many users requiring much high data transfer speeds to compete with fixed line broadband services and also to support services that require higher data rates, the need for an increase in the speeds obtainable became necessary. This resulted in the development of the technologies for 3G HSPA.
3G UMTS HSPA constituents
There are two main components to 3G UMTS HSPA, each addressing one of the links between the base station and the user equipment, i.e. one for the uplink, and one for the downlink
Uplink and downlink transmission directions
 The two technologies were released at different times through 3GPP. They also have different properties resulting from the different modes of operation that are required. In view of these facts they were often treated as almost separate entities. Now they are generally rolled out together. The two technologies are summarised below:
  • HSDPA - High Speed Downlink Packet Access:   HSDPA provides packet data support, reduced delays, and a peak raw data rate (i.e. over the air) of 14 Mbps. It also provides around three times the capacity of the 3G UMTS technology defined in Release 99 of the 3GPP UMTS standard.
  • HSUPA - High Speed Uplink Packet Access:   HSUPA provides improved uplink packet support, reduced delays and a peak raw data rate of 5.74 Mbps. This results in a capacity increase of around twice that provided by the Release 99 services.
Beyond 3G HSPA
·         With the elements of 3G HSPA launched, further evolutions were in the pipeline. The first of these was known as HSPA+ or Evolved HSPA. The evolved HSPA or HSPA+ provides data rates up to 42 Mbps in the downlink and 11 Mbps in the uplink (per 5MHz carrier) which it achieves by using high order modulation and MIMO (multiple input, multiple output) technologies.

·         In addition to 3G HSPA, and its evolutions, the next evolution for 3G UMTS is known as LTE - Long Term Evolution. This uses a completely different air interface that is based around OFDM as the modulation format. While many operators have opted to migrate directly from UMTS to LTE, the majority are using 3G HSPA to upgrade their existing 3G networks.


Friday, 6 September 2013


  There are two types of streams :

(i) Input Stream

(ii) Output Stream

(i) Input Stream :

            The stream which produces information is known as the Input Stream and it is connected to the standard         input device , that is , Keyboard.

             cin which is an object of the istream class and it is used to implement the input    stream .

 (ii) Output Stream
            The stream which consumes information is known as the output stream and it is connceted to the standard output device, that is , monitor.
             cout which is an object of the ostream and it is used to implement the output stream.
>> is known as the extraction operator and it is used to extract the information from the input stream.

<< is known as the insertion operator and it is used to insert the information into the output stream.


endl is used to display the information on the newline.





Conditional statements:-

Q . WAP to read the year and check whether the year is leap or not.

#include<iostream.h>
#include<conio.h>
void main()
{
            int year;

            clrscr();

            cout<<endl<<"Enter the year :";
            cin>>year;
if((year%4==0&&year%100!=0)||(year%400==0))
                        cout<<endl<<"Leap Year.";
            else
                        cout<<endl<<"Not a Leap Year.";

            getch();
}

Q .WAp to read the three numbers and find the second maximum of the three numbers

#include<iostream.h>
#include<conio.h>
void main()
{
            int a,b,c,max,smax;

            clrscr();

            cout<<endl<<"Enter the value of a,b and c:";
            cin>>a>>b>>c;

            if(a>b)
            {
                        max=a;

                        smax=b;

            }
            else
            {
                        max=b;

                        smax=a;
            }

            if(c>max)
            {                     
                        smax=max;

                        max=c;

            }
            else     if(c>smax)
                                    smax=c;
           
           

            cout<<endl<<"Second Maximum = " <<smax;

            getch();
}


All program done in c now write in C++
1)                 if else
2)                 for loop
3)                 while loop
4)                 do while loop
5)                 Arrays



Thursday, 5 September 2013

Oops concept

                   * Function Overloading
                   * Virtual Functions.
Starting with the C++ Programming :
Consider the following program code ,


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

void main( )
{
         
          int a,b,c;

          clrscr();

          cout<<endl<<"Enter the value of a and b :";
          cin>>a>>b;


          //calculate the sum

          c=a+b;


          //display the sum

          cout<<endl<<"Sum = " <<c;

          getch();

}

(a) #include<iostream.h>
          This statement will include the header file <iostream.h> in  our program .
          iostream stands for Input Output Stream .

          This header file will contain the entire class hierarchy.
                    
                     

(b) cout<<endl<<"Enter the value of a and b :" ;

    cin>>a>>b;

                            


Buffer : The Buffer is the section of the primary memory which is used for input and output .
                  

Stream : In C++ and Java , the buffer is known as streams.Stream refers to the flow of bytes.The Stream can be         considered as a logical device which either consumes or produces information.

         

There are two types of streams :

(i) Input Stream

(ii) Output Stream

(To be continue...)

Tuesday, 3 September 2013

Oop's concept

Object Oriented Programming  In the case of the object oriented programming,we have the concept of classes and objects.
It is the way of doing programing.it  is a very power full way of doing programing
The class defines the  general category and the object is the instance or occurance of the class.
            Suppose ,

         

                             Diagram explaining the classes & objects


Features of Object Oriented Porgramming

1. Encapsulation

2. Data Abstraction

3. Data Hiding

4. Inheritance

5. Polymorphism

1. Encapsulation :

    

The process of binding the data items as well as the code which manipulate these data items into a single entity is known as encapulation and that entity is known as the class.

2. Data Abstraction :

           

As we know that the class contains the data items as well as  the methods or function which manipulate these data items. But , if we want to access any of the memeber of the class , we have to first create the object of that class.
                        Without object we cannot access any of the member of the class.

3. Data Hiding :


As we know that in order to access any of the member of the class, we have to first create the object of the class.
But sometimes even by making use of the object of the class , we are not able to access some member.

This is due to data hiding .

            And the Data hiding is made possible due to the access control specifiers .

                        * Private
                        * Public
                        * Protected


            * Private : The elements or the members which are defined as private cannot be accessed by the object of                                        the class.

            * Public : The elements or the members which are defined as public are accessed directly by the object of                                      the class.        

           
4. Inheritance :

            The process of creatinga new class on the basis of the existing class is known as Inheritance.The existing             class is known as the base class and the new class is known as the derived class.

            The derived class will have more or less all the properties of the base class and some of the properties of its own.

5. Polymorphism

            The term poly means many and morphism means forms and the concept of the polymorphism is to use the             singly entity for the variety of different purposes.

                        In C++ , polymorphism is implemented through,

                                    * Function Overloading
                                    * Virtual Functions.
Starting with the C++ Programming :