0% found this document useful (0 votes)
25 views42 pages

CS 1 Practical Handbook

.

Uploaded by

yugkamalsharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views42 pages

CS 1 Practical Handbook

.

Uploaded by

yugkamalsharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 42

COMPUTER SCIENCE I (D93)

SOFTWARE USED FOR HTML PRACTICALS IN COMPUTER LAB

VISUAL STUDIO CODE

1
COMPUTER SCIENCE I (D93)
INDEX
SR EXPERIMENT NAME
NO.

C++

01 Write a program in C++ that first initializes an array of given 10 real numbers.
The program must sort numbers in ascending/descending order using Bubble –
Sort method. It should print the given list of numbers as well as the sorted list.

02 Write a function in C++ that exchanges data (passing by reference)


using swap function to interchange the given two numbers.

03 Write a program in C++ that first initializes an array of given 10 sorted real
numbers. The program must verify whether a given element belongs this array or
not, using Binary – Search technique. The element (to be searched) is to be
entered at the time of execution. If the number is found, the program should print
its position in the array otherwise it should print “The number is not found.”

04 Write a program in C++ that first initializes an array of five given numbers
(short /float/ double). The program must add these numbers by traversing this
array with a pointer. The output should print the starting address of the array with
the size of the number (in bytes) to which it points. The program must also print
the sum and pointer address with addition of every number as well as the ending
address.

05 Write a program in C++ that initializes a Ratio class with no parameters as a


default constructor. The program must print the message “OBJECT IS BORN”
during initialization. It should display the message “NOW X IS ALIVE’’, when
the first member function Ratio x is called. The program must display “OBJECT
DIES” when the class destructor is called for the object when it reaches the end of
its scope.

06 Implement a Circle class in C++. Each object of this class will represent a circle,
storing its radius and X & Y coordinates of its center as floats. Include a default
constructor, access functions an area() and circumference() of circle. The program
must print coordinates with radius, area and circumference of the circle.

07 Write a C++ program using virtual function. The program must declare p to be a
pointer to objects of the base
class Person. First, the program must assign p to point an instance X (name of the
person eg. “BOB”)
of class
2
COMPUTER SCIENCE I (D93)
person. The program must then assign p to point at an instance y( name of the stu
dent, eg. ”Tom”) of the derived class Student.
Define a print () in the base class such that it invokes the same base class function
to print
the name of the person by default. The second call for the same should evoke the
derived class function to print the name of the student.

08 Write a program in C++ to read the name of a country from one text file and nam
e of its corresponding capital
city from another text file. The program must display the country name and indica
te its corresponding capital (for at least five countries) in the output

09 Write a C++ program that first initializes an array of given 10 sorted real number
s. The program must verify
whether a given element belongs this array or not, using linear search technique.
The element (to be searched)
is to be entered at the time of execution if the number is found, the
program should print its position in the
array otherwise it should print” The number is not found”.

10 Write a C++ program to implement the concept of friend function

11 Write a C++ program to implement the concept of single inheritance

12 Write a C++ program to implement the concept of function overloading

HTML

13 Create a simple HTML page on any of the following topics: College Profile,
Computer Manufacturer or Software Development Company.The page must
consist of at least 3 paragraphs of text. The page must have an appropriate title,
background color or background image, and hyper-links to other pages. The
paragraphs must have text consisting of different colors and styles in terms of
alignment and Font Size.

14 Create a simple HTML page on any of the following topics: College Profile,
Computer Manufacturer or Software Development Company.The page must
consist of a scrolling marquee displaying an appropriate Message. The page must
include a table with at least 5 rows and 3 columns having merged cells at least at
1 place. The page must also display an image, such that when the same is viewed
through a browser and the mouse is placed (hovered) on the Image, an
appropriate text message should be displayed. The image itself should also act as

3
COMPUTER SCIENCE I (D93)
a hyper-link to another page.

15 Create a simple HTML page on any of the following topics: College Profile,
Computer Manufacturer or Software Development Company.The page must
consist of at least 3 paragraphs of text. The page must have an appropriate title,
background color or background image, and hyper-links to other pages. The
paragraphs must have text consisting of different colors and styles in terms of
alignment and Font Size.

16 Create simple HTML page which should contain scrolling marquee


displaying appropriate message. Include different
list tag in it
17 CreatesimpleHTMLpagewhichconsistatleast1paragraph,backgroundcolour,tex
tconsistingofdifferentcoloursandstyleintermsofalignmentandfontsize.
18 CreatesimpleHTMLpagewhichshouldcontainsimpletablewithatleast5rowsand3col
umns.Createtablehavingmergedcellsatleast at1place.

19 CreatesimpleHTMLpagewhichshouldcontainsimpletable tags and also use


marquee tag.

PROGRAMMING IN C++
EXPERIMENT NO. 1

Write a program in C++ that first initializes an array of given 10 real numbers. The program
must sort numbers in ascending/descending order using Bubble – Sort method. It should print
the given list of numbers as well as the sorted list.

SOLUTION

#include<iostream>

using namespace std;

int main()

int array[100]; //array decl

inti,j,size;

4
COMPUTER SCIENCE I (D93)
cout<<"Enter the no. of elements you want to enter \n";

cin>>size;

cout<<"Enter the elements \n";

for(i=0;i<size;i++)

cin>>array[i];

cout<<"Content of the array \n";

for(i=0;i<size;i++)

cout<<array[i]<<"\t";

for(i=0;i<size;i++) // outer for loop

for(j=i;j<size;j++) //inner for loop

if(array[i] > array[j+1]) //if condition

int temp = array[j+1];

array[j+1]= array[i];

array[i]=temp;

} //end of if

} //end of inner loop

} // end of outer loop

cout<<endl;

cout<<"The sorted list is \n";


5
COMPUTER SCIENCE I (D93)
for(i=0;i<size;i++)

cout<<array[i]<<endl;

return 0;

OUTPUT:

6
COMPUTER SCIENCE I (D93)

EXPERIMENT NO. 2

Write a function in C++ that exchanges data (passing by reference) using swap function to
interchange the given two numbers.

SOLUTION

#include<iostream>

using namespace std;

void swap(float *f1,float *f2) // passing by reference

floattmp=*f1;

*f1=*f2;

*f2=tmp;

7
COMPUTER SCIENCE I (D93)
int main()

float num1,num2;

cout<<"Enter the first number:";

cin>>num1;

cout<<"Enter the second number:";

cin>>num2;

swap(&num1,&num2); // function calling

cout<<num1<<endl;

cout<<num2<<endl;

return 0;

OUTPUT

8
COMPUTER SCIENCE I (D93)

EXPERIMENT 3

Write a program in C++ that first initializes an array of given 10 sorted real numbers. The
program must verify whether a given element belongs this array or not, using Binary –
Search technique. The element (to be searched) is to be entered at the time of execution. If the
number is found, the program should print its position in the array otherwise it should print
“The number is not found.”

SOLUTION

#include<iostream>

using namespace std;

int main()

intbeg,end,mid,check,search;

9
COMPUTER SCIENCE I (D93)
int array[10] = { 1,2,3,4,5,6,7,8,9,10};

beg=0;

end=9;

cout<<"The elements present in array are as folllows \n";

for(int i=0;i<10;i++)

cout<<array[i]<<"\t";

cout<<endl;

cout<<"Enter the item you want to search from array \n";

cin>>search;

while(beg<=end)

mid=(beg+end)/2;

if(array[mid] == search)

check=1;

break;

else if(array[mid]>search)

end=mid-1;

else

beg=mid+1;

if(check==1)

{
10
COMPUTER SCIENCE I (D93)

cout<<"The position of search item is=\t"<<mid<<endl;

cout<<"The search was successfull";

else

cout<<"The search item not found";

return 0;

OUTPUT

11
COMPUTER SCIENCE I (D93)

EXPERIMENT NO. 4

Write a program in C++ that first initializes an array of five given numbers (short /float/
double). The program must add these numbers by traversing this array with a pointer. The
output should print the starting address of the array with the size of the number (in bytes) to
which it points. The program must also print the sum and pointer address with addition of
every number as well as the ending address.

SOLUTION

#include<iostream>

using namespace std;

int main()

float a[] = {5.5, 4.4, 3.3, 2.2, 1.1}, sum = 0;

int i;
12
COMPUTER SCIENCE I (D93)
cout<<"\n The base address of the array is : "<<a;

cout<<"\n The base element of the array is : "<<*a;

cout<<"\n The size of the element to which the pointer is pointing : "<<sizeof(*a)<<" bytes";

for(i=0; i<5 ; i++)

sum = sum + *(a+i);

cout<<"\n The "<<(i+1)<<" element in the array is : "<<*(a+i)<<" and its address is :
"<<(a+i);

cout<<"\n The sum of first "<<(i+1)<<" element(s) is : "<<sum;

cout<<"\n The ending address of the array is : "<<(a+4);

cout<<"\n The ending element of the array is : "<<*(a+4);

return 0; }

OUTPUT

13
COMPUTER SCIENCE I (D93)

EXPERIMENT NO. 5

Write a program in C++ that initializes a Ratio class with no parameters as a default
constructor. The program must print the message “OBJECT IS BORN” during initialization. It
should display the message “NOW X IS ALIVE’’, when the first member function Ratio x is
called. The program must display “OBJECT DIES” when the class destructor is called for the
object when it reaches the end of its scope.

SOLUTION

#include<iostream>

using namespace std;

class Ratio

private:

floatnum, deno;

public:
14
COMPUTER SCIENCE I (D93)
Ratio() // default constructor declared with no parameters

cout<< "Object r1 is born \n";

~Ratio() // destructor defined

cout<< "Object r1 dies \n";

};

int main()

Ratio r1;

cout<< "Now object r1 is alive \n";

cout<< "End of program \n";

return 0;

OUTPUT

15
COMPUTER SCIENCE I (D93)

EXPERIMENT NO. 6

Implement a Circle class in C++. Each object of this class will represent a circle, storing its
radius and X & Y coordinates of its center as floats. Include a default constructor, access
functions an area() and circumference() of circle. The program must print coordinates with
radius, area and circumference of the circle.

SOLUTION
#include <iostream>
using namespace std;
class Circle
{
private:
floatx,y,r;
float area, circum;

public:
void assign();
void area1();
voidcircumf();
16
COMPUTER SCIENCE I (D93)
void print();
void circle();

};
void Circle::circle()
{}
void Circle::assign()
{
cout<<"enter x y co-ordinates\n";
cin>>x>>y;
cout<<"enter radius\n";
cin>>r;
}
void Circle::area1()
{
area=3.14*r*r;
}
void Circle::circumf()
{
circum=2*3.14*r;

}
void Circle::print()
{
cout<<"x and y coordinates are: "<<x<<" and "<<y<<endl;
cout<<"The radius is: "<<r<<endl;
cout<<"The area is: "<<area<<endl;
cout<<"The circumference is: "<<circum<<endl;
}
int main()
{
Circle c1;
c1.assign();
c1.area1();
c1.circumf();
c1.print();
c1.circle();
return 0;
}
OUTPUT

17
COMPUTER SCIENCE I (D93)

EXPERIMENT NO. 7

Write a C++ program using virtual function. The program must declare p to be a
pointer to objects of the base class Person. First, the program must assign p to
point an instance X (name of the person eg. “BOB”) of class person.
The progra must then assign p to point at an instance y( name of the student, eg. ”Tom”) of
the derived class Student.
Define a print () in the base class such that it invokes
the same base class function to print the name of the person by default.
The second call for the same should evoke the derived class function to print the name
of the student.

SOLUTION
#include<iostream>
using namespace std;
class Person
{
public:
virtual void print()
18
COMPUTER SCIENCE I (D93)
{
cout<< "My name is BOB" <<endl;
}
};
class Student : public Person
{
public:
void print()
{
cout<< "My name is TOM" <<endl;
}
};
int main()
{

Person x,* bptr;


bptr=&x;
bptr->print();
Student y;
bptr = &y;
// virtual function, binded at runtime
bptr->print();
return 0;
}

OUTPUT

19
COMPUTER SCIENCE I (D93)

EXPERIMENT NO. 8

Write a program in C++ to read the name of a country from one text file and name of its corre
sponding capital
city from another text file. The program must display the country name and indicate its corres
ponding capital (for at least five countries) in the output.

SOLUTION

#include<iostream>
#include<fstream>
using namespace std;
int main()
{

charcname[80],cap[80];
ifstream ifile1,ifile2;
ofstreamofile;
20
COMPUTER SCIENCE I (D93)
ofile.open("country.dat");
ofile<<"India\nUSA\nUK\nJapan\nFrance";
ofile.close();
ofile.open("capital.dat");
ofile<<"New Delhi\nWashisngton dc\nLondon\nTokyo\nParis";
ofile.close();
ifile1.open("country.dat");
ifile2.open("capital.dat");
cout<<"\ncountry\tcapital\n";
cout<<"===============";
while(!ifile1.eof()&&!ifile2.eof())
{
ifile1.getline(cname,80);
ifile2.getline(cap,80);
cout<<endl<<cname<<"\t"<<cap<<"\n";
}
ifile1.close();
ifile2.close();
return 0;
}

OUTPUT

21
COMPUTER SCIENCE I (D93)

EXPERIMENT NO. 9

Write a C++ program that first initializes an array of given 10 sorted real numbers.
The program must verify whether a given element belongs to this array or not, using linear
search technique.The element (to be searched) is to be entered at the time of execution if the
number is found, the program should print its position in the array otherwise it should print
“ The number is not found”

SOLUTION
#include<iostream>
using namespace std;
int main()
{

intarr[10], i, num, index;


cout<<"Enter 10 Numbers: "<<endl;
for(i=0; i<10; i++)
cin>>arr[i];
cout<<"Enter a Number to Search: \n ";
22
COMPUTER SCIENCE I (D93)
cin>>num;
for(i=0; i<10; i++)
{
if(arr[i]==num) //match found
{
index = i; //store location in index and come out
break;
}
}
cout<<"Found at Index No.\t"<<index;
cout<<endl;
return 0;
}

OUTPUT

23
COMPUTER SCIENCE I (D93)

EXPERIMENT NO. 10

Write a C++ program to implement the concept of friend function

SOLUTION

#include <iostream>
using namespace std;
class Box
{
private:
int length;
public:
Box (): length (0) {}
friend intprintLength (Box); //friend function
};
intprintLength (Box b)
{
b. length +=10;
24
COMPUTER SCIENCE I (D93)
return b. length;
}
int main ()
{
Box b;
cout<<"Length of box:"<<printLength (b)<<endl;
return 0;
}

OUTPUT

EXPERIMENT NO. 11

Write a C++ program to implement the concept of single inheritance

SOLUTION

#include <iostream>
using namespace std;
class Account {
public:
float salary = 60000;
};
class Programmer: public Account {
public:
float bonus = 5000;
};
int main(void) {
Programmer p1;
cout<<"Salary: "<<p1.salary<<endl;
25
COMPUTER SCIENCE I (D93)
cout<<"Bonus: "<<p1.bonus<<endl;
return 0;
}

OUTPUT

EXPERIMENT NO. 12

Write a C++ program to implement the concept of function overloading

SOLUTION

#include <iostream>
using namespace std;
void add(int a, int b)
{
cout<< "sum = " << (a + b);
}
void add(double a, double b)
{
cout<<endl<< "sum = " << (a + b);
}
// Driver code
int main()
{
add(10, 2);
26
COMPUTER SCIENCE I (D93)
add(5.3, 6.2);
return 0;
}

OUTPUT

HTML

EXPERIMENT NO.13

Create a simple HTML page on any of the following topics: College Profile, Computer
Manufacturer or Software Development Company.The page must consist of at least 3
paragraphs of text. The page must have an appropriate title, background color or background
image, and hyper-links to other pages. The paragraphs must have text consisting of different
colors and styles in terms of alignment and Font Size.

SOLUTION

FIRST.HTML

<html>
<head><title> International Business Machines Corporation</title></head>
<body bgcolor="white">
<H1 align="center"> International Business Machines Corporation(IBMC)</H1>
<p align="left"><font size="+1" color="blue" > International Business Machines Corporation
(commonly referred to as IBM) is an American multinational technology company
headquartered in Armonk, New York, United States, with operations in over 170 countries.
27
COMPUTER SCIENCE I (D93)
The company originated in 1911 as the Computing-Tabulating-Recording Company (CTR)
and was renamed “International Business Machines” in 1924.</font></p>

<p align="right"><font size="+2" color="green"> IBM has continually shifted its business
mix by exiting commoditizing markets and focusing on higher-value, more profitable markets.
This includes spinning off printer manufacturer Lexmark in 1991 and selling off its personal
computer (ThinkPad) and x86-based server businesses to Lenovo (2005 and 2014,
respectively), and acquiring companies such as PwC Consulting ,SPSS, and The Weather
Company (2016).</font></p>

<p align="center"><font size="+3" color="black"> Nicknamed Big Blue, IBM is one of 30


companies included in the Dow Jones Industrial Average and one of the world’s largest
employers, with (as of 2016) nearly 380,000 employees. Known as “IBMers”, IBM
employees have been awarded five Nobel Prizes, six Turing Awards, ten National Medals of
Technology and five National Medals of Science.</font></p>

<a href="second.html">Visit next page</a>

</body>
</html>

SECOND.HTML
<html>
<head><title> International Business Machines Corporation</title></head>
<body>
<H3> International Business Machines Corporation(IBMC)</H3>
<p> To know more about International Business Machines Corporation(IBM) product,
services and career you can visit original website.
</p>

<a href="first.html">Visit First page</a>

</body>
</html>

OUTPUT:
FIRST.HTML

28
COMPUTER SCIENCE I (D93)

SECOND.HTML

EXPERIMENT NO.14

Create a simple HTML page on any of the following topics: College Profile, Computer
Manufacturer or Software Development Company.The page must consist of a scrolling
marquee displaying an appropriate Message. The page must include a table with at least 5
rows and 3 columns having merged cells at least at 1 place. The page must also display an
image, such that when the same is viewed through a browser and the mouse is placed
(hovered) on the Image, an appropriate text message should be displayed. The image itself
should also act as a hyper-link to another page.

SOLUTION

TABLE.HTML

<html>
<head><title> International Business Machines Corporation</title></head>
<body>
<marquee><H3> International Business Machines Corporation(IBMC)</H3></marquee>
29
COMPUTER SCIENCE I (D93)
<p> How your business can get smarter,To know more about International Business Machines
Corporation(IBM) product, services and career you can see our table and can refer original
website.
</p>
<table border="2″ cellpadding="20″ cellspacing="2″ align="center">
<tr>
<thcolspan="3"> OUR SERVICES </th>
<tr>
<th> Product </th>
<th> Services</th>
<th> Prices</th>
</tr>

<tr>
<td> Cloud Computing</td>
<td> PC cloud </td>
<td> 9000</td>
</tr>
<tr>
<td> Mobile cloud </td>
<td>software</td>
<td> 1000</td>
</tr>
<tr>
<td> Security </td>
<td> Hardware </td>
<td> 9000</td>
</tr>
<tr>
<td> Storage </td>
<td> File Storage </td>
<td> 8000</td>
</tr>
</table>
<a href="next.html"><imgsrc="cloud.png" title="cloud Picture" align="center" width="500″
height="500″ ></a>
</body></html>

NEXT.HTML
<html>
<head><title> International Business Machines Corporation</title></head>
<body>
<H3> International Business Machines Corporation(IBMC)</H3>
<p> To know more about International Business Machines Corporation(IBM) product,
services and career you can visit original website.
30
COMPUTER SCIENCE I (D93)
</p>

<a href="table.html">Visit First page</a>

</body>
</html>

OUTPUT:
TABLE.HTML

OUTPUT:
NEXT.HTML

31
COMPUTER SCIENCE I (D93)

EXPERIMENT NO.15

Create a simple HTML page on any of the following topics: College Profile, Computer
Manufacturer or Software Development Company.The page must consist of at least 3
paragraphs of text. The page must have an appropriate title, background color or background
image, and hyper-links to other pages. The paragraphs must have text consisting of different
colors and styles in terms of alignment and Font Size.

SOLUTION

FIRST.HTML

<html>
<head><title>MUMBAI UNIVERSITY</title></head>
<body bgcolor="white">
<H1 align="center"> MUMBAI UNIVERSITY</H1>
<p align="left"><font size="+1" color="blue" > The University of Mumbai (known earlier as
University of Bombay) is one of the oldest and premier Universities in India.
32
COMPUTER SCIENCE I (D93)
It was established in 1857 consequent upon “Wood’s Education Dispatch”, and it is one
amongst the first three Universities in India. As a sequel to the change in the name of the city
from Bombay to Mumbai, the name of the University has been changed from “University of
Bombay” to “University of Mumbai”, vide notification issued by the Government of
Maharashtra and published in the Government Gazette dated 4th September, 1996.The
University was accorded 5 star status in 2001 & ‘A’ grade status in April 2012 by the National
Assessment and Accreditation Council (NAAC).</font></p>

<p align="left"><font size="+3" color="black"> VISION</font></p>


<p align="center"><font size="+1" color="green"> The vision statement of the University of
Mumbai given below reflects its deep conviction for high quality inclusive education: To
remain always inclusive and quality conscious, and with deep conviction that knowledge not
only improves the quality of life, but leads to good character, to capitalize on our inherent
advantages to generate skilled manpower for nation building through excellent teaching,
attracting talent, fostering creativity, research, and innovation.</font></p>

<p align="left"><font size="+3" color="black"> MISSION</font></p>


<p align="left"><font size="+1" color="black"> 1) To provide free and conducive
atmosphere for creative thinking and impart deep disciplinary knowledge with an
interdisciplinary bandwidth to the learners in order to make them problem solvers, leaders and
entrepreneurs</font></p>
<p align="left"><font size="+1" color="black"> 2) To assimilate and transmit the values of
honesty, equality, human dignity, and inclusivity</font></p>
<p align="left"><font size="+1" color="black"> 3) To make optimum use of available
resources and investments through unconventional means</font></p>
<p align="left"><font size="+1" color="black"> 4) To undertake research in frontier and
emerging areas to advance knowledge and through innovation turn it into intellectual property
and entrepreneurship to accelerate growth</font></p>
<p align="left"><font size="+1" color="black"> 5) To contribute effectively to the welfare of
society, address the local and global challenges; respecting culture, environment, and
sustainability</font></p>
<p align="left"><font size="+1" color="black"> 6) To attract, retain and engage talent in
diverse disciplines and promote academic rigour and scholarship</font></p>
<p align="left"><font size="+1" color="black"> 7) To achieve good governance through
comprehensive digitization, decentralization, and state of the art infrastructure.</font></p>

<a href="second.html">Visit next page</a>

</body>
</html>

33
COMPUTER SCIENCE I (D93)
SECOND.HTML

<html>
<head><title> MUMBAI UNIVERSITY</title></head>
<body>
<H3>Facilities</H3>
<p> Knowledge Resource Centre</p>
<p>Gym Khana</p>
<p> Virtual Classrooms</p>
<p> University Health Care Centre</p>

<a href="first1.html">Visit First page</a>

</body>
</html>

OUTPUT

FIRST.HTML

34
COMPUTER SCIENCE I (D93)

OUTPUT

SECOND.HTML

EXPERIMENT NO.16

Create simple HTML page which should contain scrolling marquee displaying appropriate me
ssage. Include different
35
COMPUTER SCIENCE I (D93)
list tag in it

SOLUTION
<html>
<head>
<title>List</title>
</head>
<bodybgcolor="lime">
<marquee><H3> COMPUTER SCIENCE</H3></marquee>

<b><u>OrderListtagexampleisbelow:‐</u></b>

<ol>
<li>Operatingsystem</li>
<li>DataStructure</li>
<li>HTML</li>
<li>c++programming</li>
</ol>

<b><u>OrderListtagexamplewithattributesisbelow:‐</u></b>

<olstart=”25”type=”A”>
<li>Operatingsystem</li>
<li>DataStructure</li>
<li>HTML</li>
<litype=”I”>C++programming</li>
</ol>

<hr>

<b><u>UnorderListtagexampleisbelow:‐</u></b>

<ultype="square">
<li>IntroductionofMicroprocessor</li>
<li>InstructionSetandprogramming</li>
<litype="circle">IntroductiontoMicrocontroller</li>
<litype="disc">NetworkTechnology</li>
</ul>

<hr>

<b><u>DefinitionListtagexampleisbelow:‐</u></b>

36
COMPUTER SCIENCE I (D93)
<dl>
<dt>Software</dt>
<dd><strong>Software</
strong>isasetofprogramwhichisrequiredtorunthesystem.</dd>
<dt>Hardware</dt>
<dd><strong>Hardware</
strong>areelectroniccomponentsusedinthecomputersystem.</dd>
</dl>
</body>
</html>

OUTPUT

EXPERIMENT NO.17

CreatesimpleHTMLpagewhichconsistatleast1paragraph,backgroundcolour,textconsistingo
fdifferentcoloursandstyleintermsofalignmentandfontsize.
37
COMPUTER SCIENCE I (D93)
SOLUTION

<html>
<head>
<title> College profile </title>
</head>

<body bgcolor="skyblue">

<h3><u><font color="purple" face="cooper black"><center>PIONEER COLLEGE


</center></font></u></h3>
<hr size="1"color="black">
<p><font face="Arial black" color="blue" size="5"><b><i>Poineer College
</font></i></b><font face="Arial black" size= "5">Pioneer Education Trust’s
PIONEER JUNIOR COLLEGE OF SCIENCE
JagjiwanNiwas, Gokhale Road (N), Dadar (W), Mumbai-400 028
Tel No.: 2444 6538
E-mail : [email protected]</font></p>
</body>
</html>

OUTPUT

EXPERIMENT NO.18

CreatesimpleHTMLpagewhichshouldcontainsimpletablewithatleast5rowsand3columns.Create
tablehavingmergedcellsatleast at1place.

38
COMPUTER SCIENCE I (D93)
SOLUTION

<html>
<head>
<title> table </title>
</head>
<body bgcolor="orange">
<caption>Wind </caption>
<table border="2" cellpadding="10" cellsapcing="50">
<tr>
<th> City</th>
<th> High</th>
<th> Low</th>
</tr>
<tr>
<td>Mumbai</td>
<td> 33</td>
<td> 24</td>
</tr>
</table>
<br><hr>
<center>TABLE 2</center>
<br>
<caption> Result</caption>
<table border="2">
<tr>
<throwspan="2">Sr.No. </th>
<throwspan="2">Student<br> Name</th>
<thcolspan="3">Marks Obtained </th>
<throwspan="2">Total <br></th>
</tr>
<tr>
<td> Test1 </td>
<td>Test2 </td>
<td> Test3 </td>
</tr>
<td align="center">1</td>
<td>Maheshwari</td>
<td>150</td>
<td>100</td>
<td>100</td>
<td>350</td>
</tr>
<tr>
39
COMPUTER SCIENCE I (D93)
<td align="center">2</td>
<td>Ravi</td>
<td>120</td>
<td>100</td>
<td>100</td>
<td>320</td>
</tr>
</table>
</body>
</html>

OUTPUT

EXPERIMENT NO. 19

CreatesimpleHTMLpagewhichshouldcontainsimpletable tags and also use marquee tag.

SOLUTION
40
COMPUTER SCIENCE I (D93)

<!DOCTYPE html>
<html>
<style>
table, th, td {
border:1px solid black;
}
</style>
<body>
<h1><marquee>STUDENT DATA</marquee></h1>
<h3>A basic HTML table</h3>

<table style="width:100%">
<tr>
<th>NAME</th>
<th>SUBJECT</th>
<th>MARKS</th>
</tr>
<tr>
<td>ABC</td>
<td>PHYSICS</td>
<td>20</td>
</tr>
<tr>
<td>PQR</td>
<td>CHEMISTRY</td>
<td>35</td>
</tr>
</table>
</body>
</html>

OUTPUT:

41
COMPUTER SCIENCE I (D93)

42

You might also like