0% found this document useful (0 votes)
37 views

Lab Manual Fcse

lab manual

Uploaded by

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

Lab Manual Fcse

lab manual

Uploaded by

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

SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

LAB MANUAL
Subject code : CS-112
SUBJECT NAME: Fundamental of Computer
science & engineering
SEMESTER: IST
Session: JULY-DEC

Faculty Name :ARPANA BHANDARI

Department - CSE

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

INDEX

Page No

1. Scheme of Examination

2. Syllabus

3. Academic Calendar

4. Time Table

5. LIST of Experiment

6. Viva question

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

SCHEME
OF EXAMINATION
&
SYLLABUS

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

BASIC COMPUTER ENGINEERING


BT-205
List of Experiment
01.Study and practice of Internal & External DOS commands.

02. Study and Practice of MS windows – Folder related operations, My-Computer,

Window explorer, Control Panel,

03. Creation and editing of Text files using MS- word.

04. Creation and operating of spreadsheet using MS-Excel.

05. Creation and editing power-point slides using MS- power point

06. Write a program to illustrate Arithmetic expressions

07. Write a program to illustrate Arrays.

08. Write a program to illustrate functions.

09. Write a program to illustrate constructor & Destructor

10. Write a program to illustrate Object and classes.

11. Write a program to illustrate Operator overloading.

12. Write a program to illustrate function overloading.

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

LIST OF EXPERIMENT
&
TIME TABLE

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

List of experiment
Subject:Basic Computer Engineering Semester: II
Branch: CSE Session:
Jan-Jun 2020
S.NO LIST OF EXPERIMENT DATE OF PERFORMED SUBMISSION DATE
1 Study and practice of Internal &
External DOS commands.
2 Study and Practice of MS
windows – Folder related
operations, My-Computer,
window explorer, Control Panel,
3 Creation and editing of Text files
using MS- word.
4 Creation and operating of
spreadsheet using MS-Excel.
5 Creation and editing power-point
slides using MS- power point
6 Write a program to illustrate
Arithmetic expressions
7 Write a program to illustrate
Arrays.
8 Write a program to illustrate
functions.
9 Write a program to illustrate
constructor & Destructor
10 Write a program to illustrate
Object and classes.
11 Write a program to illustrate
Operator overloading.
12 Write a program to illustrate
function overloading.

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

List of experiment
Subject:Basic Computer Engineering Semester: II
Branch: CSE Session:
Jan-Jun 2020
S.NO LIST OF EXPERIMENT DATE OF PERFORMED SUBMISSION DATE
1 Study and practice of Internal &
External DOS commands.
2 Study and Practice of MS
windows – Folder related
operations, My-Computer,
window explorer, Control Panel,
3 Creation and editing of Text files
using MS- word.
4 Creation and operating of
spreadsheet using MS-Excel.
5 Creation and editing power-point
slides using MS- power point
6 Write a program to illustrate
Arithmetic expressions
7 Write a program to illustrate
Arrays.
8 Write a program to illustrate
functions.
9 Write a program to illustrate
constructor & Destructor
10 Write a program to illustrate
Object and classes.
11 Write a program to illustrate
Operator overloading.
12 Write a program to illustrate
function overloading.

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

Program:
Before you can make C++ work for you, you must write a C++ program.
You have seen the word program used several times in this book. The
following note defines a program more formally.
A program is a list of instructions that tells the computer to do things.
Keep in mind that computers are only machines. They’re not smart; in
fact, they’re quite the opposite! They don’t do anything until they are
given detailed instructions. A word processor, for example, is a program
somebody wrote—in a language such as C++—that tells your computer
exactly how to behave when you type words into it.
To give C++ programming instructions to your computer, you need an
editor and a C++ compiler. An editor is similar to a word processor; it is
a program that enables you to type a C++ program into memory, make
changes (such as moving, copying, inserting, and deleting text), and save
the program more permanently in a disk file. After you use the editor to
type the program, you must compile it before you can run it. The C++
programming language is called a compiled language. You cannot write
a C++ program and run it on your computer unless you have a C++
compiler. This compiler takes your C++ language instructions and
translates them into a form that your computer can read. A C++ compiler
is the tool your computer uses to understand the C++ language
instructions in your programs. Many compilers come with their own
built-in editor. If yours does, you probably feel that your C++
programming is more integrated. To some beginning programmers, the
process of compiling a program before running it might seem like an
added and meaningless step. If you know the BASIC programming
language, you might not have heard of a compiler or understand the need
for one. That’s because BASIC (also APL and some versions of other
computer languages) is not a compiled language, but an interpreted
language. Instead of translating the entire program into machine-readable
form (as a compiler does in one step), an interpreter translates each
program instruction—then executes it—before translating the next one.
The difference between the two is subtle, but the bottom line is not:
Compilers produce much more efficient and faster-running programs
than interpreters do. This seemingly extra step of compiling is worth the
effort (and with today’s compilers, there is not much extra effort
needed). Because computers are machines that do not think, the
instructions you write in C++ must be detailed. You cannot assume your
BY:ARPANA BHANDARI CSE
SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

computer understands what to do if some instruction is not in your


program, or if you write an instruction that does not conform to C++
language requirements. After you write and compile a C++ program, you
have to run, or execute, it. Otherwise, your computer would not know
that you want it to follow the instructions in the program. Just as a cook
must follow a recipe’s instructions before making the dish, so too your
computer must execute a program’s instructions before it can accomplish
what you want it to do. When you run a program, you are telling the
computer to carry out your instructions.
The Program and Its Output:
While you are programming, remember the difference between a
program and its output. Your program contains only the C++ instructions
that you write, but the computer follows your instructions only after you
run the program. Throughout this book, you often see a program listing
(that is, the C++ instructions in the program) followed by the results that
occur when you run the program. The results are the output of the
program, and they go to an output device such as the screen, the printer,
or a disk file.

Program Design: You must plan your programs before typing them into
your C++ editor. When builders construct houses, for example, they
don’t immediately grab their lumber and tools and start building! They
first find out what the owner of the house wants, then they draw up the
plans, order the materials, gather the workers, and finally start building
the house. The hardest part of writing a program is breaking it into
logical steps that the computer can follow. Learning the C++ language is
a requirement, but it is not the only thing to consider. There is a method
of writing programs, a formal procedure you should learn, that makes
your programming job easier. To write a program you should:
1. Define the problem to be solved with the computer.
2. Design the program’s output
3. Break the problem into logical steps to achieve this output.
4. Write the program (using the editor).
5. Compile the program.
6. Test the program to assure it performs as you expect.
As you can see from this procedure, the typing of your program occurs
toward the end of your programming. This is important, because you
first have to plan how to tell the computer how to perform each task.
Your computer can perform instructions only step-by-step. You must
assume that your computer has no previous knowledge of the problem,
so it is up to you to provide that knowledge, which, after all, is what a
BY:ARPANA BHANDARI CSE
SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

good recipe does. It would be a useless recipe for a cake if all it said was:
“Bake the cake.” Why? Because this assumes too much on the part of the
baker. Even if you write the recipe in step-by-step fashion, proper care
must be taken (through planning) to be sure the steps are in sequence.
Wouldn’t it be foolish also to instruct a baker to put the ingredients into
the oven before stirring them?
Using a Program Editor:
The instructions in your C++ program are called the source code. You
type source code into your computer’s memory by using your program
editor. After you type your C++ source code (your program), you should
save it to a disk file before compiling and running the program. Most C+
+ compilers expect C++ source programs to be stored in files with names
ending in .CPP.
For example, the following are valid filenames for most C++ compilers:
MYPROG.CPP
SALESACT.CPP
EMPLYEE.CPP
ACCREC.CPP
Many C++ compilers include a built-in editor. Two of the most popular
C++ compilers (both conform to the AT&T C++ 2.1 standard and
include their own extended language elements) are Borland’s C++ and
Microsoft’s C/C++ 7.0 compilers. These two programs run in fully
integrated environments that relieve the programmer from having to
worry about finding a separate program editor or learning many
compiler-specific commands.

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

Experiment no.1
Study and practice of basic DOS commands.
Network administrators still must rely upon the command line interface
that was part of the MS-DOS operating system. In fact, Windows
machines can still execute DOS commands in the command line
window. To open the command line window, click Start, choose Run,
and type cmd in Windows NT/2000/XP. To close this command
window, type exit.Commands:
 D<drive letter>:
 To change the current drive.
 cd <directory name/path>
 To change the directory.
 cd\
 To change the current directory to root directory.
 cd..
 To change the current directory to parent directory.
 dir
To list the content of any directory.
 mkdir <dir name>
 To create new directory.
 rmdir <dir name>
 To delete a directory.
 move <source> <destination>
 To move a file or directory from one location to another.
 copy <source> <destination>
 To copy a file or directory from one location to another.
 edit <filename>
 To create and edit a file.

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

 del <filename>
 To delete a file.
 date
 To display current system’s date
 time
 To display current system’s time.
 tree
 To display complete directory structure in hierarchical for-
mat.
 help
 To display help related to any command.
 cls
 To clear the command window
 chkdsk <drive letter:>
 To check logical errors and bad sectors in any disk.
 exit
 To close the command window.
 format <drive letter:>
 To delete all data on disk permanently.

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

Experiment No. 2
Study and Practice of MS windows – Folder related
operations, My-Computer, window explorer, Control Panel,
Folder
 Folder is graphical version of what we called as DIRECTORY in com-
mand line interface.
 Folder is used to arrange and store different kind of files at one place.
 A folder is a location that stores multiple files and other folders on com-
puters running Microsoft Windows, and other GUI operating systems.
The picture shows an example of what a folders with files looks like in
Microsoft Windows
Folder related options

Folder related options


 Open –This option will open the folder and list all files stored in it.
 Send to – This option will send a copy to desired location in computer.
 Cut – This option will move the folder to desired location.
 Copy- This will send a copy to desired location.
 Create Shortcut- This option will create a shortcut on desktop to open it
quickly.
 Delete- This option will delete the folder.
 Rename – This option is used to rename the folder.
 Properties- This option is used to view attributes related to folder.

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

My Computer:
 This icon is clicked to navigate through different sectors of harddisk storage
and other peripheral attached to computer.

 It can be opened by double click on icon present at desktop.


Windows Explorer:
 File Explorer, previously known as Windows Explorer, is a file man-
ager application that is included with releases of the Microsoft Windows op-
erating system from Windows 95 onwards. It provides a graphical user inter-
face for accessing the file systems. It is also the component of the operating
system that presents many user interface items on the monitor such as
the taskbar and desktop.
Control Panel:
 The Control Panel is a part of the Microsoft Windows graphical user inter-
face which allows users to view and manipulate basic system settings
and controls via applets, such as adding hardware, adding and removing
software, controlling user accounts, and changing accessibility options.
 It can be opened by pressing Startà Control Panel.

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

Experiment No. 3
Creation and editing of Text files using MS- word.
Introduction:
Microsoft Word is an example of a program called a “word
processor.” Word processors are used to create and print text
documents in much the same way that you would use a
typewriter. The key benefit to using a word processor is that you
can make changes easily, including correcting spelling; adding,
deleting, formatting, and relocating text; and inserting images.
Once you create a document, you can effortlessly print it, save it
for later modifications, or send it to a friend via e-mail.
Microsoft Word is a very powerful word processor.
Microsoft Word is available on both PCs and Macs, so what you
learn in class today should be applicable to any computer you
use.
Opening Microsoft Word
To get started with Microsoft Word (sometimes called “MS
Word”), you will need to locate and open the program on your
computer. To open the program, point to Word’s icon on the
desktop with your mouse and double-click on it with the left
mouse button.
The Ribbon Menu System:
The tabbed Ribbon menu system is how you navigate through
Word and access various Word commands. If you have used
previous versions of Word, the Ribbon system replaces the
traditional menus.
File Menu:
 In Microsoft Office 2007, there was something called
the Microsoft Office Button in the top left-hand corner. In
Microsoft Office 2010, this has been replaced with a tab in
the Ribbon called “File.” When you left-click on this tab, a
drop-down menu appears. From this menu, you can perform
the same functions as were found under the Microsoft Of-

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

fice Button menu, such as: Create a new document, open


existing files, save files in a variety of ways, and print.
Quick Access Toolbar:
 On the top left-hand side of the Title Bar, you will see
several little icons above the File menu. These let you per-
form common tasks, such as saving and undoing, without
having to find them in a menu. We’ll go over the meanings
of the icons a little later.
 In order to use MS Word effectively, you must input
commands using both the mouse and the keyboard. The
above image of a keyboard should look similar to the key-
board in front of you; learning just a few certain keys will
help to improve your efficiency in typing, as well as present
you with more options within the program. The following is
a list of commonly used keys that have special functions in
MS Word (key functions can change depending on which
program you are using):
 1. Backspace: This key deletes letters backward.
 2. Delete: This key deletes letters forward.
 3. Shift: This key, when pressed WITH another
key, will perform a secondary function.
 4. Spacebar: This key enters a space between words
or letters.
 5. Tab: This key will indent what you type, or move
the text to the right. The default indent distance is usu-
ally ½ inch.
 6. Caps Lock: Pressing this key will make every let-
ter you type capitalized.
 7. Control (Ctrl): This key, when pressed WITH
another key, performs a shortcut.

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

 8. Enter: This key either gives you a new line, or ex-


ecutes a command (pressed in MS Word, it begins a new
line).
 9. Number Keypad: These are exactly the same as
the numbers at the top of the keyboard; some people
just find them easier to use in this position.
 10. Arrow Keys: Like the mouse, these keys are
used to navigate through a document or page.

Some Shortcuts:
 Copy Ctrl+C
 Cut Ctrl+X
 Paste Ctrl+V
 Undo Ctrl+Z
 Redo Ctrl+Y
 Bold Ctrl+B
 Italics Ctrl+I
 Underline Ctrl+U
 Repeat Action F4
 Next Page Ctrl+Enter
 Home Alt+H
 Insert Alt+N
 Design Alt+G
 Save Ctrl+S

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

Experiment No. 4
 Creation and operating of spreadsheet using MS-Ex-
cel.
Introduction:
 Microsoft Excel is a spreadsheet application devel-
oped by Microsoft for Microsoft Windows and Mac OS. It
features calculation, graphing tools, pivot tables, and a
macro programming language called Visual Basic for Ap-
plications.
 It has been a very widely applied spreadsheet for these
platforms, especially since version 5 in 1993, and it has re-
placed Lotus 1-2-3 as the industry standard for spread-
sheets. Excel forms part of Microsoft Office.
Basic Operation:
 Microsoft Excel has the basic features of all spread-
sheets, using a grid of cells arranged in numbered rows and
letter-named columns to organize data manipulations like
arithmetic operations.
 It has a battery of supplied functions to answer statisti-
cal, engineering and financial needs. In addition, it can dis-
play data as line graphs, histograms and charts, and with a
very limited three-dimensional graphical display.
 It has a programming aspect, Visual Basic for Applica-
tions, allowing the user to employ a wide variety of numeri-
cal methods, for example, for solving differential equations
of mathematical physics.
 It also has a variety of interactive features allowing
user interfaces that can completely hide the spreadsheet
from the user, so the spreadsheet presents itself as a so-
BY:ARPANA BHANDARI CSE
SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

called application, or decision support system (DSS), via a


custom-designed user interface, for example, a stock ana-
lyzer, or in general, as a design tool that asks the user ques-
tions and provides answers and reports.
 In a more elaborate realization, an Excel application
can automatically poll external databases and measuring in-
struments using an update schedule, analyze the results,
make a Word report or PowerPoint slide show, and e-mail
these presentations on a regular basis to a list of partici-
pants.
File formats:
 .xls
 .xlsx
 .xlsm
 .xlsb
How to open it?
 To use Microsoft Excel, you must first open it:
 One way you can open Microsoft Excel by click-
ing Start -> (All) Programs -> Microsoft Office
-> Microsoft Office Excel Worksheet.
 You can open Microsoft Excel using a shortcut on
your desktop.
Applications:
 Some of the projects that can be done in a spreadsheet
include:
 budgeting displays
 checkbook registers
 enrollment records
 inventories
BY:ARPANA BHANDARI CSE
SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

 coded surveys
 field and laboratory research data
financial and accounting applications.
Basic terms:
 A Cell is an individual data box which will have a cor-
responding Column and Row heading. This gives the cell a
name, referred to as the Cell Reference. When referencing a
cell, the column heading comes before the row heading. For
instance, the first cell is A1 (Column A, Row 1).
 The data in a spreadsheet are often referred to as Val-
ues.
 Excel refers to each file as a Workbook. There can be
multiple pages in each workbook. Each page, or sheet, is
called a Worksheet. When you open a new Excel file, it au-
tomatically starts you with three worksheets, but you can
add more.
Formulas and Function Management:
 Formulas enable you to enter calculations in a work-
sheet. Using Excel for calculations gives you the ability to
change the data (or values) of the cells, and have the pro-
gram automatically update the recalculate the value of the
output based on the new numbers. To enter a formula, type
the formula directly in the cell starting with a = (an equal
sign tells Excel that you are not entering data). For instance,
to add the value in cell A1 with the value in B1, you could
click in cell C1 (where you want your calculated result to
appear) and type =A1+B1. Press the Enter key to see the re-
sult.
 Functions are predefined formulas that perform a spe-
cific operation, such as determining loan payments or cal-
culating investment returns. Functions accept information,
called arguments, and return a result. In most cases, the re-
BY:ARPANA BHANDARI CSE
SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

sult is a calculation, but functions also return results that are


text, references, logical values, arrays, or information about
the worksheet.

Auto Calculate:
 If you need to find a quick total, but you don’t want or
need to include that total in the worksheet, you can use the
AutoCalculate feature. For example, you may want to sum
a list and then use that sum in a formula.
Some Shortcuts:
 Move to beginning of worksheet Ctrl+HOME
 Move to the end of worksheet Ctrl+END
 Select entire row Shift + Space bar
 Select entire column Ctrl + Space bar
 Edit the cell F2
 Insert the current date Shift + ;
 Insert the current time Ctrl+Shift+;
etc.

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

Experiment No.5

Creation and editing power-point slides using MS- power


point.
Introduction:
Microsoft PowerPoint is a slide show presentation program
developed by Microsoft. It was officially launched on May
22, 1990, as a part of the Microsoft Office suite.
Microsoft PowerPoint is a software product used to perform
computer-based presentations. There are various
circumstances in which a presentation is made: teaching a
class, introducing a product to sell, explaining an
organizational structure, etc.
How to open it?
 To use Microsoft PowerPoint, you must first open it:
 One way you can open Microsoft PowerPoint by
clicking Start -> (All) Programs -> Microsoft Office
-> Microsoft OfficePowerPoint.
 You can open Microsoft PowerPoint using a
shortcut on your desktop.
History:
 Originally designed for the Macintosh computer, the
initial release was called "Presenter“. In 1987, it was re-
named to "PowerPoint" due to problems with trademarks,
the idea for the name coming from Robert Gaskins.
 PowerPoint introduced many new changes with the re-
lease of PowerPoint 97. Prior to PowerPoint 97, presenta-
tions were linear, always proceeding from one slide to the
next. PowerPoint 97 incorporated the Visual Basic for Ap-
BY:ARPANA BHANDARI CSE
SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

plications (VBA) language, underlying all macro generation


in Office 97, which allowed users to invoke pre-defined
transitions and effects in a non-linear movie-like style with-
out having to learn programming.
Operation:
 PowerPoint presentations consist of a number of indi-
vidual pages or "slides". The "slide" analogy is a reference
to the slide projector. A better analogy would be the "foils"
(or transparencies/plastic sheets) that are shown with
an overhead projector, although they are in decline now.
Slides may contain text, graphics, sound, movies, and other
objects, which may be arranged freely. The presentation can
be printed, displayed live on a computer, or navigated
through at the command of the presenter. For larger audi-
ences the computer display is often projected using a video
projector. Slides can also form the basis of webcasts.
 PowerPoint provides three types of movements:
 Entrance, emphasis, and exit of elements on a
slide itself are controlled by what PowerPoint
calls Custom Animations.
 Transitions, on the other hand, are movements be-
tween slides. These can be animated in a variety of
ways.
 Custom animation can be used to create small
story boards by animating pictures to enter, exit or
move.
Versions for Windows Operating Systems:
 Versions for Microsoft Windows include:
 1990 PowerPoint 2.0 for Windows 3.0
 1992 PowerPoint 3.0 for Windows 3.1
 1993 PowerPoint 4.0 (Office 4.x)
BY:ARPANA BHANDARI CSE
SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

 1995 PowerPoint for Windows 95 (version 7.0; Office


95)
 1997 PowerPoint 97 (version 8.0; Office 97)
 1999 PowerPoint 2000 (version 9.0; Office 2000)
 2001 PowerPoint 2002 (version 10; Office XP)
 2003 Office PowerPoint 2003 (version 11; Office
2003)
 2007 Office PowerPoint 2007 (version 12; Office
2007)
 2010 PowerPoint 2010 (version 14; Office 2010)
 2013 PowerPoint 2013 (version 15; Office 2013)
Filename extensions
 .ppt
 .pptx
 .pps
 .ppsx
Interface:

Quick Access Toolbar:


 Some ShortcutsSuper script Ctrl+Shift+ ‘+’
 Sub script Ctrl+ ‘+’
 Left Justification Ctrl + L

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

 Center Justification Ctrl + E


 Right Justification Ctrl + R
 Start Presentation F5
 End a Presentation Esc
 Start presentation from
current slide Shift + F5 etc.
Experiment-6

Write a program to illustrate Arithmetic


Expressions
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,c,d,e,f,g;
clrscr();
cout<<"\n Enter First Number a : ";
cin>>a;
cout<<"\n Enter Second Number b : ";
cin>>b;
c=a+b;
d=a-b;
e=a*b;
f=a/b;
g=a%b;
cout<<" Addition = "<<c<<"\n";
cout<<" Subtraction = "<<d<<"\n";
cout<<" Multiplication = "<<e<<"\n";
cout<<" Division = "<<f<<"\n";
cout<<" Modulus = "<<g<<"\n";
getch();
}

Output:

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

Experiment-7

Write a program to illustrate Arrays

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int large, arr[50], size, i;
cout<<"Enter Array Size (max 50) : ";
cin>>size;
cout<<"Enter array elements : ";
for(i=0; i<size; i++)
{
cin>>arr[i];
}
cout<<"Searching for largest number ...\n\n";
large=arr[0];
for(i=0; i<size; i++)
{
if(large<arr[i])
{
BY:ARPANA BHANDARI CSE
SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

large=arr[i];
}
}
cout<<"Largest Number = "<<large;
getch();

Experiment-8

Write a program to illustrate Functions


#include<iostream.h>
#include<conio.h>
void sum(int,int);
void sum(double,double);
void sum(char,char);
main()
{
int a=10,b=20;
double c=7.52,d=8.14;
char e='A',f='B';
sum(a,b);
sum(c,d);
sum(e,f);
getch();
return 0;
}
void sum(int x,int y)
{
cout<<"sum of two integer value="<<x+y<<endl;
BY:ARPANA BHANDARI CSE
SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

}
void sum(double x,double y)
{
cout<<"sum of two double value="<<x+y<<endl;
}
void sum(char x,char y)
{
cout<<"sum of two char value="<<x+y<<endl;
}
Output:

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

Experiment-09

Write a program to illustrate constructor & Destructor

#include<iostream.h>
#include<conio.h>
class Example {
// Variable Declaration
int a,b;
public:

//Constructor
Example() {
// Assign Values In Constructor
a=10;
b=20;
cout<<"Im Constructor\n";
}

void Display() {
cout<<"Values :"<<a<<"\t"<<b;
}
};

int main() {
Example Object;
// Constructor invoked.
BY:ARPANA BHANDARI CSE
SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

Object.Display();

// Wait For Output Screen


getch();
return 0;
}

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

Experiment-10

Write a program to illustrate Objects & Classes

#include <iostream>
using namespace std;

class Hello
{
public:
void sayHello()
{
cout << "Hello World" << endl;
}
};

int main()
{
Hello h;

h.sayHello();

return 0;
}

class Marks
{
private:
int rno;
float perc;

public:

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

//constructor
Marks()
{rno = 0; perc = 0.0f;}

//input roll numbers and percentage


void readMarks(void)
{
cout<<"Enter roll number: ";
cin>>rno;
cout<<"Enter percentage: ";
cin>>perc;
}

//print roll number and percentage


void printMarks(void)
{
cout<<"Roll No.: "<<rno<<endl;
cout<<"Percentage: "<<perc<<"%"<<endl;
}
};

class Student
{
private:
//object to Marks class
Marks objM;
char name[30];

public:
//input student details
void readStudent(void)
{
//Input name
cout<<"Enter name: ";
cin.getline(name, 30);
//input Marks
objM.readMarks();
}

//print student details


void printStudent(void)
{
//print name
cout<<"Name: "<<name<<endl;
//print marks
objM.printMarks();
}
};

//main code

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

int main()
{
//create object to student class
Student std;
std.readStudent();
std.printStudent();

return 0;

BY:ARPANA BHANDARI CSE


SAGAR INSTITUTE OF RESEARCH & TECHNOLOGY -EXCELLENCE

BY:ARPANA BHANDARI CSE

You might also like