XII-Computer-Science-Quick-Notes_CS (2)
XII-Computer-Science-Quick-Notes_CS (2)
Chapter One Object:-is an identifiable entity with some characteristics and behavior. step 6: Print “Stack Overflow”
Structures and Pointers Class:-is a group of objects that shares common properties and relationships. step 7: End of If
Structures-is an example of derived data type. It is an organized collection of logically related fields that are class class_name step 8: stop
referenced by a common name. {private: variable declarations; Algorithm for POP operation from a STACK :
syntax: function declarations; Consider STACK[N] is an array, N is the maximum size, TOS is the variable indicates the top of the stack and VAL is
struct structure_tag public : variable declarations; the data item to be deleted into the stack.
{data_type variable1; function declarations; step 1: start
…………………}structure_variable; }; step 2: If (TOS<-1) Then
struct date Object is an instance of a class and class is the blueprint of an object. step 3: VAL = STACK[TOS]
{ Message passing means calling member function of an object from another object. step 4 : TOS=TOS-1
int day; int Data Abstraction:-The act of representing essential features without including the background details or step 5: Else
month;int explanations. step 6: Print “Stack Underflow”
year; Encapsulation:-The wrapping up of data and functions into a single unit. step 7: End of If
}dob; Modularity:-The process of partitioning a big program into several smaller modules. step 8: stop
The dot operator (.)connects a structure variable with a structure element. Inheritance:-The process of deriving a new class(derived class ) from an existing class(base class). Queue:- It is a linear data structure in which insertion will take place at one end called rear end and deletion will take
syntax: structure_variable.element_name; class derived_class: AccessSpecifier base_class place at other end called front end of the queue. Here the organizing principle is FIFO(First In First Out).The process
Nested Structure- One structure contains another structure. { of adding new elements into a queue is called insertion and the process of removing of removing elements from a
Array Vs Structure }; queue is called deletion. The process of adding new elements into a full queue is called Queue Overflow and the
SlNo Array Structure The Access Specifiers are private, public or protected. process of removing elements from an empty queue is called Queue Underflow.
1 Derived data type User defined data type Polymorphism:-ability to express different forms Algorithm for INSERTION operation in a QUEUE :
2 Collection of same type of data Different types of data 1. Compile time(Early Binding) (Static Polymorphism):-Ability of a compiler to bind a function call with function Consider QUEUE[N] is an array, N is the maximum size, the variables FRONT and REAR keep track of the front and
3 Elements are referenced with subscripts Referenced by using dot operator definition during compilation time. rear positions of the queue and VAL is the data item to be inserted into the queue.
4 one array contains another array is One structure contains another structure is nested a. Function Overloading: Functions with same name but different signatures can act differently. step 1: start
multidimensional array structure b. Operator Overloading: The concept of giving new meaning to an existing C++ operator. step 2: If (REAR==-1) Then
5 Array of structure is possible Structure can contain arrays as elements 2. Run Time(Late Binding) (Dynamic Polymorphism):- Ability of a compiler to bind a function call with function step 3: FRONT=REAR=0
Pointers:-A variable which holds the address of another variable. Pointer concept was introduced by Harold definition during run time. It uses the concepts of pointers and inheritances. step 4 : QUEUE[REAR]=VAL
Lawson. Chapter Three step 5: Else If(REAR < N) Then
Declaration: datatype *variable; Data Structures and Operations step 6: REAR=REAR+1
Address of operator(&)-to get the address of a variable. Data Structure:-Particular way of organizing similar or dissimilar logically related data items which can be step 7: QUEUE[REAR]=VAL
Value at operator(indirection) (dereference)(*)-retrieves the value at a particular location. processed as a single unit. step 8: Else
Static Memory allocation- Memory allocation which can be done at compilation time. 1. Simple Data Structure:-Arrays and Structures step 9 : Print “Queue Overflow”
2. Compound Data Structures: Simple Data Structures are combined together to form complex data structures. step 10: End of If
Dynamic memory allocation-Memory allocation which can be done at run time.
1. new- creates dynamic memory space a. Linear:-The elements are arranged in a linear format.1. Stack 2. Queue 3. Linked list Algorithm for DELETION operation from a QUEUE :
syntax1 : pointer_variable=new datatype; b. Non Linear:-Tree and Graph Consider QUEUE[N] is an array, N is the maximum size, the variables FRONT and REAR keep track of the front and
syntax2: pointer_variable=new datatype(value); Operations of Data Structures: rear positions of the queue and VAL is the data item to be removed from the queue.
delete pointer_variable; - deletes the dynamic memory space. 1. Traversing:-visiting each element in a data structure. step 1: start
Memory leak: If the dynamically allocated unwanted memory is not de allocated by using the delete operator ,a 2. Searching:- finding the location of a particular element . step 2: If (FRONT > -1 AND FRONT < REAR ) Then
wastage of memory is occurred. This situation is memory leak. 3. Inserting:- adding a new element . step 3: VAL =QUEUE[FRONT]
Pointers can be incremented or decremented. Among the six relational operators , only equality(==) and non 4. Deleting:- removing an existing element. step 4 : FRONT = FRONT + 1
equality(!=) are used with pointers. 5. Sorting:- arranging the elements in a specified order. step 5: Else
Dynamic Array: Array which is created at run time by using “new” operator. 6. Merging:-combining the elements of two data structures and to form a third one. step 6: Print “Queue Underflow”
pointer_variable=new datatype[size]; Stack: It is a linear data structure in which the insertion and deletion takes place at one end of the stack called top of step 7: End of If
Structure pointer and an element is connected using arrow operator(->) the Stack. The organizing principle is LIFO(Last In First Out).The process of adding new elements into a stack is called step 8: If (FRONT > REAR ) Then
Self referential structure: A structure in which one of the element is a pointer to the same structure. Pushing. The process of adding new elements into a full stack is called Stack Overflow. The process of removing step 9 : FRONT=REAR=-1
Chapter Two existing elements from a stack is called Popping. The process of removing elements from an empty stack is called step 10: End of If
Concepts of Object Oriented Programming Stack Underflow. step 10 : stop
Programming Paradigm: the way in which program is organized. C++ is a multiple paradigm language. It supports Algorithm for PUSH operation in a STACK : Circular Queue: A queue in which two end points meet.
both procedural paradigm as well as object oriented paradigm. Consider STACK[N] is an array, N is the maximum size, TOS is a variable indicates the top of the stack and VAL is the Linked List:-a collection of nodes, where each node consists of a data and a link – a pointer to the next node.
Limitations of POP: data item to be added into the stack. Operations on Linked List
1. Data is under valued
step 1: start 1. Creation of Linked list
2. Adding new data element may require modifications to all/many functions. step 2: If (TOS<N) Then 2. Traversing a linked list
3.Creating new data types(Extensibility) is difficult. step 3: TOS=TOS+1 3. Insertion in a linked list
4. Provides poor real world modeling. step 4 : STACK[TOS]=VAL 4. Deletion from a linked list
Chapter Four 8. topmargin:-topside margin. border(thickness of the border line),bordercolor,align,bgcolor,background,cellspacing(amount of space between
Web Technology 5.Heading Tags:-<h1></h1>,<h2></h2>,<h3></h3>,<h4></h4>,<h5></h5>,<h6></h6>. Attribute align – values are - the cells),cellpadding(amount of space between the cell border and content),width,height,frame(void-no
Communication the Web left,right and center. border,above-top border,below-bottom border,hsides-top and bottom borders,vsides-right and left borders,lhs-
a. Client to Web Server Communication 6. <P> Tag:-paragraph tag. Attribute align- values are – left,right,center or justify. left side border,rhs-right side border,box & border-border on all sides),rules(values - none,cols,rows,groups,all)
b. Web Server to Web Server Communication 7.<br>:-inserting line breaks. NOTE: When both bgcolor and background are specified , the background will override the bgcolor.
Web Server :-1. A server computer that hosts web sites. 2. A web server software that is installed in a server 8. <hr>:-produces horizontal line. Attributes size,width,color,noshade Attributes of <tr> Tags:-
computer . 9.<center>:- brings the content to the center . align(values- left,right,center),valign-vertical alignment( values - top,middle,bottom,baseline(aligns the baseline of
Web Server Packages 10.<b>:- making the text bold. the text across the cells in the row))
Apache Server, MicroSoft Internet Information Server (IIS), Google Web Server(GWS),nginx 11. <i>:-Italicizing the text . Attributes of <th> and <td> Tags:-align,valign,bgcolor,rowspan(number of rows to be spanned by the
Software Ports:-FTP(20 & 21),SSH(22),SMTP(25),DNS(53),HTTP(80),POP3(110),HTTPS(443) 12. <u>:- Underlining the text. cell),colspan(number of columns to be spanned by the cell)
NASA:-National Aeronautics and Space Administration 13. <s> and <strike> :- Striking through the text. <caption> Tag:-we can provide a heading to a table.
ICANN:-Internet Corporation for Assigned Names and Numbers 14.<big>:- Making the text big sized.
SlNo Static Web Page Dynamic Web Page 15.<small>:-Making the text small sized. <frameset> Tag:- Used for dividing the browser window. Attributes are cols,rows,border,bordercolor
1 The content and layout is fixed The content and layout may change during run time. 16.<strong>:-Making the text bold text. <frame> Tag:- Attributes are src,scrolling(displays whether a scrollbar or not-values are
2 Never use databases Database is used 17.<em>:- Emphasizing the text yes,no,auto),noresize(prevents the resizing behaviour),marginwidth,marginheight,name(gives a name to a frame).
3 Directly run on the browser. Runs on the server side application programs 18. <sub>:-creating subscripts.
4 They are easy to develop. Development requires programming skills. 19. <sup>:-creating super scripts. Forms in Web pages:-
Scripts:-Scripts are program codes written inside html pages. A script is written inside the <SCRIPT> and 20.<q>:-used for short quotations <form> Tag:- Used for creating a form with various form controls. Attributes are action(specifies the
</SCRIPT> tags . 21. <blockquote>:-used for long quotations URL),method(get method and post method),target(specifies the target window).
SlNo Client Side Scripting Server Side Scripting 22. <pre>:- Displaying preformatted text. Form Controls:-
1 Script is copied to the client browser It remains in the Web Server 23. <address>:- Displaying the address 1) <input> Tag. Attributes are a) type :- Values are text, password, checkbox, radio, reset, submit, button
2 Executed in the client browser Executed in the Web Server 24. <marquee>:-Displaying the text in a scrolling marquee. b) name:- used to give a name to the control.
3 Mainly used for validation of data Used to connect to databases and return data from the Attributes of <marquee>:- c) value:-used to provide an initial value.
web server height,width,direction(up,down,left,right),behaviour(scroll,slide,alternate),scrolldelay,scrollamount,loop,bgcolor, d) size:- sets the width of the input texts.
4 Users can block Client side scripting. Server side scripting cannot be blocked by the user hspace(horizontal space),vspace(vertical space). e) maxlength:-specifies the maximum size.
5 Features of the webserver affects the coding Features does not affects the coding. 25.<div>:-defining a section. Attributes are align,id(identifier),style. 2) <textarea> Tag:- Used for creating a multiline entry text box. Attributes are name,rows,cols.
26.<font>:-specifying the font characteristics. Attributes are color,face(type of the font),size(values ranges from 1 3) <select> Tag:- Used to create a drop down list box . Attributes are name,size,multiple.
Scripting Languages:
to 7,default value is 3) 4) <fieldset> Tag:- Used for grouping related data in a form.
A . JavaScript: Developed by Brendan Eich. Ajax(Asynchronous JavaScript and Extensible Markup Language )
27. <img> Tag:- To insert images in HTML pages. Attributes are Chapter Six
technology is used in JavaScript.
src(source),width,height,vspace,hspace,align(bottom,middle,top),border(border line around the image) Client Side Scripting Using JavaScript
B. VBScript: Developed by Microsoft Corporation.
HTML ENTITIES FOR RESERVED CHARACTERS:-1) -non breaking space,2) " - Double quotation mark <script> Tag:- This tag is used to include scripting code in an HTML page.
C. PHP:-Stands for “PHP-Hyper text Preprocessor”, developed by Rasmus Lerdorf.
3) ' - Single quotation mark 4) & - Ampersand 5) < - Less than 6) > - Greater than 7) © - Copy <script Language=”JavaScript”>
D. ASP:-Stands for Active Server pages.
right Symbol 8) ™ – Trade mark symbol 9) ® – Registered Symbol </script>
E. JSP:-Stands for Java Server Pages
Comments in HTML:- HTML comments are placed within <! --------- > tag. Functions in JavaScript:-
F.CSS:-Stands for Cascading Style Sheets.
Chapter Five function function_name()
Basic Structure of an HTML Document
Web Designing using HTML {
<html><head><title></title></head><body></body></html>
Lists in HTML body of the function;
Container Tags:-requires pair tags – i.e opening tag and closing tag. Eg. <html></html>,<head></head>
1).Ordered list(<ol><li></li></ol>):- Attributes – start and type(Arabic Numerals,Upper Case Alphabets,Lower Case }
Empty Tags:-Used opening tags only. Eg. <br>,<hr>,<img>
Alphabets,Roman Numeral Upper,Roman Numeral Lower). Data types in JavaScript:-Number(All positive and negative numbers),String(Characters enclosed within double
Attribute:-Parameters included within the opening tag. Eg <body bgcolor = ” red ”>
2).Unordered list(<ul><li></li></ul>):-Attributes - type(disc,circle,square) quotes),Boolean(true and false values)
Important Tags and Attributes
3).Definition List(<dl><dt></dt><dd></dd></dl>)[dl-definition list,dt- definition term,dd- definition description] variables:-In JavaScript , variables can be declared by using the keyword var.
1. <html> Tag:- a). dir-specifies the direction of the text to be displayed on the web page. Two values ltr(left to
Creating Links var x,y;
right) and rtl(right to left).
1).Internal Linking:-Link within the same document.<A>(anchor tag) is used. Name attribute is used for the target x=25;
b).lang:-specifies the language used within the document. Different lang values are en- english, fr- french,de-
specification and href – (means hyper reference)(# symbol is essential) attribute is used for linking purpose. y=”Kerala”;
german, it-italian,el-greek,es-spanish,ar-arabic,ja-japanese,hi-hindi and ru-russian.
2).External Linking:-Link from one web page to another web page. .<A>(anchor tag) and href attribute is used. Operators in JavaScript:-
2. <head>:-declares the head section.
URL:-Uniform Resource Locator 1) Arithmetic Operators(+,-,*,/,%,++,--)
3.<title>:-mentions the document title.
1).Relative URL :- <a href=”http://www.scertkerala.gov.in”> - represents the complete path. 2) Assignment Operators(= ,+ =,- =,*=,/=,%=)
4.<body> Tag: specifies the document body section.
2).Absolute URL:- <a href=”image.html”> - represents the specified file name only. 3) Relational Operators(<,<=,>,>=,==,!=)
1. background:-sets a background image. The important attributes are
Creating email linking:-We can create an email hyperlink to a web page using the hyper link protocol “mailto:” . 4) Logical Operators(&&(AND),|| (OR),NOT(!))
2. bgcolor:-specifies the background colour.
eg:-<a href=”mailto: [email protected]”>scert </a> 5) String Addition Operator(+)
3.text:-specifies the foreground colour.
<embed> tag is used for Inserting Music and Video:-Attributes are src,height,width,align. Control Structures in JavaScript:-
4. link:-colour of the hyperlink that are not visited by the viewer. Default colour is blue.
<bgsound> tag is used for inserting audio files only. Attributes are src,loop. 1) if(test_expression)
5.alink:-specifies the colour of the active hyperlink. Default colour is green.
<table>tag and its attributes:- {statements;
6.vlink:-specifies the colour of the hyperlink which is already visited by the viewer. Default colour is purple.
}
7.leftmargin:-leftside margin.