Practcal Manual Computer Science PDF
Practcal Manual Computer Science PDF
Notes
Practical 1
Objective
After completion of this practical you will be able to create your personal
e-mail account.
Software required
z Internet Explorer / Mozila /Google Chrome (any browser).
Pre-requisite
z You should be able to use Computer/Laptop.
z You should have the knowledge of internet.
Procedure
z Make sure your computer is “On” and Internet service is enabled there.
z Open any web browser (i.e., Internet Explorer, Mozila, Google Chrome, etc.).
z Type URL www.gmail.com ( for gmail account).
z Click on sign up button.
z Fill in the registration form.
z Read the terms and conditions then accept it.
z Submit the filled form.
z Now your account is created and you can use it for communication.
Computer Science 1
Practical Manual
Learner’s Observations
...........................................................................................................................
Notes ...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
2 Computer Science
Practical Manual
Notes
Practical 2
Objective
After completion of this practical you will be able to use Office productivity tools
like Writer, Calc and Impress.
Software required
z OpenOffice Writer
z OpenOffice Calc
z OpenOffice Impress
Pre-requisite
z Theoretical knowledge of text documents, spreadsheets and presentations.
Procedure
z Open OpenOffice Writer.
z Form a document that showcases the company and its objectives. Also write
the major achievements for the last financial year.
z Format the document using appropriate font size, style and colour.
z Save your file by any name (say ABCdoc.odt ).
z Open OpenOffice Calc.
Computer Science 3
Practical Manual
Learner’s Observations
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
4 Computer Science
Practical Manual
Notes
Practical 3
Write a C++ program to accept two numbers, a float and an integer and display the
following :-
a) Sum of two numbers in integer form.
b) Sum of two numbers in float form.
Objective
After completion of this practical you will be able to use basic data types,
operators and type conversion in C++.
Software required
z Turbo C++
Pre-requisite
Learner should have the basic knowledge of characters, tokens, basic data types,
input output streams and type conversion.
Procedure
z Accept two numbers using input stream.
z Add two numbers using arithmetic operators.
z Display the numbers in integer and float form using output stream.
Computer Science 5
Practical Manual
Learner’s Observations
...........................................................................................................................
Notes ...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
6 Computer Science
Practical Manual
Notes
Practical 4
Write a C++ program that accepts radius and then displays the area and perimeter
of a circle. Consider “Pi” as a constant with value 3.14.
Objective
After completion of this practical you will be able to use the basic data types,
operators, constants and variables in C++.
Software required
z Turbo C++
Pre-requisite
Learner should have the basic knowledge of characters, tokens, basic data types,
constants and variables and input output streams.
Procedure
z Accept two numbers using input stream.
z Calculate area of the circle (pi*r*r) and perimeter (2*pi*r).
z Display the result in appropriate form using output stream.
Learner’s Observations
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Computer Science 7
Practical Manual
...........................................................................................................................
...........................................................................................................................
Notes ...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
8 Computer Science
Practical Manual
Notes
Practical 5
Objective
After completion of this practical you will be able to use conditional operator.
Software required
z Turbo C++
Pre-requisite
z Learner should have the basic knowledge of C++ program.
Procedure
z Accept a number from the user using input stream.
z Use conditional operator for finding whether the number is even or odd.
Computer Science 9
Practical Manual
Learner’s Observations
...........................................................................................................................
Notes ...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
10 Computer Science
Practical Manual
Notes
Practical 6
Objective
After completion of this practical you will be able to use conditional statements
like:-
if ….. else
if …… elseif…else
Software required
z Turbo C++
Pre-requisite
z Learner should have the basic knowledge of writing a C++ program and also
know about compound, null and conditional statements.
Procedure
z Accept a character from the user.
z Use if … else statement for finding the character is alphabet, digit, or a special
character.
z Syntax of if statement
if(condition)
{ code when true }
else
{ code when not true }
z Display the result.
Computer Science 11
Practical Manual
Learner’s Observations
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
12 Computer Science
Practical Manual
Notes
Practical 7
Write a C++ program to accept a number and display the corresponding number
of week day
E.g., If the user enters “1” display “ Monday”, if the user enters “2” display “
Tuesday”…… and so on.
Objective
After completion of this practical you will be able to use conditional statement,
switch…… case.
Software required
z Turbo C++
Pre-requisite
z Learner should have the basic knowledge of a C++ program and know about
switch … case construct.
Procedure
z Accept a number from the input stream.
z Use switch case statement like
Syntax
switch (variable)
{
case 1: statement1 ; break;
case 2: statement 2 ; break;
case 3:statement 3; break;
.
.
.
default: default statement break;
}
z Display the result.
Computer Science 13
Practical Manual
Learner’s Observations
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
14 Computer Science
Practical Manual
Notes
Practical 8
Write a C++ program (using while loop ) to display all the multiples of 5 from 100
to 50.
Objective
After completion of this practical you will be able to use looping statement while ( ).
Software required
z Turbo C++
Pre-requisite
z Learner should have the basic knowledge of writing a C++ program and
know the working of while loop.
Procedure
z Use while loop
z Syntax
while(test-expression)
{
body of the loop
Increment / decrement
}
z Display the result.
Computer Science 15
Practical Manual
Instructor’s signature
16 Computer Science
Practical Manual
Notes
Practical 9
Objective
After completion of this practical you will be able to use do …… while statement.
Software required
z Turbo C++
Pre-requisite
z Learner should have the basic knowledge of working of conditional and looping
statements.
Procedure
z Use do.. while loop in the program.
z Use logic for displaying Fibonacci series 0,1,1,2,3,5,8….
z Syntax
do
{
Body of the loop
Increment / decrement statements
}while(test-expression);
z Display fibonacci series.
Computer Science 17
Practical Manual
Instructor’s signature
18 Computer Science
Practical Manual
Notes
Practical 10
Write a C++ program using for loop to find whether the number is an Armstrong
number or not.
Objective
After completion of this practical you will be able to use “for loop”.
Software required
z Turbo C++
Pre-requisite
z Learner should have the basic knowledge of conditional and looping
statements.
Procedure
z Accept a number from the input stream.
z Use for loop in the program.
z Syntax
for (initialization; condition; increment/decrement)
{
Body of the loop
}
z An Armstrong number is one whose sum of cube of digits is the number itself.
For example 153 is an Armstrong number.
153=1^3+5^3+3^3
z Use the required logic in the program for finding if the given number is
Armstrong or not.
z Display the relevant result.
Computer Science 19
Practical Manual
Learner’s Observations
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
20 Computer Science
Practical Manual
Notes
Practical 11
Write a menu driven program to swap two numbers using call by value and call by
reference.
Objective
After completion of this practical you will be able to structure your program
where a large program can be divided into smaller, simpler modules using user
defined functions.
Software required
z Turbo C++
Pre-requisite
z A basic knowledge of functions ( prototype, definition, call with arguments
and return types).
Procedure
z Accept two numbers from the input stream.
z Create function for swapping two numbers.
z Use call by value method and swap two numbers.
z Use call by reference method and swap two numbers.
Syntax for function prototype:
return-type function_name( arg-types);
Syntax of function definition
return-type function_name( arg-types)
{
declarations;
statements;
}
Computer Science 21
Practical Manual
Learner’s Observations
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
22 Computer Science
Practical Manual
Notes
Practical 12
Objective
After completion of this practical you will be able to structure program where a
large program can be divided into a smaller, simpler modules using user defined
functions.
Software required
z Turbo C++
Pre-requisite
z A basic knowledge of function prototype and function declaration is required.
Procedure
z Create function CALCULATE.
z Syntax for function prototype:
return-type function_name( arg-types);
z Syntax of function definition
return-type function_name( arg-types)
{
Computer Science 23
Practical Manual
declarations;
statements;
Notes }
z The functions with same function name are distinguished by the number and
type of arguments (Function signature).
Learner’s Observations
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
24 Computer Science
Practical Manual
Notes
Practical 13
Objective
After completion of this practical you will be able to use header files and built in
functions.
Software required
z Turbo C++
Pre-requisite
z A basic knowledge of header files and built in functions is required.
Procedure
z Accept two strings from the input stream.
z Use the following string functions
1) strcmp(S1,S2) - to compare two strings
2) strlen(S1) - to find the length of the string
3) strcat(S1,S2) - to append one string after another
(S1 and S2 are string variables)
z Display the result.
Computer Science 25
Practical Manual
Instructor’s signature
26 Computer Science
Practical Manual
Notes
Practical 14
Write a C++ program to accept ten numbers using an array. Search for a number
in an array using binary search method.
Objective
After completion of this practical you will be able to create, initialize and
traverse a one dimensional array using C++ and also understand the logic of
binary search.
Software required
z Turbo C++
Pre-requisite
z Basic knowledge of arrays and their working is required.
Procedure
z Accept 10 numbers in an array.
z Accept a number, say S.
z Check whether the number S exists in the array using binary search method.
z If number exists display “ NUMBER EXITS in ........... LOCATION” else
“NUMBER NOT FOUND”.
Computer Science 27
Practical Manual
Learner’s Observations
...........................................................................................................................
Notes ...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
28 Computer Science
Practical Manual
Notes
Practical 15
Write a C++ program to accept eight numbers in an array. Sort the numbers in
ascending order using Bubble sort method. Also insert a number in the sorted
array.
Objective
After completion of this practical you will be able to sort array in ascending or
descending order.
Software required
z Turbo C++
Pre-requisite
z Basic knowledge of arrays and its elements, their working and sorting technique
logic (Bubble Sort) is required.
Procedure
z Accept 8 numbers in an array.
z Sort the numbers in ascending order using Bubble sort method.
z Print the sorted list.
z Accept a new number.
z Insert the number in the appropriate position in the sorted list.
z Display all the nine numbers of the array.
Computer Science 29
Practical Manual
Learner’s Observations
...........................................................................................................................
Notes ...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
30 Computer Science
Practical Manual
Notes
Practical 16
Write a C++ program to accept two arrays and merge them to form a new array
such that the new array contains the elements from both the arrays alternatively.
Objective
After completion of this practical you will be able to merge two or more arrays
according to the given conditions.
Software required
z Turbo C++
Pre-requisite
z Basic knowledge of working with arrays and assigning the values of one
array to another is required.
Procedure
z To accept the elements of two arrays, say A and B of any size.
z Create a new array C such that the elements of array A and array B are
alternatively placed in array C.
For example
Array A contains 1,2,3,4,5,6
Array B contains 7,8,9,10,11,12
Then array C should contain 1,7,2,8,3,9,4,10,5,11,6,12
Computer Science 31
Practical Manual
Learner’s Observations
...........................................................................................................................
Notes ...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
32 Computer Science
Practical Manual
Notes
Practical 17
Write a C++ program to accept 4 X 4 matrix and find the sum of odd numbers of
the matrix.
Objective
After completion of this practical you will be able to create, traverse and
manipulate the elements of a 2D array.
Software required
z Turbo C++
Pre-requisite
z Basic knowledge of 2 D arrays and its working is required.
Procedure
z Accept the elements of a 4 × 4 matrix using nested for loops.
z Check each element of the matrix, whether it is odd or even.
z If the number is odd then add the value to a variable called total.
z Display the matrix.
z Display the sum of odd elements of the matrix.
Computer Science 33
Practical Manual
Learner’s Observations
...........................................................................................................................
Notes ...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
34 Computer Science
Practical Manual
Notes
Practical 18
Objective
After completion of this practical you will be able to use user defined data type
structures.
Software required
z Turbo C++
Pre-requisite
z Knowledge of creating and accessing the members of the structure is required.
Procedure
z Create a structure prototype as follows:
struct Employment_Exchange
{
int application_no;
……
…….
};
Computer Science 35
Practical Manual
Learner’s Observations
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
36 Computer Science
Practical Manual
Notes
Practical 19
Private members
Position Point
1 10
2 7
3 5
>3 0
Public members
1. Create an appropriate function Accept() and Display() to accept and display
data respectively.
2. A constructor to initialize all the numerical members to 0 and all strings to
“WELCOME”.
Write a C++ program to implement the class defined above by creating an
object.
Computer Science 37
Practical Manual
Objective
After completion of this practical you will be able to use user defined data types
Notes in OOP.
Software required
z Turbo C++
Pre-requisite
z Basic knowledge of OOP, defining classes, declaring objects and accessing
public members is required.
Procedure
z Create a class called Competition containing public and private members as
given in the problem statement.
z Use the following syntax.
class classname
{
private:
variable declaration;
function declaration;
public:
variable declaration;
function declaration;
};
38 Computer Science
Practical Manual
Learner’s Observations
...........................................................................................................................
........................................................................................................................... Notes
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
Computer Science 39
Practical Manual
Notes
Practical 20
Private members:
course_id integer
course_name string
duration integer
fee float
Public memebrs:
void accept()
40 Computer Science
Practical Manual
Private members:
voc_name string
requirement string
age integer
Public function:
void voc_accept()
void voc_display()
Implement the above classes to accept and display data of Sr_Secondary class
and vocational class.
Objective
After completion of this practical you will be able to use multilevel inheritance.
Software required
z Turbo C++
Pre-requisite
z Basic knowledge of inheritance is required. Learners should know about
different types of inheritance (simple, multiple and multilevel) and visibility
modes (public, private and protected).
Procedure
z Create three classes called COURSE, SR_SECONDARY, VOCATIONAL.
z Give appropriate visibility modes for the members of each class and also give
appropriate type of inheritance.
z Create objects to display data of Sr_Secondary class and vocational class.
Computer Science 41
Practical Manual
Instructor’s signature
42 Computer Science
Practical Manual
Notes
Practical 21
Computer Science 43
Practical Manual
Objective
After completion of this practical you will be able to use multiple inheritance.
Software required
z Turbo C++
Pre-requisite
z Basic knowledge of inheritance is required. Learners should know about
different types of inheritance (simple, multiple and multilevel) and visibility
modes (public, private and protected).
Procedure
z Create three classes called TWO_WHEELER, FOUR_WHEELER,
MOTOR_VEHICLE.
z Give appropriate visibility modes for the members of each class and also give
appropriate type of inheritance.
z Create objects to implement the class hierarchy.
44 Computer Science
Practical Manual
Learner’s Observations
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
Computer Science 45
Practical Manual
Notes
Practical 22
Objective
After completion of this practical you will be able to use pointers.
Software required
z Turbo C++
Pre-requisite
z Basic knowledge of pointers is required.
Procedure
z Accept a number.
z Create a pointer using * operator and assign the address using & operator.
46 Computer Science
Practical Manual
Learner’s Observations
...........................................................................................................................
........................................................................................................................... Notes
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
Computer Science 47
Practical Manual
Notes
Practical 23
Write a C++ program to accept an integer array of size 10. Display the squares of
all the elements by using a pointer to the array.
Objective
After completion of this practical you will be able to use pointers and arrays.
Software required
z Turbo C++
Pre-requisite
z Basic knowledge of pointers is required.
Procedure
z Accept an integer array of size 10.
z Create a pointer using * operator.
z Use a pointer to the array.
z Display the square of all elements while traversing the arrays using a pointer.
Learner’s Observations
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
48 Computer Science
Practical Manual
...........................................................................................................................
...........................................................................................................................
........................................................................................................................... Notes
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
Computer Science 49
Practical Manual
Notes
Practical 24
Also define appropriate member functions to accept and display the data members
of the class.
Write a C++ program to accept and write data of the class LIBRARY to the file
“LIB.DAT”. The program should also be able to display data stored in the file.
Objective
After completion of this practical you will be able to read and write from / to data
files.
Software required
z Turbo C++
Pre-requisite
z Basic knowledge of opening data files using fstream objects is required. Learner
should also know about read ( ), write ( ) and close ( ).
Procedure
z Open the file using constructor open ( ).
z Accept and display the data by calling the public member of the class.
50 Computer Science
Practical Manual
z Use read ( ) and write ( ) to read from and write to the data file respectively.
z Close the file using close ( ).
Notes
Dos and Don’ts
z Add your name and enrolment number as a comment on the top of the program.
z Save the program with proper filename having .cpp extension.
z Create a folder and store all the programs in the folder.
Learner’s Observations
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
Computer Science 51
Practical Manual
Notes
Practical 25
Gita is running a departmental store in her colony. She wants to computerize the
billing system. Consider a class containing suitable members and associated
functions. The program should store details of all the bills in the file “BILL.dat”.
Also a discount of 10% on the net bill amount should be given to all the customers
whose net bill amount exceeds Rs 2000.
Objective
After completion of this practical you will be able to use data files.
Software required
z Turbo C++
Pre-requisite
z Basic knowledge of opening data files using fstream objects is required. Learner
should also know about read ( ), write ( ) and close ( ).
Procedure
z Open the file using constructor open ().
z Accept and display the data by calling the public member of the class.
z Use read and write function.
z Close the file.
52 Computer Science
Practical Manual
Learner’s Observations
...........................................................................................................................
........................................................................................................................... Notes
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
Computer Science 53
Practical Manual
Notes
Practical 26
Objective
After completion of this practical you will be able to create a new table using SQL.
Software required
z MySQL
Pre-requisite
z Learners should have knowledge of SQL commands.
Procedure
z Use following syntax for creating table
CREATE TABLE table_name (
column1 datatype,
column2 datatype,
column3 datatype,
....
);
54 Computer Science
Practical Manual
Instructor’s signature
Computer Science 55
Practical Manual
Notes
Practical 27
Objective
After completion of this practical you will be able to alter the table using SQL.
Software required
z MySQL
Pre-requisite
z Learners should have knowledge of SQL commands.
56 Computer Science
Practical Manual
Procedure
z Use following syntax to add new column in table
ALTER TABLE <table_name> Notes
ADD (<NewColumnName> <Data_Type>(<size>),......n),
Learner’s Observations
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
Computer Science 57
Practical Manual
Notes
Practical 28
Existing Table
Column Name Data Type Size
Roll Varchar2 10
Name char 30
Address Varchar2 50
Objective
After completion of this practical you will be able to update the table data using
SQL.
Software required
z MySQL
Pre-requisite
z Learners should have knowledge of SQL commands.
Procedure
z Use following syntax to update existing table data.
58 Computer Science
Practical Manual
Learner’s Observations
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
Computer Science 59
Practical Manual
Notes
Practical 29
Existing Table
Column Name Data Type Size
Roll Varchar2 10
Name char 30
Address Varchar2 50
DOB date
Objective
After completion of this practical you will be able to drop a column from table
using SQL.
Software required
z MySQL
Pre-requisite
z Learners should have knowledge of SQL commands.
60 Computer Science
Practical Manual
Procedure
Learner’s Observations
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
Computer Science 61
Practical Manual
Notes
Practical 30
Objective
After completion of this practical you will be able to remove duplicate rows from
database.
Software required
z MySQL
Pre-requisite
z Learners should have knowledge of SQL commands.
Procedure
z Use SELECT command for selecting roll and name from Table.
z Use DISTINCT command for eliminating rows.
62 Computer Science
Practical Manual
Instructor’s signature
Computer Science 63
Practical Manual
Notes
Practical 31
Objective
After completion of this practical you will be able to arrange database in
ascending/descending order.
Software required
z MySQL
Pre-requisite
z Learners should have knowledge of SQL commands.
Procedure
z Use ORDER BY command along with SELECT command.
z For descending order, use following syntax
ORDER BY Column name DESC
64 Computer Science
Practical Manual
Learner’s Observations
...........................................................................................................................
........................................................................................................................... Notes
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
Computer Science 65
Practical Manual
Notes
Practical 32
Objective
After completion of this practical you will be able to update and delete the existing
table contents.
Software required
z MySQL
Pre-requisite
z Learners should have knowledge of SQL commands.
Procedure
z Use UPDATE command to modify data values in table.
z Use DELETE command to modify data values in table.
66 Computer Science
Practical Manual
Instructor’s signature
Computer Science 67
Practical Manual
Notes
Practical 33
Objective
After completion of this practical you will be able to insert new values in the
existing table.
Software required
z MySQL
Pre-requisite
z Learners should have knowledge of SQL commands.
Procedure
z Use INSERT INTO command for adding new row.
68 Computer Science
Practical Manual
Learner’s Observations
...........................................................................................................................
........................................................................................................................... Notes
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
Computer Science 69
Practical Manual
Notes
Practical 34
Create an HTML document which will display the ordered list of practical
mentioned in this manual.
Objective
After completion of this practical you will be able to create ordered list of items.
Software required
z Notepad.
z Internet Explorer / Google Chrome/ Mozilla Firefox or any other browser
software.
Pre-requisite
z Theoretical knowledge of HTML tags.
Procedure
z Open Notepad.
z Use <OL> tag, type the list of practical.
z Save it as home.html.
Learner’s Observations
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
70 Computer Science
Practical Manual
...........................................................................................................................
...........................................................................................................................
........................................................................................................................... Notes
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
Computer Science 71
Practical Manual
Notes
Practical 35
Create a web page that displays title “HELLO WORLD” and content “Delhi is the
capital of India” in Italic and bold.
Objective
After completion of this practical you will be able to use title, italic and bold tags.
Software required
z Notepad.
z Internet Explorer / Google Chrome/ Mozilla Firefox or any other browser
software.
Pre-requisite
z Theoretical knowledge of HTML tags.
Procedure
z Open Notepad.
a. <title>……..</title>
b. <i>…..</i>
c. <b>….</b>
Learner’s Observations
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
72 Computer Science
Practical Manual
...........................................................................................................................
...........................................................................................................................
........................................................................................................................... Notes
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
Computer Science 73
Practical Manual
Notes
Practical 36
Objective
After completion of this practical you will be able to create table in webpage.
Software required
z Notepad
z Internet Explorer / Google Chrome/ Mozilla Firefox or any other browser
software
Pre-requisite
z Theoretical knowledge of HTML tags.
Procedure
z Open Notepad.
z Use <tr> tag for rows.
z Use <td> tag for columns.
74 Computer Science
Practical Manual
Learner’s Observations
...........................................................................................................................
........................................................................................................................... Notes
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
Computer Science 75
Practical Manual
Notes
Practical 37
Objective
After completion of this practical you will be able to add image in your webpage.
Software required
z Notepad.
z Internet Explorer / Google Chrome/ Mozilla Firefox or any other browser
software.
Pre-requisite
z Theoretical knowledge of HTML tags.
Procedure
z Open Notepad.
z Use following tags
<img src= “dinosaur.jpg”>
z If image is stored at different place, give complete path of image location
after src.
Learner’s Observations
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
76 Computer Science
Practical Manual
...........................................................................................................................
...........................................................................................................................
........................................................................................................................... Notes
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
Computer Science 77
Practical Manual
Notes
Practical 38
Create a C++ project on any topic of your interest. The project should have a
menu driven opening screen to accept, display and search records. For example,
if you are doing a project of Library Management System, the opening menu may
be as follows:
1. Enter Data
2. Display All Records
3. Search a Record
4. Exit
By clicking on any menu item, the corresponding task should be performed.
After creating and running the project successfully, each learner has to make a
project file using OpenOffice Writer containing the following items:
z Title page containing name of the project, learner name and enrolment number
z Acknowledgement
z Introduction to the topic
z Hardware/Software requirements
z Built-in functions (with header files) used in the project
z Coding
z Output Screens
z Bibliography
The file should be spiral bound and submitted during your practical examinations.
The learner should also create a presentation highlighting key features of his/her
project and present it in the class.
78 Computer Science
Practical Manual
Learner’s Observations
...........................................................................................................................
........................................................................................................................... Notes
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
...........................................................................................................................
Instructor’s signature
Computer Science 79