Wednesday, June 26, 2013

HTML language

    Welcome to the world of HTML that is full form of:

  • H - Hyper
  • T - Text
  • M - Markup
  • L - Language

       HTML is used to make web pages.The meaning of HTML is:
Hyper is the opposite of linear.Old -fashioned computer programs were necessarily linear -that is ,they had a specific order.But  with a "hyper" language such as HTML,the user can go anywhere on the web page at any time.
Text is just what you're looking at now -English characters used to make up ordinary words.
Mark-up is what is done to the text to change its appearance.For instance,"marking up" your text with <b> before it and </b> after it will put that text in bold.
Language is just that.HTML is the language that computers read in order to understand web pages.

A mark-up language is set of mark-up tags.HTML uses mark-up tags to describe we pages.
Note that HTML is not a programming language,it is a mark-up language.

Advantages of HTML:-

  1. It's easy to use.
  2. It is supported on the majority of browsers, in fact ,may be even all of them.
  3. It is widely used on all websites.
  4. It will cost you nothing.It is free.
  5. Easy to learn.
  6. Loose syntax.
  7. Very similar to XML syntax,which is increasingly used for data storage.
  8. Free -You need not to buy any software.

Structure of HTML document:-

An HTML document is made up of two sections:-
1)THE HEAD SECTION :- The head section contains information related to the webpage.Example the title of the document.Any data which is provided in the Head Section will not appear in the viewing area of the web browser.We use Head tag as<head> and</head>The tags used within this tag are TITLE,SCRIPT.
2)THE BODY SECTION:- All information contained in the browser section is displayed in the browser.The way in which this information is to be displayed is instructed to the browser with the help of HTML tags.We use <body> and </body> tag for it.The tags used in this tag are all the tags of symbols like bold,paragraph,italic,horizontal rule,etc.

The structure of the HTML document is as follows:-
<html>
<head>
<title> My first html document</title>
</head>
<body>
<h1>My first heading</h1>
<p>My first Paragraph.</p>
</body>
</html>

Explanation of above coding  is:-
  • - The text between <html> and </html> describes the web page.
  • - <title>This is the name that your browser will use to identify the page.
  • -<head> This encloses basic information about your page.Your title and meta tags go here as well as any scripts you want executed before the main part of the page loads.
  • -The text between <body> and </body> is the visible page content 
  • - The text between <h1> and </h1> is displayed as a heading
  • - The text between <p> and </p> is displayed as a paragraph.
The editor for html used mostly is notepad after typing the html coding you have to save the file with a name given by user but the extension should be .html or .htm for that file and saved on your place.

Tags :- 

A tag is a unit of markup.These are used to define elements in HTML. Each consists of the "less than" and "greater than" characters (< and >) with the element name and possibly some attributes and values inside.

Star Tag and End Tag:

Start Tag:- Start tags are used to begin an effect .A start tag begins with(<) sign by the tag element and ends with the (>) sign.

End Tag:-The end tags are used to end the effect.An end tag also begins with (<) sign ,it has an additional forward slash(/) immediately after  the less than (<) sign. This is followed by the keyword and the tag is closed with the greater than (>) sign.
e.g. Start Tag : <title>
        End Tag : </title>
 It is between the start tag and the end tag that you have to insert the text to which the effect of the tag is to be applied.

Tags in HTML:-
  • Table                  
  • Lists                   
  • Paragraph           
  • Physical styles     
  • Logical styles
  • Horizontal Rule
  • Break Line
  • Image
  • Anchor
  • Marquee
  • Subscript
  • Superscript
Tag Attributes:-
       Tag can have attributes.Attributes can provide additional information about the HTML elements on your page,included inside the start tag.
Attributes always come in name/value pairs like this: name="value"
Syntax is
         <tag_name attribute_name="value">
       e.g.<img src="C:\image.jpg">
In above example src is an attribute for image tag and its values are specified in double quotes.

HTML is the language which can be used embedded with many languages as to make front end forms like with PHP,ASP.NET,etc.

The language is easy to learn and understand .
Heading tag :- There are six heading tags They are:-
<h1>ABC</h1>
<h2>ABC</h2>
<h3>ABC</h3>
<h4>ABC</h4>
<h5>ABC</h5>
<h6>ABC</h6>
The Heading tag is used to heading h1 tag is used to display words in large size and h6 is used to write  in smallest size.

Scripting Languages:-We can use Javascript or vbscript languages with HTML.

Thursday, June 13, 2013

C++ Programs Examples

C++ Programs Examples

In Microsoft Visual C++ 6.0 (Text Editor)-

Follow the steps:-


Step1:-


 
Step 2:-



Step 3:-


Step 4:-


Step 5:-


Step 6:-


Step 7:-


Step 8:-


Step 9:-


Step 10:-


Step 11:-


Step 12:-


Step 13:-



Step 14:-


Step 15:-


Step 16:-







1. Program to Display Simple Message:-
#inlude<iostream.h>
void main()
{
cout<<"Welcome to my blog.\n";
cout<<"Thank you for visiting my blog.";
 }

/**************Output******************/
Welcome to my blog.
Thank you for visiting my blog.

Saturday, June 8, 2013

C++ programming

Programming in C++ :-

Programming in C++ can be done on Turbo C++,Microsoft Visual Studio IDE very easily they provide built- in editor and menu bar ,program should be saved with .cpp file extension in it like example.cpp.




C++ programmer should know about the data types used in it.
There are 3 types of it:-
1.Built-in type include 3 types they areas follows:-
    I)Integral - i)int
                     ii)char
    II)Floating - i)float
                      ii)double
2.User defined type include 4 types they areas follows:-
    I ) Structure
    II ) Union
    III ) Class
    IV ) Enumeration
3.Derived  type include 3 types they areas follows:-
     I ) Pointer
    II ) Array
    III ) Function

           Each of the fundamental types has a fixed size that determines the range of values that can be stored in them (for integers) or the precision and range of those values (for floating point numbers). A char variable is of the natural size to hold a character on a given machine (typically an 8-bit byte), and the sizes of other types are quoted in multiples of the size of a char. The size of a type is implementation defined (i.e., it can vary among different machines) and can be obtained by the size of operator; for example size of (char) equals 1 and size of (int) is often 4.
          Simple programming in C++ can be done using header files mostly used header file in simple programming is #include<iostream.h> it means that there are built in standard C++ library which has iostream file file in above case where io means the input and output steam in programming <> these are the brackets for header file.It is use to take and display the data from cin>> and cout<< where << and >> are the operators.

Memory management :-

C++ supports four types of memory management:
  1.Static memory allocation. :- 
    A static variable is assigned a value at compile-time, and allocated storage in a fixed location along with the executable code. These are declared with the "static" keyword (in the sense of static storage, not in the sense of declaring a class variable).
  2. Automatic memory allocation. :-
     An automatic variable is simply declared with its class name, and storage is allocated on the stack when the value is assigned. The constructor is called when the declaration is executed, the destructor is called when the variable goes out of scope, and after the destructor the allocated memory is automatically freed.
  3.Dynamic memory allocation.:-
     Storage can be dynamically allocated on the heap using manual memory management - normally calls to new and delete (though old-style C calls such as malloc() and free() are still supported).
  4.Garbage collection :-
    With the use of a library, garbage collection is possible. The Boehm garbage collector is commonly used for this purpose.

The fine control over memory management is similar to C, but in contrast with languages that intend to hide such details from the programmer, such as Java, Perl, PHP, and Ruby.

Operators and operator overloading:-

1. C++ provides more than 35 operators, covering basic arithmetic, bit manipulation, indirection, comparisons, logical operations and others.
2. Almost all operators can be overloaded for user-defined types, with a few notable exceptions such as member access (. and .*) as well as the conditional operator.
3. The rich set of over-loadable operators is central to using user created types in C++ as well and as easily as built in types.
4.The over-loadable operators are also an essential part of many advanced C++ programming techniques, such as smart pointers.
5. Overloading an operator does not change the precedence of calculations involving the operator, nor does it change the number of operands that the operator uses.
6.Overloaded "&&" and "||" operators lose their short-circuit evaluation property.

Features of object-oriented programming :-

  1. Programs are divided into objects and different objects communicate with each through messages,called methods.
  2. Emphasis is given on data rather than procedure.
  3. Data is hidden and can't be accessed or altered by external functions.
  4. Functions operating on data of  an object are encapsulated.
  5. New data and functions can be easily added whenever necessary.
  6. Follows bottom-up approach in program design.
C++ fully supports object-oriented programming,including the four pillars of object-oriented development:-
  I)   Abstraction
  II)  Encapsulation
  III)  Inheritance
  IV) Polymorphism

C++ as Object Oriented Language:
      Object Oriented programming techniques are the best ways,to develop large ,complex software applications and systems.C++ can be used both as an OOPL and simply as a better C.C++ programs are fast and  efficient,which helped to make C++,an extremely popular language.It uses templates,static polymorphism,dynamic polymorphism,generic programming,inheritance;data binding and encapsulation,etc. which covers most of  the object-oriented concepts.
      Also C++ supports a programming technique that allows memory management to be safe and implicit.There are constructors and destructors in C++ programming which has god  role for programming.
The constructors are those which have the same name function as that of class in the a program.

TOKENS
The smallest individual units in a program are known as tokens.C++ has the following tokens:
  • Keywords
  • Identifiers
  • Constants
  • String
  • Operators
A C++ program is written using those tokens,white-spaces,and syntax of the language.






Featured posts

Ethiopian culture calendar language

Ethiopian culture, calendar, language  The Ethiopian language, specifically Amharic , uses a script called Ge'ez script . It consists of...

Popular posts