Lab Manual Fcse
Lab Manual Fcse
LAB MANUAL
Subject code : CS-112
SUBJECT NAME: Fundamental of Computer
science & engineering
SEMESTER: IST
Session: JULY-DEC
Department - CSE
INDEX
Page No
1. Scheme of Examination
2. Syllabus
3. Academic Calendar
4. Time Table
5. LIST of Experiment
6. Viva question
SCHEME
OF EXAMINATION
&
SYLLABUS
05. Creation and editing power-point slides using MS- power point
LIST OF EXPERIMENT
&
TIME TABLE
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.
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.
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
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.
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.
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.
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
My Computer:
This icon is clicked to navigate through different sectors of harddisk storage
and other peripheral attached to computer.
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-
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
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
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
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.
Experiment No.5
Output:
Experiment-7
#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
}
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:
Experiment-09
#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();
Experiment-10
#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:
//constructor
Marks()
{rno = 0; perc = 0.0f;}
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();
}
//main code
int main()
{
//create object to student class
Student std;
std.readStudent();
std.printStudent();
return 0;