INDEX
[Link] EXPERIMENT DATE SIGN
01. Experiment 01
Study and practice of Internal & External DOS commands.
02. Experiment 02
Study and practice of Basic Linux Commands – ls, cp, mv,rm,
chmod, kill, ps etc.
03. Experiment no.03
Study and Practice of MS Windows – Folder-related operations,
My-Computer, Windows Explorer, Control Panel.
04. Experiment no.04
Creation and editing of text files using MS Word.
05. Experiment no.05
Creation and operation of spreadsheets using MS Excel.
06. Experiment no.06
Creation and editing of PowerPoint slides using MS
PowerPoint.
07. Experiment no.07
Creation and manipulation of a database table using SQL
in MS Access.
08. Experiment no.08
Write a program (WAP) to illustrate arithmetic Expressions.
09. Experiment no.09
Write a program (WAP) to illustrate arrays.
10. Experiment no.10
Write a program (WAP) to illustrate functions.
11. Experiment no.11
Write a program (WAP) to illustrate constructors and
Destructors.
12. Experiment no.12
Write a program (WAP) to illustrate objects and classes.
13. Experiment no.13
Write a program (WAP) to illustrate operator overloading.
14. Experiment no.14
Write a program (WAP) to illustrate function overloading.
15. Experiment no.15
Write a program (WAP) to illustrate derived classes and
inheritance.
16. Experiment no.16
Write a program (WAP) to insert and delete an element from the
stack.
17. Experiment no.17
Write a program (WAP) to insert and delete an element from the
queue.
18. Experiment no.18
Write a program (WAP) to insert and delete an element from the
linked list.
Lab manual BT205
Course Outcomes:
After completing this course, students will be able to:
1. Understand and practice fundamental operating system commands in DOS and Linux.
2. Demonstrate proficiency in using MS Office tools such as Word, Excel, PowerPoint, and Access.
3. Apply programming concepts to implement basic algorithms using C++ or other programming
languages.
4. Implement advanced programming features like operator overloading, function overloading, and
inheritance.
5. Develop and manipulate data structures like stacks, queues, and linked lists programmatically.
Experiment-01
INTERNAL AND EXTERNAL DOS COMMANDS:-
Internal Commands:
1). CLS:-to clear the display screen.
Syntax: C:/>Cls
2). Dir:-its display the list of directories and files in the screen.
Syntax: C:/>dir.
• C:/>dir/p:-displays the list of directories or files page wise.
• C:/>dir/w:-displays the list of directories or files width wise.
• C:/>dir/d::-displays the list of directories or files in drive D.
• C:/>[Link]:-displays in formation of specific file.
3). Date:-displays the current time of the system.
Syntax:C:/>date
Current time is :sat 3-25-2022
Enter of new date (mm-dd-yy):-
4). Time :- displays the current time of the system.
Syntax:C:/>time
Current time is12:39-48:38p
Enter new time:-
5). VER:-displays the version of DOS being use d currently.
Syntax:C:/>verMS
Version 6:20
6). Copycon:-to create the file.
Syntax: C:/>copyconram
I am a good girl
[Link]. C:/>
7). Type:-allows user to see the contents of the file.
Syntax:C:/>typepath
8). Ren:-to rename the old file name with the new name.
Syntax:C:/>renoldfilenamenewfilename
C:/>ren rjit
9). Del:-to delete the file.
Syntax:C:/>[Link] C:/>del
[Link]
10). MD:-to create an ew directory or subdirectory.
Syntax:C:/>mddirectory
C:/>mdsubdirectory
11). CD:-to change one directory from another directory or sub-directory.
Syntax:C:/>cddirectoryname
C:/>directoryname>cdsubdirectory
If the user want to move to the parents directory then use cd commands
as
Syntax:C:/>directoryname>subdirectoryname>cd..
C:/>directoryname>
12). RD:-to remove the directory or subdirectory.
13). Copy:- to copy one or more specified files to another disk with the
same file name or with different file name .
Syntax: C:/>copysourcepathtargetpath
C:/>copyA:/>~* *~C:/>chinni
External Commands:
1). CHSDK:-The command CHSDK returns the configuration status of
the selected disk. It returns the information about the volume, serial
number, total disk space, space in directories, space in each allocation
unit, total memory and free memory.
Syntax:C:/>CHKDSKdrivename
2). Diskcopy: - Disk copy command is used to make duplicate copy of
the disk like Xerox copy.
Syntax:C:/>diskcopy<sourcepath><destinationpath>
NOTE:-This command is used after disk copy command to
ensure that disk is copied successfully.
3). Format:-Format is used to erase information off of a computer
diskette or fixed drive.
Syntax:C:/>formatdrivename
4). Label:-This command is used to see volume label and to change
volume label.
Syntax:C:/>labeldrivename
5). Scandisk:-This utility is used to repair and check various disk errors.
It also defects various physical disk errors and surface errors.
Syntax:C:/>scandisk<drivenames>
6). Move:-The purpose of move is move to files from one place to
another place.
Syntax:C:/>Move<sourcepath><targetpath>
7). Print:-This command allowed users to print a text file to a line
printer.
Syntax:C:/>Print<filesname>
8). Tree: - This command displays the list of directories and files on
specified path using graphical display. It displays directories of files like a
tree.
Syntax:C:/>tree>path
9). Deltree :- This command is used to delete files a directories same as
by the del and RD commands. This command is more useful than del and
RD commands because it completely removes specified directories ie.,
disk will all it files and sub – directories at a time.
Syntax:C:/>deltree(path)
Experiment-02
COMMANDS OF LINUX:
1). s:-allows the user to view the contents of the files and
directories.
Syntax: Is [options][file]
{Options are R,S , al, a}
2). Clear:-clears the terminal screen.
Syntax: $clear
3). PWD:-full form of PWD is print working directory. Its allows the
users to find the path of current working directory or folder they
are in.
Syntax: $pwd
{pwd has two options ;L:-prints a symbolic path
R:-prints the actual full path}
4). CD:- to navigate through the Linux files and directories.
{cd:- to go to the home folder
cd:- to move one directory up
cd-:-move to your previous directory}
5). CP: - to copy files from current directory to a
different directory.
Syntax: $cp source file destination file
6). MV:-to move a file from a given directory to a different
directory.
Syntax: $ mv<filename><directory_name>
7). RM:-deletes directories as well as the content within them.
Syntax: $rm<filename>
8). Rmdir:-allows the users to delete the directory.
Syntax: $rmdir<directoryname>
9). Touch:-create a new blank file with the given name.
Syntax: $touch<filename>
Or
$touch<filename1><filename2>
10). Locate:-enables the users to locate a file.
Syntax: $ locate<filename>
11). DF: - users can get the information related to file systems
about total space and available space. This commands hows
the result in percentage and KBs.
Syntax: df [file]
{ -x:- excludes specific file systems.
-T,-print-type:-prints the type of file system.
-a,-all:-includes duplicate and files that are in accessible.
-m :-shows theres ultin megabytes.}
12). DU:-(Disk User)its shows how much space a file or
directory takes.
Syntax: $du
13). Chown :-all files are owned by a specific user in Linux.
Syntax: chownowner _ name file_ name
14). Echo:-displays a text or a string to the standard output or a
file.
Syntax: $echo“<string>”
15). Head:-allows the users to view the first lines of any text.
Syntax: $head [filename]
Or
$ Head–n<number><filename>
16). Tail:-shows the last ten lines of a text file.
Syntax: $ -n<number><filename>
17). Uname:-(Unix Name) prints the detailed information
about your Linux system.
Syntax: uname[option]
{optioncan be ;-r,-s,-v,-a}
18). History:- shows the previously used commands.
Syntax: $history
19). Man:-to check the reference manual pages for commands
or programs.
Syntax:$man [command name]
20). Useradd :- used to add or remove a user on a Linux server.
Syntax: useradd[ options]username
Experiment-03
STUDY AND PRACTICE OF MS WINDOWS –FOLDER RELATED OPERATIONS,
MY-COMPUTER,WINDOWEXPLORER,CONTROLPANEL:
Folders
In Windows, the files, folders, and sub folders are represented by small pictures
called icons. The icon for folders and sub folders intuitively looks like a folder.
Every Windows folder provides easy access to common file and folder
management tasks. When you open any folder on your
Computer, a list of hyperlinked tasks is displayed next to the folder contents. You
can select a file or folder, and then click a task to rename, copy, move, or delete it.
Folder related operations:
• Create
• Delete
• Rename
• Copy
• Modify
• Move
• Customize
My Computer:
In Windows, you can locate and manage your files and directories (folders) in
either My Computer or Explorer.
In My Computer, you choose a drive, and by default, view icons or a list of folders
and files in that drive. Your view is one window at a time, unless you choose
explore in My Computer to move to Explorer, which makes it easy to work in a
particular folder, but difficult to move between folders. When you open a folder in
My Computer, a new window opens; when you open a folder within that window,
another window opens. Soon your screen is cluttered with windows, unless you
initially choose, in view, options to use a single window.
Windows Explorer:
Windows Explorer is an application that provides detailed information about your
files, folders, and drives. You can use it to see how your files are organized and to
copy,move,and rename files, as well as perform other tasks pertaining to files,
folders, and drives.
The simplest way to access Windows Explore is to right-click the Start menu or the
my Computer icon and selects Explore. If your keyboard has a Windows logo key,
you can press Win-e to launch Windows Explorer.
Alternatively, you can access it from the Start menu. In newer operating systems, it
is under Accessories.
Control Panel:
Control Panel is full of specialized tools that are used to change the way
Windows looks and behaves. Some of these tools help you adjust settings that
make your computer more fun to use.
For example, use Mouse to replace standard mouse pointers with animated icons
that move on your screen, or use Sounds and Audio Devices to replace standard
system sounds with sounds you choose. Other tools help you set up Windows so
that your computer is easier to use. For example, if you are left- handed, you can
use Mouse to switch the mouse buttons so that
The button on the right performs the primary functions of selecting and dragging.
To open Control Panel, click Start and then click Control Panel. If your computer is
set up in Classic view using the more familiar Start menu, click Start, point to
Settings, and then click Control Panel.
Experiment-04
CREATIONANDEDITINGOFTEXTFILESUSING MS- WORD:
MS-Word: Microsoft Word is a word processing software package. You can use it to
type letters, reports, and other documents. This lesson introduces you to the Word
window. You use the Word window to interact with Microsoft Word.
Getting Started
1. Open Microsoft Word by clicking on Start>All Programs and selecting
Microsoft Word from the list.
2. Word will open with a blank document. You will see the flashing cursor at
the top left corner of the page, ready for you to start typing.
3. If you hold your mouse over any of the icons in the menu bars or
toolbars, you will see a quick description of what those buttons do.
4. If you can't see any of the toolbars mentioned in this article (mainly the
Standard and Formatting tool bars),you may have to instruct Word to show
them by clicking View then Toolbars and putting a tick by any toolbars you
want to show.
Experiment-05
CREATION AND OPERATING OFSPREADSHEETUSINGMS-EXCEL:
MS-Excel: Microsoft Excel is an electronic spread sheet that runs
on a personal computer. You can use it to organize your data in to
rows and columns. You can also use it to perform mathematical
calculations quickly. This tutorial teaches Microsoft Excel basics.
Although knowledge of how to navigate in Windows environment
is helpful, this tutorial was created for the computer novice. This
lesson will introduce you to the Excel window. You use the window
to interact with Excel.
Getting Started
• Click on the Start button, point to Programs, and following by
Microsoft Office and click on Microsoft Office Excel 2003.
Experiment-06
CREATION AND EDITING POWER – POINT SLIDES USING MS POWER POINT:
MS-PowerPoint: Power Point is a presentation software
package. With
Power Point, you can easily create slide shows. Trainers and other
presenters use slide shows to illustrate their presentations. This
tutorial teaches PowerPoint basics. This lesson introduces you to
the Power Point window. You use the window to interact with
Power Point. Microsoft Power Point 2003 is a program designed to
create and use a presentation. This Guide will take you through
getting started and building your confidence in the skills needed to
use the software productively.
Getting Started
To start Power Point, go to the Start menu and select Programs-
>Microsoft Office->Power Point.
Experiment-07
CREATION AND MANIPULATION OF DATA BASE TABLE USINGS MS-ACCESS:
MS-Access: Microsoft Access 2003 is a powerful, yet easy to
learn, relational database application for Microsoft Windows. It
introduces fundamental database concepts and operations and
illustrates how they are performed in Microsoft Access
[Link] is a pseudo-relational database management
system from Microsoft that combines the relational Microsoft Jet
Database Engine with a graphical user interface and software-
development tools. It is a member of the Microsoft Office suite of
applications.
Getting Started
• Click the Windows Start button, located in the bottom-left corner
of the screen.
• Use the mouse to move the pointer over the words All
Programs.
• A menu pops up to the right of All Programs. The programs
and menus you see listed depend on the programs installed on
your computer, so your menu will probably look somewhat
different from other users' menus.
• On the All Programs menu, move the pointer over the words
MicrosoftOffice2003,then point to and click Microsoft Office
Access 2003.
Experiment-08
WAP to illustrate Arithmetic expressions:
#include<iostream.h>
#include<conio.h>int
main( )
{
clrscr();
inta,b,sum,diff,mul,
div ,rem; cout<<“enter
the a=”;
cin>>a;
cout<<“enter
the b=”;
cin>>b;
sum=a+b;
diff=a-b;
mul=a*b;
div=a/b;
rem=a%b;
cout<< “the
sum=”<<sum<<endl;
cout<<“thediff
=”<<diff<<endl; cout<<
“themul=”<<mul<<endl;
cout<< “the
div=”<<div<<endl;
cout<< “the
rem=<<rem<<endl;
getch( );
}
Output:
Experiment-09
WAP to illustrate if-else statement:
#include<iostream.h>
#include<conio.h>int
main( ) {
clrscr();
int number ,rem; cout<<
“enter the number”;
cin>>number; rem=number
%2;if(rem==0)
cout<<number<<“iseven”;else
cout<<number<< “is odd”;
getch();}
Output:
Experiment-10
WAP to illustrate switch case statement:
#include<iostream.h>
#include<conio.h>int
main( )
{clrscr(
);
intdigit;
cout<<“enterthenumber”<<endl;
cin>>digit;switch(digit)
{
case0:
cout<<“zero”;
break;
case1:
cout<<“one”;
break;
case2:
cout<<“two”;
break;
case3:
cout<<‘three”;
break;
case4:
cout<<“four”;
break;
case5:
cout<<“five”;
break;
case6:
cout<<“six”;
break;
case7:
cout<<“seven”;
break;
case8:
cout<<“eight”;
break; case9:
cout<<“nine”;
break;
default:
cout<<“notadigit”;
}
getch( );
}
Output:
Experiment-11
WAP to illustrate for, while and do-while loop:
// to find the sum of first n natural numbers using for loop.
#include<iostream.h
>
#include<conio.h
>
#include<iomanip
.h>intmain()
{ clrscr(
);intn,
i,sum;
cout<<“enter thenumber”<<endl;
cin>>n;
sum=0;
for(i=1;i<=n;i++)
sum+=i;
cout<<
“sum=”<<sum;
getch( );
}
Output:
//to find the sum of the digits of an integer using while loop.
#include<iostream.h
>#include<conio.h>
int main( )
{
clrscr(
);
int n, rem, sum;
cout<< “enter an
integer”; cin>>n;
sum=0;while(n>0)
{
rem=n%10;
sum+=rem;
n/=10;
}
cout<<
“sum=”<<sum;
getch( );
}
Output:
//to find the sum of first n numbers using do-while loop.
#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();inti,sum,n;
cout<< “enter a
number”<<<endl;
cin>>n;
i=1;
sum=0;
do
{
sum+=i
;i++;
}while( i<=n
);
cout<<
“sum=”<<sum;
getch( );
}
Output:
Experiment-11
Experiment-12
WAP to illustrate Arrays:
#include<iostream.h>
#include<conio.h>
int main()
{
clrscr(
);
inta[5],i;
cout<<“enterthefivevalues \n”; for(i=0;
i<5; i++)
cin>>a[i];
cout<<“the values in thearrayare
\n”; for(i=0; i<5; i++)
cout<<“a[“<<i<<”]=
“<<a[i]<<endl;
getch();
}
Output:
Experiment-13
WAP to illustrate functions:
//functions with no arguments and no return value.
#include<iostream.h>
#include<conio.h>
intlargest(void)
{ clrscr();
inta,b,c, l;
cout<< “enter three
number”<<endl;cin>>a>>b>>c;
l=a;
if(b>l)
l=b;
if(c>l)
l=c;
cout<<“largest=”<<l;
}
int main()
{largest();
getch()
;}
Output:
Experiment-14
WAP to illustrate Function over loading.
#include<iostr
eam.h> float
area(int); float
area(int ,int);
int main( )
{intradius;float
cir_area;
cout<<“enter
radius”<<endl;
cin>>radius;
cir_area=area(radius);
cout<< “area of
circle=”<<cir_area<<endl;
int
length,breadth;
floatrect_area;
cout<< “enter length and
breadth”<<endl;
cin>>length>>breadth;
rect_area=area(length,breadth);
cout<< “area of
rectangle=”<<rect_area<<endl;
return 0; }
floatarea(int r)
{
return3.14*r*r;
}
floatarea(int l,intb)
{return
l*b; }
Output:
Experiment-15
WAP to illustrate objects and classes
#include<iostrea m.h>classinteger
{ private
:
intx;
public:
void
get( )
{
cin>
>x;
}
voiddisplay()
{
cout<<x<<“\n”;
}
voidincrement()
{
x+
+;
}};
int main()
{
intege
r a;
cout<< “enter the
value of a \n”; [Link]( )
cout<< “the value of
a=”; [Link]( );
[Link]();cout<<
“after incrementation
\n”;
cout<<“thevalue
of a=”; [Link](
);getch();
}
Output:
Experiment-16
WAP to illustrate contructor and destructor:
//default constructor in integer class.
#include<iostrea
m.h> class
integer
{ private:
int x;
public:
intege
r( )
{ x=10;
} void
display()
{
cout<<x<<“\n”;
}
};
int main()
{
clrscr
( );
integera, b;
cout<<“thememberdata of a=”;
[Link]();
cout<<“thememberdata of b=”;
[Link]
y( );
getch();
}
Output:
//to illustrate destructor.
#include<iostrea
m.h> int
count=0; class
integer
{ private:
intx;
public:
integer(inty)
{ count++;
cout<<“object-”<<count<<“created”<< “\n”;
x=y;
}
~integer()
{ cout<< “object-”<<count<<
“destroyed”<<“\n”;count--;
}
};
int main()
{ clrscr( );
integera(10)
,b(20);getch();
}
Output:
Experiment-17
WAP to illustrate operator overloading:
#include<iostrea
m.h> class
integer
{
priva
te:
intx;
public:
integer(in
t y=0)
{
x=
y;
} void
operator++(
)
{
++x;
}void
operator
++(int)
{ x++;
} void
display()
{cout<<x<<“\n”;
}}; int
main(voi
d)
{
clrsc
r();
cout<<
“a=”;
[Link](
);++a;
cout<<“after
++a;,a=”;
[Link](); a+
+;
cout<<“after a+
+, a=”;
[Link]();
getch();
}
Output:
Experiment-18
WAP to illustrate derived classes and inheritance:
#include<iostream.h>
#include<conio.h>
#include<stdio.
h> class
publisher
{
protect
ed:
char
pname[40];
char
place[20];
public:
voidget(
);void
display();
}; void
publisher::get
()
{
cout<<“enterpublishernameand
place\n”; cin>>pname>>place;
} void
publisher::displa
y( )
{
cout<< “publisher’s
name=”<<pname<<“\n”;cout<<
“place=”<<place<< “\n”;
class author
{
protect
ed:
char
aname[20];
void get( );
voiddisplay();
};
voidauthor::get()
{
cout<<“enter theauthorname
\n”;cin>>aname;
} void
author::display
()
{
cout<< “ author’s
name=”<<aname<<“\n”;
} class book: public
publisher,publicauthor{
private:
char
title[30];
float
price;int
pages;
public:
void get( );
voiddisplay();
};
voidbook::get()
{publisher::get();author::
get( ); cout<<”enter
title,pagesand price \n”;
cin>>title;
cin>>pages>>price;
}void book::
display( )
{publisher::display();
author ::display( );
cout<<
“title=”<<title<<”\n”;
cout<<
“pages=”<<pages<< ‘\
n”;
cout<<“price=”<<price<<“\n”;
}
int main()
{
clrscr
( );
book
b;
[Link]();
[Link]();
getch(
);}
Output: