Chapter 1-7 Full Chapter Revision
Chapter 1-7 Full Chapter Revision
- -
Chapter 1
1
Structure
• Structure is a user-defined data type of C++ to represent a collection
of logically related data items, which may be of different types, under
a common name.
• Hetrogeneous Datatype
• User defined Datatype
Structure Example and Syntax
struct student struct structure_tag
{ {
data_type variable1;
int adm_no;
data_type variable2;
char name[20];
...................;
char group[10]; data_type variableN;
float fee; };
};
Declaring Structure Variables
• Variables should be declared for storing the details.
• Or
• structure_variable.element_name
• st.fee = 2500;
• gets(st.name);
• &
• *
Declaration of Pointer Variables
• Syntax to declare pointer variable:
• data_type * variable;
• Examples:
• int *ptr1;
• float *ptr2;
Takes place before the execution of Takes place during the execution of
the program the program
Memory Leak
Operations on Pointers
• Arithmetic
• Relational
13
Pointer and Array
• ar[10];
• ptr = &ar[0];
• cout<<ptr;
• cout<<*ptr;
• cout<<(ptr+1);
• cout<<*(ptr+1);
• cout<<(ptr+9);
38
• cout<<*(ptr+9);
Dynamic Array
• Collection of memory locations created during run time using
the dynamic memory allocation operator new.
=
• pointer = new data_type[size];
+ *
P
= New int [x];
Pointer and String
• Strings can be referenced using character pointer
• Eg:
• char *str;
• str = “hello”;
• cout<<str;
Pointer and Structure
struct employee
{
int ecode;
char ename[15];
float salary;
};
employee *eptr;
17
Pointer and Structure
• Accessing structure elements using structure pointer
• structure_pointer->element_name; -
>
• structure_variable.element_name;
18
Self Referential Structure
struct employee
{
int ecode;
char ename[15];
float salary;
employee *ep;
};
19
Self Referential Structure
• Structure in which one of the elements is a pointer to the same
structure
20
Questions
struct
1. ………… keyword is used to specify a structure.
5. Name the unary operator that returns the address of its operand. &
base address
6. The address of the first byte is known as…………
nested structu
7. Structure within a structure is termed as ....................
Questions
8. What does the following statement mean?
int *P = new int [10];
Also write a statement that declares two variables current-time and next-time
which are of type struct time time current- time, next time
;
②②
12.Compare the aspects of arrays and structures.
--
54
Procedure-Oriented Programming
• Procedure- Oriented Languages : C, Pascal, FORTRAN, BASIC
25
Object-Oriented Programming (OOP) Paradigm
• Data and Functions that operate on that data into a single unit -
Object
26
Basic concepts of OOP
• Objects
• Classes
• Data Abstraction
• Data Encapsulation
• Modularity
• Inheritance
• Polymorphism
27
Objects
• Objects have properties (also called member/data/state) and behaviour
(also called methods/member functions)
Classes
• An object is defined via its class which determines everything about an
object.
28
• This specification contains the details of the data and functions that
act upon the data.
Data Abstraction
• Showing only the essential features of the application and hiding the details
from outside world
Data Encapsulation
Encapsulation is an OOP concept that binds together the data and functions that
manipulate the data, and keeps both data and function safe from outside interference
and misuse.
Access specifiers
29 Protected : visible to its derived class also but not outside the class.
30
Inheritance
Process by which objects of one class acquire the properties and
functionalities of another class.
31
Inheritance
Existing class is called the base class
};
32
Types of Inheritance
33
Polymorphism
'Poly' means many.
34
PolymorphismTypes
35
Questions
1.________ protect data from unauthorized access.
(a) Polymorphism (b) Encapsulation (c) Data abstraction
2. Write any two advantages of Object Oriented Programming
3. What do you mean by Inheritance in C ++?
4. Explain data abstraction with an example.
5. Compare Procedural programming with Object-oriented
programming.
6. Define Polymorphism. What are its types?
Data Structures and Operations
Chapter 3
1
Data Structure
• Particular way of organizing similar or dissimilar logically
related data items which can be processed as a single unit
3
8
Classification of Data Structures
3
9
Operations on Data Structures
• Data represented by the data structures are processed by certain
operations
• Traversing
• Searching
• Inserting
• Deleting
• Sorting
• Merging
40
Stack
• DS follows LIFO (Last In First Out) principle
• Insertions and deletions made only on one end – top of the stack
41
Algorithm
Start
2: TOS = TOS + 1
3: STACK[TOS] = VAL
4: Else
Stop
Algorithm: Pop
• Start
• 3: TOS = TOS - 1
• 4: Else
• 5: Print "Stack Underflow "
• 3: End of If
• Stop
Queue
• Queue follow the First-In-First-Out (FIFO) principle
44
Algorithm
Start
2: FRONT = REAR = 0
3: Q[REAR] = VAL
5: REAR = REAR + 1
6: Q[REAR] = VAL
7: Else
8: Print "Queue Overflow "
9: End of If
43
Stop
Algorithm: Deletion
Start
1: If (FRONT > -1 AND FRONT <= REAR) Then // Empty status checking
2: VAL = Q[FRONT]
3: FRONT = FRONT + 1
4: Else
5: Print "Queue Underflow "
6: End of If
7: If (FRONT > REAR) Then // Checking the deletion of last element
8: FRONT = REAR = -1
9: End of If
Stop
46
Linked list
52
Linked List
• Collection of nodes
• Each node contains data and link(pointer to next node in the list)
48
Implementation of Linked List
struct Node
int data;
Node *link;
};
49
Questions
1.Briefly explain classification of data structure.
2
Client side scripting V/s Server side scripting
3
Cascading Style Sheet
• Cascading Style Sheets (CSS) is a style sheet language used for
describing the formatting of a document written in HTML.
• Using CSS, we can control the colour of the text, the style of fonts, the
spacing between paragraphs, how columns are sized and laid out,
borders and its colours, what background images or colours are used,
as well as a variety of other effects in a web page.
4
HTML document and Web page
• HTML
• Hyper Text Markup Language
• Used to create Webpages
5
Essential HTML Tags O
Imp
En
-
I,
Tag Description Type Attributes Ar, ,
- -
it
<html> Container Tag Lang etc,
Dir ~
<head> Container Tag -
<title> Container Tag -
<body> Container Tag Bgcolor
]
Text
Background
=
Link
Alink
Vlink
-
P
Leftmargin
6
Topmargin
Some Common Tags
N0. Tag Description E/C Attribute
1 <h1>………..<h6> Container Align
Tag
Example:
7
Some Common Tags
N0. Tag Description E/C Attribute
3 <br> Empty
Tag
Example:
8
Some Common Tags
N0. Tag Description E/C Attribute
5 <center> Container
Tag
Example:
9
Some Common Tags
N0. Tag Description E/C Attribute
6 <b> Container Tag
<i>
<u>
<s>
<big>
<small>
<strong>
<em>
<sub>
<sup>
<q>
<blockquote>
Example:
0
Some Common Tags
N0. Tag Description E/C Attribute
7 <pre> Container
Tag
Example:
8 <address> Container
Tag
Example
1
Some Common Tags
N0. Tag Description E/C Attribute
9 <marquee> Container Height
Tag Width
Bgcolor
Scrollamount
Scrolldelay
Loop
direction
Example:
2
Some Common Tags
N0. Tag Description E/C Attribute
10 <font> Container Size
Tag Color
face
Example:
3
Reserved characters
4
Comments in HTML document
Any content placed within the tag
<!-- -->
will be treated as a comment and will be completely ignored by the browser
5
Inserting Images
Tag Description E/C Attribute
<img> Empty Tag Border
Bordercolor
Height
Width
Src
Align(TMB)
Example
6
Questions
1. HTML Stands for………………………………………
2. What is a container tag ? Write an example.
3. The type of tag that requires only a starting tag but not an ending tag is
called ...............
4. For scrolling a text, we use ................ tag.
5. ……………….is the main attribute of <img> tag
6. Expand DNS.
7. A Domain Name System returns the .................. of a domain name.
8. Expand HTTPS.
Questions
9. Compare static and dynamic webpages.
10. What are the differences between client side and server side scripts ?
11. Write the service associated with the following software port number.
a) 25 b) 80 c) 443
12. Write the basic structure of HTML document.
13. Write the use of the following tags.
(a) <B> (b) <I> (c) <U> (d) <Q>
14. Classify the following into tags and attributes :
(a) BR (b) WIDTH (c) LINK (d) IMG
15. Write the names of any three attributes of <BODY>
Web Designing Using HTML
CHAPTER - 5
List
Type Tag Description E/C Attributes
0
Links in HTML
• A hyperlink (or simply link) is a text or an image in a web page that we can
click on, and move to another document or another section of the same
document.
• The <a> tag, called anchor tag is used to give hyperlinks.
• Internal Linking
• External Linking
• Graphical Linking
• Email Linking
1
Inserting Audio Video
Tag Description E/C Attribute
<embed> Container Src
Tag Height
Width
align
2
Table
Tag Description E/C Attribute
<table> To create table Container Tag Border Border color,
Bgcolor , Background,
Height , Width, align,
Cellspacing, cellpadding
Supporting Tags:
<tr>
<th>
<td>
3
Supporting Tag:
Tag Description E/C Attribute
<tr> Table Row Container Tag Bgcolor
Align
Valign
<th> Table Heading Container Tag Bgcolor
Align Valign
Colspan Rowspan
<td> Table data Container Tag Bgcolor
Align Valign
Colspan Rowspan
4
Dividing Browser Window
Tag Description E/C Attribute
<frameset> To partition the Container Cols
browser window Tag Rows
into different frame Border
sections.
<frame> Define the frame Container Src
Tag name
5
Forms in Web Pages
• HTML Forms are used to collect data from the webpage viewer for
processing.
• A Form consists of two elements:
• <FORM> container tag
• Form controls like text boxes, textarea fields, drop-down menus, radio buttons,
checkboxes, etc.
6
Supporting Tag: <tr>
Tag Description E/C Attribute
<form> To provide a container for Container Tag Action
form control method
7
Supporting Tag: <input>
Tag Description E/C Attribute
<input> Different type of control Empty Tag Type
Name
Value
8
Size
Maxlength
Supporting Tag: <textarea>
Tag Description E/C Attribute
<textarea> Text in more than one Container tag Name
line Rows
Cols
4. Write the HTML code to display the following using list tag:
• Biology Science
• Commerce
• Humanities
Questions
5. What is a definition list ? Which are the tags used to create definition list ?
6. What is a hyperlink ? Which is the tag used to create a hyperlink in HTML
document ?
7. Name any two associated tags of <TABLE> tag.
8. List out some attributes of <table> tag
9. Write HTML program to create the following webpage :
Questions
10. Write any two attributes of <TR> tag.
11. Choose the odd one out:
a. TABLE b. TR c. TH d. COLSPAN
12. Which among the following is an empty tag?
(a) <TABLE> (b) <FRAMESET> (c) <FRAME> (d) <FORM>
13. What is the use of frame tag in HTML ?
14. List out any 4 important values of TYPE attribute in the <INPUT> tag
• - false
• toUpperCase () - used to convert given string into uppercase.
-
onClick
onMouseEnter
t -
Even
-
onMouseLeave
- -
onKeyUp
-
onKeyDown
-
MULTIPLICATION
<script Language=JavaScript>
function ……………………..
{
var a,b,c;
a=Number(document.frm.n1.value);
b=Number(document.frm.n2.value);
…………………
document.frm.n3.value=c;
}
</script>
CUBE
<script Language=JavaScript>
function ……………………………….
{
var a,b;
a=Number(document.frm.n1.value);
b=a*a*a;
document.frm.n2.value=b;
}
</script>
Ways to add script
Inside body section
Scripts will be executed while the content of the web page is being loaded.
External file
Scripts can be placed into an external file ,saved with .’js’ extension.
It can be used by multiple HTML pages and also helps to load pages faster.
The file is linked to HTML file using the <SCRIPT> tag.
Questions
1.Which tag is used to include script in an HTML page?
2. What are the Data Types in Javascript?
6. Write the syntax to declare a variable in Java Script with one example.
Questions
7. What are the different methods for adding Scripts in an Html Page?
8
Types of Hosting
• The selection of web hosting type depends on
(i) Amount of storage space
(ii) Number of expected visitors
(iii)Data base requirement
(iv) Support of programming languages.
00
Dedicated Hosting
• The client leases the entire web server and all its resources.
• It is not shared.
• Websites of large organizations, government departments, etc.
where there are large numbers of visitors, opt for dedicated
web hosting.
• Dedicated servers provide fast access.
• Expensive.
01
VPS
• VPS : Virtual Physical Server
• It is virtually partitioned into several servers.
• Each VPS works similar to a dedicated server and has its own
separate server operating system
03
CMS
• Content Management System (CMS) refers to a web based software
system which is capable of creating, administering and publishing
websites.
• CMS provides an easy way to design and manage attractive websites.
• Templates are available for download.
• Advantages:
• CMS provides standard security features in its design.
• Help people with less technical knowledge to design and develop secure websites.
• The templates reduce the need for repetitive coding and design for headings and menus
that appear in all pages in a website
• CMS is economical
04
• Some of the popular CMS software are WordPress, Drupal and Joomla!
Responsive Web Design
• Responsive web design is the custom of building a website suitable
to work on every device and every screen size, no matter how large
or small, mobile phone or desktop or television.
• Responsive web design can be implemented using flexible grid
layout, flexible images and media queries.
• Flexible grid layouts set the size of the entire web page to fit the
display size of the device.
• Flexible images and videos set the image/video dimensions to the
percentage of display size of the device.
05
Questions
1. Explain the different types of Web Hosting.
3. Explain the need for applying responsive web design while developing
websites