Professional Documents
Culture Documents
Lab Manual
Introduction to Computing
CS-112
List of Experiments
Lab No Title
2 To learn about browsers settings, bookmarks, search toolbars and pop up blockers
4 Overview of MS Office word, Formatting Text & Documents, Inserting Header & footer, Bullets &
Numbering and to Cut, Copy & Paste command
Working with Graphics, inserting, resizing, cropping & deleting of shapes, columns, Smart art
5
graphics, Tables and commands about tables in MS word
Overview of excel, creating work books & sheets, Selecting cell & ranges, Modifying
6
Spreadsheets Automatically Fill Data, Cell borders & style and using basic formulas in excel.
Overview of Power point, adding slides, formatting slides, applying clip art, translation of slides,
7 animation and inserting tables and charts in slides
To learn about basic functions and applications of Hub, Switch, Bridge, Routers, Gateway
8
and Network cards
Overview of thinking and process mapping, visio interface, page setup, basic drawing skills, adding &
9
deleting shapes and saving drawing
To learn about selecting, moving, resizing, rotating & deleting Shapes, working with text, connecting and
10 grouping of shapes
11 Introduction to Turbo C IDE and Programming Environment., C Compiler & C standard library
To understand the C Preprocessor directives C Preprocessor directives, Header Files. Data Types &
12
Format specifiers.
13 To Use of variables. Constants and operators. & Gech() ,Getche() & Getchar( ) .
Familiarization with Matlab software and minimal Matlab calculation Session
14
15 PART A: Familiarization
Introduction withArrays
to Matrices and Matlab screen
2 PART B: A minimal Matlab Session
PART A:Dealing with polynomials & Partial fraction expansion
PART B:Plotting in Matlab
16
PART A:C:Solving ordinary
Familiarization differential
with equation (ODE) symbolically
Matlab screen
2 PART B: A minimal Matlab Session
Also on the front of the motherboard are a number of peripheral card slots. These slots are where
most video cards, sound cards and other expansion cards are connected to the motherboard. On the
left side of the motherboard (the side that faces the back end of the case) are a number of ports. These
ports allow most of the computer's external peripherals to connect such as the monitor, printer,
keyboard, mouse, speakers, phone line, network cable and more. Most motherboards also include
USB and FireWire ports here that allow compatible devices to connect to your computer when you
need them - devices like digital still and video cameras.
Expansion Cards:
Special expansion cards are one way to add new types of ports to an older computer or to expand
the number of ports on your computer. Like other expansion cards, these cards clip into an open
expansion slot on the motherboard
Figure: An expansion card with 3 USB ports and 2 Fire wire ports
Figure: A Graphics card with output ports for both digital and analog video. The GPU sits under the fan (red) and
Heatsink
CentralProcessing Unit
CPU or Processor for short. The brain of a computer. Approximately 1.5 in X 1.5 in. Does all the
computation/work for the computer
Memory
Although memory is technically any form of electronic storage, it is used most often to identify fast, temporary
forms of storage. Accessing the hard drive for information takes time. When the information is kept in
memory, the CPU can access it much more quickly
Hard Drive
Where you store information permanently most frequently. This is also nonvolatile.
Serial Port
Often used to connect a older mice, older external modems, older digital cameras, etc to the computer.
The serial port has been replaced by USB in most cases. 9-pin connector. Small and short, often gray
in color. Transmits data at 19 Kb/s.
Monitor Ports
Used to connect a monitor to the computer. PCs usually use a VGA (Video Graphics Array) analog
connector (also known as a D-Sub connector) that has 15 pins in three rows. Typically blue in color.
Because a VGA (analog) connector does not support the use of digital monitors, the Digital Video
Interface (DVI) standard was developed. LCD monitors work in a digital mode and support the DVI
format. At one time, a digital signal offered better image quality compared to analog technology.
However, analog signal processing technology has improved over the years and the difference in
quality is now minimal.
Parallel Port
Most often used to connect a printer to the computer. 25-pin connector. Long and skinny, often pink
in color. Transmits data at 50-100 Kb/s.
USB Port
Universal Serial Bus. Now used to connect almost all peripheral devices to the computer. USB 1.1
transmits data at 1.5 Mb/s at low speed, 12 Mb/s at full speed. USB 2.0 transmits data at 480 Mb/s.
PS/2 Port
sometimes called a mouse port, was developed by IBM. It is used to connect a computer mouse or
keyboard. Most computers come with two PS/2 ports.
Ethernet Port
This port is used for networking and fast internet connections. Data moves through them at speeds of
either 10 megabits or 100 megabits or 1 gigabit (1,000 megabits) depending on what speed the
network card in the computer supports. Little monitor lights on these devices flicker when in use.
Power Supply
Gives your computer power by converting alternating current (AC) supplied by the wall connection
to direct current (DC).
Sound Card
Used to input and output sound under program control. Sound cards provide better sound quality
than the built in sound control provided with most computers.
Network Card
Used to provide a computer connection over a network. Transmit data at 10/100/1000 Mb/s.
CD ROM
A device used to read CD-ROMs. If capable of writing to the CD-ROM, then they are usually
referred to as a ‘burner’ or CD-RW.
Conclusion
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
Lab 2
Objective: To learn about browsers settings, bookmarks, search toolbars and pop up blockers
Bookmark:
Each web browser is built-in with the support of Internet Bookmarks which serve as a named anchor primarily
to URLs. The primary purpose of this book mark is to easily catalog and access web pages that the web
browser user has visited or plans to visit, without having to navigate the web to get there. Pop-up Blockers:
Pop-ups are a form of online advertising on the WWW intended to attract the attention of the users. These
pop ups are hosted on the web sites which are frequently visited by the netizens. These pop ups are activated
when these web sites open a new web browser window and there by displaying the advertisement
Plug-ins:
A plug-in is a software component program that interacts with a main application to provide a better
integration of the media. The basic difference between application programs and plug-ins is that multimedia
files are launched in a separate window where as in plug-ins multimedia play in the browser window.
Few famous plug-ins are:
Apple Quick Time
Macromedia flash
Microsoft Media Player
Adobe Shockwave
Sun Micro systems Java Applet
PROCEDURE:
b) How to access the websites and email& Search Engines & various threats on the internet and would
be asked to configure their computer to be safe on the internet, Antivirus downloads to avoid viruses
and/or worms.
PURPOSE: To know what search engines are and how to use the search engines.
A search engine can be defined as a web site with tools which help you to find information on the internet
Function of a search engine You can find anything from a schedule of White house tours to instructions for
removing stains from clothes.
Limitations:
Search engines visit web sites only several weeks. Search engines cannot see information in other data bases
later on.
On the internet a search engine is a coordinated set of programs that includes: A spider (crawler or bot) that
goes to every page or representative pages on every web site that wants to be searchable and reads it , using
hypertext links on each page to discover and read site’s other pages.
Pros:
You can select the search terms
You can use the same search terms with multiple search engines
You can change search terms as much as you wish
You will normally receive numerous links
Its fast
Cons:
There are so many different search engines it may be difficult to choose
You will normally receive too many links often making it difficult to identify the most relevant sites.
The vast majority of links may be only marginally relevant or altogether irrelevant
EX:
Alta Vista
Ask Jeeves
Google
Lycos
Etc..
Meta Search Engines:
Meta search engines or “met crawlers” don’t crawl the web themselves. Instead they search the resources of
multiple search engines by sending a search to several search engines at once aggregating the result.
Pros:
You only need to use one search tool which is time- efficient
You only need to learn how to use one search engine reducing learning curve
You benefit from the difference among several search tools at once
Cons:
Meta search services may not be able to leverage each individual search engines full range of query tools
resulting in less refined searches
You cannot personally select the search engines queried by meta search services.
PURPOSE: To learn various threats on the internet and configure the computer to be safe on the internet.
THEORY:
Antivirus:
Antivirus software is a program that either comes installed on your computer or that you purchase and install
yourself. It protects your computer against most viruses, worms, Trojan horses and other unwanted invaders
that can make your computer sick.
Firewall
firewall is a special software or hardware designed to protect a private computer network from unauthorized
access. A firewall is a set of related programs located at a network gateway server which protects the
resources of the private network from users from other networks.
PROCEDURE:
Installing Symantec antivirus for Windows:
Insert Symantec antivirus CD into your CD drive
Double click on the Symantec-setup.exe
The installer will open
Click next to proceed
License agreement will open .Click I accept the terms of the license agreement and then click next.
Follow the instruction on the screen to complete the installation.
Windows Firewall:
Go to Start>control panel>Network and Internet Connections>windows firewall
In the general tab check the On(recommended) box
If you don’t want any exceptions check on Don’t allow exceptions box
THEORY:
Conclusion
Lab 3
Objective: To learn about how to Install windows 7 on a personal computer
Apparatus: Personal Computer, windows 7 CD
Theory:
Installing Windows 7
If you have recently purchased a new computer, you may be able to upgrade using Windows Anytime
Upgrade. See Windows Anytime Upgrade(link) for detailed instructions. The instructions that follow
assume that you have downloaded the Windows 7 software and have already burned the IMG file you
received to a DVD. If you have not already burned the IMG file, see Working w ith Ima ge File s.
The instructions also assume that you are running Windows XP or Vista.
Pre-installation information
Important: You need to prepare your computer before initiating the installation of the Windows 7.
Since you are installing a completely new operating system, all programs that are currently on
your computer will be deleted.
1. Back up all of your all your files and folders onto an external source such as a DVD, CD, Jump
Drive, External Hard Drive, thumbdrive or USB Drive. If you have a second partition of your
hard drive, you can copy and paste your data to this partition including any previously
downloaded software.
2. Make a note of all your install files for any programs on your computer such as programs
downloaded and paid for from the internet. CD/DVD installation programs (IE Office, Project
Professional) and the licenses for these products such as license keys, serial numbers, activation
codes and product keys. These programs will need to be reinstalled later.
3. Make sure you write down the Product Key for Windows 7. You will need this number to
complete the activation.
4 If you are using an external device to back up your files, disconnect the device.
INSTALLING WINDOWS 7
You need to have at least 10GB to install. Check the properties of the C Drive to make sure you
have enough space before you begin.
1. Place the DVD with the burned IMG file on it into the DVD drive. Alternatively, if your
image has been burned to a USB device, the following instructions also apply.
2. Restart your computer.
3. During the booting process, press the appropriate button to view the boot menu. This will
be different for every computer.
4. Select the boot device in which your Windows software is on. i.e. DVD or USB device.
5. When the monitor displays “Press any key to boot off CD….”, press any key on the keyboard
The Install Windows window is displayed. Click the arrow beside Install now
Note: You must have at least 10GB of space available to do a custom installation of Windows 7.
Note: You must have at least 10GB of space available to do a custom installation of Windows 7.
SETTING UP WINDOWS 7
After the installation is complete, you will need to:
Set up Windows updates.
Post-installation information
Note: If there were any files left on your hard drive before you started the installation process, they
will be found in C:\Windows.old. You will need to reinstall all your previous programs.
1. Click Start.
\
2. Right click on Computer. A pop-up menu is displayed.
3. Click Properties. The properties of Windows 7 are displayed.
4. Beside Product Key, enter the new product key in the text box. The product key is
visible on the WebStore when you view the complete summary of your order under
Your Account.
Conclusion
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
The Ribbon
Understanding the Ribbon is a great way to help understand the changes between Microsoft 2003
to Microsoft 2010. The ribbon holds all of the information in previous versions of Microsoft Office
in a more visual stream line manner through a series of tabs that include an immense variety of
program features.
Home Tab
This is the most used tab; it incorporates all text formatting features such as font and paragraph
changes.
Insert Tab
This tab allows you to insert a variety of items into a document from pictures, clip art, tables and
headers and footers.
Mailing Tab
This tab allows you to create documents to help when sending out mailings such as printing
envelopes, labels and processing mail merges.
Review Tab
This tab allows you to make any changes to your document due to spelling and grammar issues.
It also holds the track changes feature which provides people with the ability to make notes and
changes to a document of another person.
View Tab
This tab allows you to change the view of your document to a different two page document or
zoom.
GettingStarted
Now that you have an understanding of where things are located, let’s look at the steps needed to create
a document.
OpeningOutlook
You may have a shortcut to Word on your desktop, if so double click the
icon and Word will open. If not
follow the steps below:
1. Click on the Start button
2. HighlightPrograms
3. Highlight Microsoft Office
4. Click on Microsoft Word 2010
Using Templates
Word 2010 allows you to apply built-in templates from a wide selection of popular Word templates,
including resumes, agendas, business cards, and faxes.
To find and apply a template in Word, do the following:
1. On the File tab, click New.
2. Under Available Templates, do one of the following:
To use one of the built-in templates, click Sample Templates, click the template that you want,
and then click Create.
To reuse a template that you’ve recently used, click Recent Templates, click the template that
you want, and then click Create.
To find a template on Office.com, under Office.com Templates, click the template category that
you want, click the template that you want, and click Download to download the template from
Office.com to your computer.
3. Once you have selected your template you can modify it in any way to create the document you
want.
NOTE: You can also search for templates on Office.com from within Word. In the Search Office.com
for templates box, type one or more search terms, and then click the arrow button to search.
Opening a document
1. Click the File tab, and then click Open.
2. In the left pane of the Open dialog box, click the drive or folder that contains the document.
3. In the right pane of the Open dialog box, open the folder that contains the document that you want.
4. Click the document and then click Open.
Cut, Copy and Paste
If you would like to remove text from your document you can copy or cut the text
from the document. Simply highlight the text and go to the Home tab in the
Clipboard group and click Cut or Copy. You can also right click on your mouse
and select Cut or Copy.
Pasting Text
If you Copy text, you typically need to Paste it somewhere. The Paste feature in
2010 is much more detailed than in previous versions of Word. When you paste content, the Paste
Options button provides different options, depending on the source of the content.
Keep Source Formatting: This option preserves the look of the original text.
Keep Text Only: This option removes all the original formatting from the text.
Link & Keep Source Formatting: This option preserves the look of the original text, and it
maintains a link to the source file and updates the pasted text with any changes that are made to the
source file.
Link & Use Destination Styles: This option formats the text to match the style that’s applied where
the text is pasted. It also maintains a link to the source file and updates the pasted text with any
changes that are made to the source file.
Merge Formatting: This option changes the formatting so that it matches the text that surrounds it.
Picture: This option inserts the text as an image.
Use Destination Styles: This option formats the text to match the style that’s applied where the text
is pasted.
Use Destination Theme: This option formats the text to match the theme that’s applied to the
document where the text is pasted.
To Paste, click on the area you want your information to be inserted and either go to the Home tab in the
Clipboard group and click Paste or right click on your mouse and select Paste.
Undo
The Quick Access Toolbar holds a variety of commands right at you finger tips. It is located in the top
left of the document above the File and Home tab.
You can add or remove command by clicking on the arrow
to the right of the Quick Access Toolbar.
If you make an error in your document click on the Undo command and it will remove the last
thing you did.
Modifying Fonts
The Font Group allows you to change your text font style,
size, color and many other elements.
1. Highlight the text you would like to modify.
2. Click on the drop down arrow of font style and font size
and select the changes you would like to make.
3. While text is highlighted you can also click on the color, bold, italics or underline commands to modify
the text even more.
Format Painter
The Format Painter feature allows you to quickly copy a format that you have applied
to text already in your document.
1. Select the text or graphic that has the formatting that you want to copy.
2. On the Home tab, in the Clipboard group, single click Format Painter. The pointer
will change to a paintbrush icon.
3. Bring your cursor to the text or graphic that you want to format and click on the text.
4. To stop formatting, press ESC or click on the Format Painter command again.
NOTE: Double-click the Format Painter button if you want to change the format of
multiple selections in your document.
Clear Formatting
To get rid of all the styles, text effects, and font formatting in your document, do the following:
1. Select the text that you want to clear the formatting from. Or press CTRL+A to select everything in
the document.
2. On the Home tab, in the Font group, click Clear Formatting.
NOTE: The Clear Formatting command will not
remove highlighting from your text. To clear
highlighting, select the highlighted text, and then click
the arrow next to Text Highlight Color and click No
Color.
FormattingDocuments
Adjusting Line Spacing
The default spacing is 1.15 line spacing and 10 points after each paragraph. The default spacing in
Office Word 2003 documents is 1.0 between lines and
no blank line between paragraphs.
Page Orientation You can choose either portrait (vertical) or landscape (horizontal) orientation for all or
part of your document.
Change Page Orientation
1. On the Page Layout tab, in the Page Setup group,
click Orientation.
2. Click Portrait or Landscape.
Different Page Orientations on Same Document
1. Highlight the pages or paragraphs that you
want to change to portrait or landscape
orientation.
2. On the Page Layout tab, in the Page Setup
group, click Margins.
Page Margins
Page margins are the blank space around the edges of the page. In general, you insert text and graphics
in the printable area inside the margins When you change a document’s page margins, you change
where text and graphics appear on each page. You can change the page margins either by choosing
from one of Word’s predefined settings in the Margins gallery or by creating custom margins.
Page Breaks
Word automatically inserts a page break when you reach the end of a page. If you want the page to
break in a different place, you can insert a manual page break.
Inserting a Page Break
1. Click where you want to start a new page.
2. On the Insert tab, in the Pages group, click Page Break.
NOTE: You can also insert breaks into your document by going to the Page
Layout tab, Page Setup group and clicking on the Breaks command to view a
variety of page and section breaks you can insert into your document.
Tab Stops
Creating tab stops can be helpful when creating a large number of documents such as flyers, table of
contents or even when creating a resume. They help you to display and line up information correctly.
Setting Manual Tab Stops
1. Click the tab selector at the left end of the ruler until it displays the type of tab that you want.
2. Then click in the ruler at the top of your page, where you want to set the tab stop.
Conclusion
.....................................................................................................................................................
………………………………………………………………………………………………….
…………………………………………………………………………………………….........
………………………………………………………………………………………………….
Lab 5
Objective: Working with Graphics, inserting, resizing, cropping & deleting of shapes, columns, Smart art
graphics, Tables and commands about tables
Format Shapes
After you insert a shape a new tab called Drawing Tools Format will
appear every time you click on the shape.
1. Click the shape that you want to apply a new or different Quick
Style to.
2. Go to the Drawing Tools Format tab, in the Shape Styles group, click the style that you want to be
applied.
WordArt
WordArt can be used to add special text effects to your document. For example, you can stretch a title,
skew text, make text fit a preset shape, or apply a gradient fill. This WordArt becomes an object that you
can move or position in your document to add decoration or emphasis. You can modify or add to the text
in an existing WordArt object whenever you want. To add WordArt to text in your document, complete
the following steps:
1. On the Insert tab, in the Text group, click
WordArt,
2. A Drop down menu will appear, click the WordArt
style that you want.
3. A Text Box will appear with the words” Enter your
text here”, Enter your text.
Sizing Graphics
You can easily resize pictures, text boxes, shapes, and WordArt in your file. You can also crop pictures
or return them to their original size.
Manually Resize Graphics
1. Click the pictureshape, text box or WordArtthat you want to resize.
2. Small circles or squares, also known as sizing handles, will appear at the
corners and sides of a selected object.
3. Click and hold on a sizing handle away from or toward the center to increase or decrease the size of
the picture.
Cropping a Picture
Cropping reduces the size of a pictureby removing vertical or horizontal edges. Cropping is often used to
hide or trim a part of a picture, either for emphasis or to remove unwanted portions.
1. Click on the picture that you want to crop.
2. Go to Picture Tools, on the Format tab, in the Size group, click Crop.
3. Black dotted lines will appear around your picture. Then drag the center
SmartArt Graphic
A SmartArt graphic is a visual representation of your information that you can quickly and easily create,
choosing from among many different layouts, to effectively communicate your message or ideas. You
can create SmartArt graphics in Excel,
Outlook, PowerPoint, and Word.
Tables
Using tables in Word can provide you with additional elements to any document. Tables can be used to
create lists or format text in an organized fashion.
Inserting a Table
1. Click where you want to insert a table.
2. On the Insert tab, in the Tables group, click Table
3. A drop down box will appear; click and hold your mouse then drag to
select the number of rows and columns that you want inserted into
your document. You will see your table appearing in your document
as you drag on the grid.
4. Once you have highlighted the rows and columns you would like let
go of your mouse and the table will be in your document
Delete a Table
1. Rest the pointer on the table until the table move handle appears, and then click the table move
handle.
2. Press BACKSPACE on your keyboard.
Print Preview
Print Preview automatically displays when you click
on the Print tab. Whenever you make a change to
a print-related setting, the preview is automatically updated.
1. Click the File tab, and then click Print. To go back to your document, click the File tab.
2. A preview of your document automatically appears. To view each page, click the arrows below the
preview.
Print
The Print tab is the place to go to make sure you are printing what you want.
Help
If you need additional assistance when completing your document you can use the help feature.
1. Click on the blue circle with the white question mark command
2. A Help box will appear.
3. Click in the Search Help textbox and type what you need help with
4. Click the magnifying glass next to the text box and the possible solutions will appear.
Conclusion
Lab 6
Objective: Overview of excel, creating work books & sheets, Selecting cell & ranges, Modifying Spreadsheets
Automatically Fill Data, Cell borders & style and using basic formulas in excel.
Excel is a spreadsheet program in the Microsoft Office system. You can use Excel to create and format
workbooks (a collection of spreadsheets) in order to analyze data and make more informed business
decisions. Specifically, you can use Excel to track data, build models for analyzing data, write formulas to
perform calculations on that data, pivot the data in numerous ways, and present data in a variety of
professional looking charts.
Getting Started:
Opening Microsoft Excel:
You may have a shortcut to Excel on your desktop, if so double click the icon and Excel will
open. If not follow the steps below:
1. Click on the Start button
2. Highlight Programs
3. Highlight Microsoft Office
4. Click on Microsoft Excel 2010
In order to complete more advanced processes in Excel you need to be able to highlight or select cells, rows
and columns. There are a variety of ways to do this, see the table below to understand the options.
Modifying Spreadsheets
In order to create an understandable and professional document you will need to make adjustments to the
cells, rows, columns and text. Use the following processes to assist when creating a spreadsheet.
When you move or copy a cell, Excel moves or copies the entire cell, including formulas and their resulting
values, cell formats, and comments.
1 Select the cells that you want to move or copy.
2 On the Home tab, in the Clipboard group, do one of the
following:
To move cells, click Cut.
To copy cells, click Copy.
3 Click in the center of the cell you would like to Paste the
information.
4 On the Home tab, in the Clipboard group, click Paste.
Split Cells
Select the merged cell you want to split
To split the merged cell, click Merge and Center. The cells will split and the contents of the merged
cell will appear in the upper-left cell of the range of split cells.
Automatically Fill Data
To quickly fill in several types of data series, you can select cells and drag the fill handle.
To use the fill handle, you select the cells that you want to use as a basis for filling additional cells, and then
drag the fill handle across or down the cells that you want to fill.
1. Select the cell that contains the formula that you want to be brought to other cells.
2. Move your curser to the small black square in the lower-right corner of a selected cell also now as the fill
handle. Your pointer will change to a small black cross.
3. Click and hold your mouse then drag the fill handle across the cells, horizontally to the right or vertically
down, that you want to fill.
4. The cells you want filled will have a gray looking border around them. Once you fill all of the cells let go of
your mouse and your cells will be populated.
Formatting Spreadsheet
To further enhance the spread sheet we format a number of elements like text, numbers, coloring and
table styles.
Wrap Text:
You can display multiple lines of text inside a cell by wrapping the text. Wrapping text in a cell does not
affect other cells
Cell Styles
You can also modify a variety of cell and text colors manually.
Cell Fill
1. Select the cells that you want to apply or remove a fill color
from.
2. Go to the Home tab, in the Font group and select one of the
following options:
a. To fill cells with a solid color, click the arrow next to Fill
Color, and then under Theme Colors or Standard
Colors, click the color that you want.
b. To fill cells with a custom color, click the arrow next to
Fill Color, click More Colors, and then in the Colors
dialog box select the color that you want.
c. To apply the most recently selected color, click Fill Color
.
Remove Cell Fill
Text Color
1. Select the cell, range of cells, text, or characters that you want to format
with a different text color.
2. On the Home tab, in the Font group and select one of the following
options:
a. To apply the most recently selected text color, click Font Color
b. To change the text color, click the arrow next to Font Color, and then under Theme
Colors or Standard Colors, click the color that you want to use.
1. On the Sheet tab bar, right-click the sheet tab that you want to
customize
2. Click Rename to rename the sheet or Tab Color to select a tab
color.
3. Type in the name or select a color you would like for your
spreadsheet.
4. The information will be added to the tab at the bottom of the
spreadsheet.
Task 1
1. Enter the data “Sunday” into cell A1 and “Monday” into cell B1.
2. Type in “17/08” into cell E8.
3. Type in “2” into cell I8 and “4” into cell I9.
Auto-complete
Notice how Excel automatically detected that 17/08 was a date and converted it to 17-Aug. We will discuss
formatting data later on in this lab. Now, we want to select both cells A1 and B1 together. To do this, click
A1 and without releasing the mouse button, move the mouse over cell B1. Now there should be a
rectangle around both cells as shown below
To get excel to auto-complete this row, we now position the mouse cursor at the bottom-left corner of the
rectangle. Make sure the cursor has changed into a + sign. Now hold down the cursor and drag it to the
left till I1.
Lab Task 2:
1. Auto-complete cells I8 and I9 all the
way to I14.
2. Auto-complete cell E8 all the way to
E12.
Basic Calculations:
Now let us calculate the sum of the numbers in I8 and I9. In cell J10, type “=I8+I9”. One
other option is to type in “=”, then select cell I8. After that, type in “+” and then select I9.
Lab Task 3:
1. Open Sheet 2 in your workbook.
2. In cells A1 and A2, type 1000 and 1500 respectively.
3. Use auto-complete to fill in cells A3 to A8.
4. Calculate the following values for cells A1 to A8 using built-in Excel functions:
a) Sum
b) Maximum
c) Minimum
d) Average
e) Median
f) Standard deviation
5. Enter the number 5000 into cell A9 and modify all the above formulas to include it.
6. Calculate the sum of the Maximum and Minimum, and then divide this number by the standard
deviation.
Conclusion
Lab 7
Objective: Overview of Power point, adding slides, formatting slides, applying clip art, translation of slides
animation and inserting tables and charts in slides
Apparatus: Personal Computer, Microsoft Visio
Theory:
PowerPoint is a system in the Microsoft Office Suite that enables you to present information in office
meetings, lectures and seminars to create maximum impact in a minimal amount of time. PowerPoint
presentations can amplify your message, accelerate the information being absorbed and assist with
comprehension enabling faster decision making.
NOTE: A theme can be selected at any time during the creation of your slides however; themes
can alter the position of placeholders, so your text maybe automatically adjusted to properly fit
the placeholder of the theme causing unexpected formatting changes to your slides.
Inserting Clip Art
If you would like to add an additional dimension to a PowerPoint slide you can add Clip Art to
your slides. Clip Art includes pictures, sounds and videos. There are two ways to initiate
inserting Clip Art depending on where you would like the graphic to be located.
1 The first method is to go to the Insert Ribbon and click on the Clip Art command. You can
also click on the Audio or Video commands and opt to pick from the Clip Art gallery. The
second method is to click on the Clip Art icon in a placeholder.
2 The Clip Art task pane will then open on the right. Type a keyword in the Search for box
that suggests the type of clips you may want. Use the Results should be drop down to select
the media type to search in then click Go.
3 Clips that fit the keyword will appear in the box below. Click on the clip that you would like
on your slide and it will be automatically appear.
NOTE: When inserting a graphic using the icon in a placeholder causes the graphic to be
automatically sized and positioned within the placeholder preventing you from entering text in
the same placeholder. Inserting a graphic through the Insert Ribbon will insert the graphic on
the slide without removing the placeholder enabling you to enter text on the slide without having
to further modify your slide.
Slide Transitions
Slide transitions provide an animated effect to each slide when moving from one slide to the
next during a slide show. There are a variety of transitions that can be applied to each or all
slides including sounds.
1 4
6
5
2 3
1 The Transition to This Slide group provides thumbnails of various slide transition options.
To see all of the transitions options click on the up and down arrows or the More arrow to
the right of this group.
2 When you point and hover over any transition thumbnail, a preview of the theme will play.
To apply the transition to your slide, click on the thumbnail you like.
3 To apply the same transition to all of your slides click on the Apply To All command after
selecting the transition of your choice.
4 To apply a Sound, click on the sound drop down arrow. Then Click on the sound you would
like to chime during the slide transition. Click the Apply To All command to have the chime
occur during each transition.
5 The Advance Slide group, allows you to decide if a transition should appear when the
mouse is clicked or after a specified time. Click the On Mouse Click box for transitions to
occur only when forced. Click on the After box for the slide to transition at the time
specified such as 5 seconds or 1 minute.
6 Finally, when all transitions are applied you can preview the current slide by clicking on the
Preview command.
Slide Animations
Slide animations create animated effects to text and graphics during a slide show. There are a
variety of animations that can be applied to text or graphics in multiple ways from a single word
to all of the text on a slide.
4
1
5
2
3
1 The Animation group provides a variety of option to apply animations to text and graphics
within each slide.
To see all of the animation options click on the Up Row, Down Row and More arrows to
the right of the Animation group.
The Effect Options command
provides additional animation
options for each animation
command in the Animation
group.
The Add Animation command
provides a visual of all of the
animation options to animate
text and graphics upon
Entrance, Exit and as an
Emphasis. These commands
are the same as the commands
in the Animation group.
2 When you point and hover over
any animation command, it will be
highlighted in a golden color and a
preview of the animation will
appear. To apply an animation,
highlight text or select a graphic
that you would like the animation to be used on, then click on the command, the selected
command will remain highlighted in a golden color.
3 The Timing group allows you to modify the sequence and timing of the animations selected.
You can decide if an animation should appear when the mouse is clicked or after a specified
time. You can also decide if text should be animated together or separate as well as
reordering the animations. Use the Start drop down arrow to opt for animations to occur
only when clicked or with other text. Click on the Duration box for the text or graphic to
animate at a specified time.
4 The Animation Pane displays all of the animations you
have applied to each slide. It also enables you to modify
each animation similar to the Timing group and play the
animations applied to the slide.
5 Finally, when all animations are applied you can preview
the current slide by clicking on the Preview command.
Starting a Slide Show
The best way to view your slides as a show, whether you are previewing your documents or
presenting to an audience, go to the Slide Show tab on the Ribbon.
1 To view your slide show go to the Start Slide Show group. To start on the first slide click
the From Beginning command. To start on the current slide click the From Current Slide
command.
2 Your computer screen will disappear and a slide show will fill
your computer screen.
3 To move from slide to slide you can use the Slide Show toolbar,
at the bottom left of the screen.
Navigational arrows will appear when you
position your cursor in that area. You can
also move from slide to slide by clicking the
mouse button or using the right and left
arrows on the keyboard.
4 To end your slide show press the ESC
button on your keyboard. This will return you to your screen as you left.
NOTE: Another way to quickly preview a slide is to click on the Slide Show button in the
lower right part of the PowerPoint window. The slide show will begin from the slide selected on
the Slides tab.
Printing Slides
One new feature in PowerPoint 2010 is the File
tab. This tab incorporates many of the features in
the 2003 and 2007 versions of PowerPoint but
makes them much more user friendly.
6
PowerPoint provides a variety of Print options such as automatically previewing your document
and selecting specific formats in which your slides will print.
Print Preview
When you select the Print command under the File tab, your document will automatically
appear in as a preview of what will print. If you change your print options, the preview will
change accordingly. To view each page click on the left or right arrows next to the page number
in the box and the bottom middle section of your screen.
Print Layout
You are able to select how you would like your slides to be
printed by selecting the drop down arrow next to the Fill
Page Slides command.
Then, click on the format would like your slides to print
in. The different options are:
o Full Page Slides – print out with each slide on a
full page
o Handouts - print out with up nine slides per page
o Notes Page - print out of one slide per page
including any notes you may have added in the
Notes Pane while creating your presentation
o Outline View - print out of your text from all of your slides in an outline format.
Once you select your printing format, a preview of your slides will appear. When you're
ready to print, click the Print command.
NOTE: If you would like to print slides that also include lines for audience notes you need to
select Handouts (3 Slides Per Page).
Slide Color
Another helpful printing option allows you to print your slides in
different hues. This can reduce the amount of expensive color
ink when printing PowerPoint slides.
Click on the Color command.
Select the color you would like your slides to appear.
Preview the slides and then click on the Print command.
Saving Slides
To Save your slides, go to the File tab and select Save or Save As.
Save As – use when you save any document for the first time, it will
automatically asked you where to save the document on your
computer and to change the name of the document.
Save – automatically saves the document to a default location and
name or the location and name you selected when first using the Save As feature.
Additional Features
The information above provides you with a basic understanding of how to create a PowerPoint
presentation. However, there are many additional features PowerPoint offers to make your
presentation incredible. Many of these features are also used in Microsoft Word and Excel as
well as other Microsoft programs.
Insert Shapes
Shapes can be used in PowerPoint as a graphic to enhance the
presentation or to insert text into to add visual appeal to a slide.
1 Go to the Insert Tab
2 Click on the Shapes command
3 A large selection of shapes will appear in a drop down menu
4 Double click on the shape you want to insert
5 The shape will appear on the slide
6 Move the shape to any area of the slide by clicking on the edge
of the shape and dragging it. Expand or shrink the shape by
clicking on the circles surrounding the shape and drag.
NOTE: Inserting a Text Box is done in the same manner except
when it is inserted a curser will appear inside the box so you can
enter text.
Inserting Pictures
Pictures are another way to include graphics into a PowerPoint presentation. Many people like
using this feature to incorporate pictures from their personal collection to distinguish their
presentation.
1 Go to the Insert Tab
2 Click on the Picture command
3 A Insert Picture box will appear
4 Select the picture to insert using the folders
on the left of the Insert Picture box.
5 Click Open
6 The picture will appear on the slide
7 Move the picture to any area of the slide by
clicking on the edge of the picture dragging
it. Expand or shrink the picture by clicking
on the circles surrounding the picture and
drag.
Modifying Graphics
Any graphical element inserted into the PowerPoint can be modified by using the Specialized
Tabs that appear when working with graphics. For example the
Picture Tools Format Tab allows you to change the shape, effects
and colors of the picture you inserted.
Inserting WordArt
WordArt can be used to accentuate important words in a presentation such as the title.
1 Go to the Insert Tab
2 Click on the WordArt command
3 A drop down menu of text options will appear
4 Click on the text design you prefer and a text box will appear on
your slide.
5 Click in the text box to modify the text
6 Move the WordArt to any area of the slide by clicking on the edge
of the text and dragging it. Expand or shrink the WordArt by
clicking on the circles surrounding the text and drag.
Inserting SmartArt
SmartArt can be used similar to a graphic by inserting a SmartArt design and entering text in
specified areas. This can be especially
helpful when illustrating hierarchy
structures and processes.
1 to the Insert Tab
2 Click on the SmartArt command
3 A Choose a SmartArt Graphic box
will appear
4 Click on the graphic you prefer and it
will appear on your slide.
5 Click in the areas of the SmartArt
graphic to enter text in the graphic.
Switches
Like hubs, switches are the connectivity points of an Ethernet network. Devices connect to switches via twisted-
pair cabling, one cable for each device. The difference between hubs and switches is in how the devices deal with
the data they receive. Whereas a hub forwards the data it receives to all the ports on the device, a switch forwards
it to only the port that connects to the destination device. It does this by learning the MAC address of the devices
attached to it and then by matching the destination MAC address in the data it receives. Figure shows how a
switch works.
Bridges
Bridges are used to divide larger networks into smaller sections. Bridges accomplish this by sitting between two
physical network segments and managing the flow of data between the two. By looking at the MAC address of
the devices connected to each segment, bridges can elect to forward the data (if they believe that the destination
address is on another interface) or block it from crossing (if they can verify that it is on the interface from which
it came). Figure shows how a bridge can be used to segregate a network.
Routers
In a common configuration, routers are used to create larger networks by joining two network segments. A small
office, home office (SOHO) router is used to connect a user to the Internet. A SOHO router typically serves 1 to
10 users on the system. A router can be a dedicated hardware device or a computer system with more than one
network interface and the appropriate routing software. All modern network operating systems include the
functionality to act as a router. Routers normally create, add, or divide networks or network segments at the
network layer of the OSI reference model because they normally are IP-based devices.
Gateways
Any device that translates one data format into another is called a gateway. Some examples of gateways include
a router that translates data from one network protocol into another, a bridge that converts between two
networking systems, and a software application that converts between two dissimilar formats. The key point about
a gateway is that only the data format is translated, not the data itself. In many cases, the gateway functionality is
incorporated into another device.
Network Card
Network card is a necessary component of a computer without which a computer cannot be connected over a
network. It is also known as network adapter or Network Interface Card (NIC). Most branded computers have
network card pre-installed. Network cards are of two types: Internal and External Network Cards.
Modems
A modem, short for modulator/demodulator, is a device that converts the digital signals generated by a computer
into analog signals that can travel over conventional phone lines. The modem at the receiving end converts the
signal back into a format that the computer can understand. Modems can be used as a means to connect to an ISP
or as a mechanism for dialing up a LAN. Modems can be internal add-in expansion cards or integrated with the
motherboard, external devices that connect to a system’s serial or USB port, PCMCIA cards designed for use in
laptops, or proprietary devices designed for use on other devices, such as portables and handhelds.
Repeaters
As mentioned in Chapter 2, data signals weaken as they travel down a particular medium. This is known as
attenuation. To increase the distance a signal can travel, you can use repeaters. Repeaters increase the cable’s
usable length and are commonly used with coaxial network configurations. Because coaxial networks have fallen
out of favor, and because the functionality of repeaters has been built in to other devices, such as hubs and
switches, repeaters are rarely used as an independent device.
Conclusion
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
Lab 9
Objective: Overview of thinking and process mapping, visio interface, page setup, basic drawing
skills, adding & deleting shapes and saving drawing
Starting Visio
There are multiple ways to start Visio. You can start Visio 2010 from the Start menu (in
Windows 7), or by opening an existing Visio file.
1. Click the Start button, click All Programs, click Microsoft Office, and then click
Microsoft Visio 2010.
When you start Visio, the program window opens and the Backstage view displays. The
Backstage view contains all the commands related to managing files and customizing the
program. It provides an easy way to create, open, save, print, share, and close files; find recently
used files; view and update file properties; set program options; get help; and exit the program
The New page of the Backstage view provides access to dozens of predesigned templates that you
can use to create diagra. The templates are organized into categories of related diagram types;
the number of templates available in each category varies (see Table 1 for a list of available
template categories). Once a category is selected, all the available templates in that category are
displayed.
Visio 2010 Backstage View
Template Categories in Visio
Category Purpose
Business To show business processes using auditing diagrams, brainstorming diagrams,
cause and effect diagrams, organization charts, etc.
Engineering To create basic electrical diagrams, circuits and logic diagrams, fluid power
diagrams, industrial control systems diagrams, part and assembly drawings,
etc.
Flowchart To create basic flowcharts, cross-functional flowcharts, work flow diagrams,
etc.
General To create basic diagrams and block diagrams.
Maps and To create two-dimensional or three-dimensional directional maps, floor plans,
Floor Plans home plans, office layouts, space plans, etc.
Network To create Active Directory diagrams, basic and detailed network diagrams, rack
diagrams, etc.
Schedule To track project details with calendars, timelines, Gantt charts, and PERT
charts.
Software and To create conceptual diagrams of websites, data flow diagrams, database
Database model diagrams, website maps, etc.
After selecting the desired template and clicking the Create button, Visio creates a new drawing
and opens it in the program window. The Visio 2010 program window is designed to help you
quickly find the tools that you need to complete a task.
Element Description
Title bar Displays the name of the drawing and the program. The Minimize, Restore
Down/Maximize, and Close buttons at the right end of the Title bar are used to
control the program window.
Quick Access Contains frequently used commands that are independent of the tab displayed on
toolbar the Ribbon.
Ribbon Consists of a set of tabs, each of which contains groups of related commands.
The Home tab contains commands that are used most often; the other tabs
contain commands that are used for special purposes.
Shapes pane Contains one or more stencils, each represented by a title bar containing the
name of the stencil. Stencils hold collections of shapes. Click a stencil’s title bar
to see the shapes in that stencil.
Drawing window Displays all or part of the current drawing page. The page controls located at
the bottom of the drawing window can be used to navigate from one page to
another within the drawing.
Status bar Contains tools to help you move more efficiently within and between your
diagrams.
Using Page Setup
The Page Setup dialog box is used to customize printed drawings. It is helpful to customize the
printer paper size and the drawing page before starting the drawing in order to better arrange the
space. The Print Setup and Page Size tabs of the dialog box are explained in detail in the following
sections.
The Print Setup tab provides several settings that you can adjust, such as the printer paper size and
orientation. Gridlines can be chosen to print when measurements are important in the drawing. The
Print zoom section enables you to reduce or enlarge the printed size of the drawing.
You can add a shape to a drawing by simply dragging the desired shape from the Shapes pane onto
the drawing page.
1. Click the File tab on the Ribbon, and then click New in the left pane. Thumbnails of the
recently used templates and template categories display in the center pane.
2. In the Template Categories section, click the General category. Thumbnails of all the
templates in the selected category display in the center pane.
3. In the center pane, click the Basic Diagram template. A description and larger preview
of the selected template appear in the right pane.
Backstage View Displaying Templates in the General Category
4. In the right pane, select the US Units option, and then click the Create button. The
drawing page displays.
5. In the Shapes pane, select the Basic Shapes (US units) stencil, if necessary.
6. Drag the Square shape from the stencil onto the drawing page.
Conclusion
Lab 10
Objective: To learn about selecting, moving, resizing, rotating & deleting Shapes, working with
text, connecting & grouping of shapes.
Selecting Shapes
You can select a shape in a Visio drawing by clicking once on the shape. To select a filled shape,
click inside the shape; to select an unfilled shape, click the border of the shape. When you select a
shape, a blue selection box with handles appears around the shape. You can select multiple shapes by
holding down the Shift key while clicking additional shapes. To select all the shapes on the drawing
page, press the Ctrl+A key combination. When you select multiple shapes, a blue selection box with
handles appears around the shapes and magenta lines appear around the individual shapes.
To move a shape:
1. Drag the Triangle shape to a position approximately one inch above the Square
shape .
2. Hold down the Shift key and drag the Triangle shape horizontally one inch to the left.
3. Press the Down Arrow and Right Arrow keys as necessary to position the Triangle
shape on top of the Square shape.
4. Click in a blank area of the drawing page to deselect the shape.
Resizing Shapes
You can use the selection handles on a selected shape to resize it. Dragging the selection
handles in the center of each edge alter the width or height of the shape. Dragging the selection
handles on the corners adjust the width and height proportionally.
NOTE: The width and height of a selected shape appear on the Status bar at the bottom of the program
window. This information is useful if you need to resize a shape to a specific size.
To resize a shape:
1. Click the Star shape to select it.
2. Drag one of the corner handles until the Star shape is approximately 1/2 inch high by
1/2 inch wide.
3. Click in a blank area of the drawing page to deselect the shape.
Rotating Shapes
You can use the rotation handle on a selected shape to rotate it. When you point to the rotation
handle, the mouse pointer changes to a curved arrow .
NOTE: The rotation angle of a selected shape appears on the Status bar at the bottom of the program window.
This information is useful if you need to rotate several shapes to the same angle.
To rotate a shape:
1. Click the Triangle shape to select it.
2. Drag the rotation handle to the left until a 45 degree angle is reached.
3. Click in a blank area of the drawing page to deselect the shape.
Deleting Shapes
To delete a shape, it must first be selected. Shapes can be deleted one at a time or several at once. If
a shape is selected, the entire shape and any text contained within the shape will be deleted. However,
if only the text within a shape is selected, then only the selected text will be deleted.
To delete a shape:
1. Click the Star shape to select it.
2. Press the Delete key.
Working with Text
Visio allows users to enhance drawings by adding text to shapes as well as in blank areas of a drawing
page. All text in a Visio drawing is contained in a text block.
1. On the Home tab of the Ribbon, in the Tools group, click the Text button .
2. In the upper-right area of the drawing page, drag to create a text block that is
approximately four inches wide by one inch high.
3. Type text & press the Enter key
4. On the Home tab of the Ribbon, in the Tools group, click the Pointer Tool button to
exit text edit mode.
NOTE: If you need to make any changes to the text, double-click the text to enter edit mode,
make the desired changes, and then click in a blank area of the drawing page to deselect the text block.
Connecting Shapes
In Visio, connectors are used to connect shapes to
each other. Connectors can be lines, arcs, arrows,
hubs, cables, etc. These are used to reflect items such
as a path in a process, a relationship between shapes,
or a hierarchy. Connectors can be created using the
Connector tool or Auto Connect.
Connected Shapes
Using the Connector Tool
One of the most flexible ways to add and glue a connector is to draw it by using the Connector tool.
This tool allows you to create a point-to-point or shape-to-shape connection between two shapes.
With a point-to-point connection, the connector stays glued to the same connection points when
either one of the shapes is moved. With a shape-to-shape connection, the connector stays glued to
each shape by moving to the closest available connection points when either one of the shapes is
moved.
To ungroup shapes:
1. In the lower-right area of the drawing page, click to select the shapes to ungroup.
2. On the Home tab of the Ribbon, in the Arrange group, click the Group button , and then click
Ungroup on the menu. Each shapes can now be moved individually.
3. Click in a blank area of the drawing page to deselect the shapes.
Task 1
Draw the following Flowcharts
Conclusion
____________________________________________________________________________________________________
____________________________________________________________________________________________________
Lab 11
Objective:
To understand the Turbo IDE Programming environment
C is a general purpose computer programming language, originally developed by Dennis Ritchie in late 60’s and early 70’s,
in Bell Laboratories. C is a successor of B language which was introduced around 1970.
Visual Studio, Delphi, JBuilder, FrontPage and DreamWeaver are examples of IDEs
Creating a program
Use a editor to write the source code. This file contains a source code which consists of executable code. Save the file
with .c extension only.
--Preprocessing: Using a Preprocessor program to convert C source code in expanded source code. "#includes"
and "#defines" statements will be processed and replaced actually source codes
The next step is to compile the program. The code is compiled by using compiler. i.e. object code. The compiler program
convert C expanded source to assembly source code.
-- Assembly: Using a Assembler program to convert assembly source code to object code.
The object code of a program is linked with libraries that are needed for execution of a program. The linker is used to
link the program with libraries. It creates a file with .exe extension. Multiple units of object codes are linked together.
Execution of program
--Loading: Using a Loader program to load the executable code into CPU for execution.
4. C standard library
A C library is a file containing several object files, that can be used as a single entity in a linking phase of a program.
Normally the library is indexed, so it is easy to find symbols (functions, variables and so on) in them. For this reason, linking
a program whose object files are ordered in libraries is faster than linking a program whose object files are separate on the
disk.
The C standard library consists of a set of sections of the ISO C standard which describe a collection of headers and library
routines used to implement common operations, such as input/output and string handling.
For instance
#include <stdio.h>
#include <conio.h>
Conclusion
Lab 12
Objective:
1. C Preprocessor directives
A Preprocessor is a program that processes the code before it passes through the compiler. The preprocessor directives are
placed in the source program before the main line before the source code passes through the compiler it is examined by
the preprocessor for any preprocessor directives. The preprocessor is executed before the actual compilation of code begins.
Preprocessor directives follow the special syntax rules and begin with the symbol # and do not require any semicolon at the
end.
For example:
2. Header Files
Header file contains C function declarations, variable, subroutines and other identifiers. which can be incorporated into any C
program by using the pre-processor #include statement. It have a .h extension. Header files contain definitions of functions
and variables. There are two types of header files: the files that the programmer writes and the files that come with C
compiler. It also contains function prototypes (declarations) and structure definitions from the standard C stream library.
For example:
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<graphic.h>
#include<string.h>
Program example:
A data type is an amount of storage allocated to variables. The Data type determines the permissible operations on variables. A
program usually contains different types of data types like integer, float, character etc. and need to store the values being
used in the program. The variables should be declared by specifying the data type.
Format Specifiers
These are the operators used in printf() function to print the data which is referred by an object or a variable. The Format
specifier is the sequence passed as the formatting string argument.
Following are the most common used format specifiers.
Escape Sequence
The character combinations, which comprise a backslash (\) followed by some character. They are also called white spaces
because they are not displayed on the screen.
int a, b, c, d; int a;
a = 0; clrscr( );
b = 4; printf("Enter the number");
c = (a++) + b; scanf("%d",&a);
printf ("a = %d, b = %d,c = %d " , a, b, c); d (a%2==0)?printf("even number"):printf("odd number");
= c && b + 3 * a; getch( );
printf ("d = %d", d);
Conclusion
Lab 13
Objective:
.
1. Use of variables.
2. Constants and operators.
3. Gech() ,Getche() ,Getchar( ) .
1. Variables
A variable is a meaningful name of data storage location in computer memory. Or it can be considered as a box that can hold a
single value. When using a variable, refer to memory address of computer.
Naming variables: The name of variable can be called identifier or variable name. The name can contain letters, digits and
the underscore. The length of name can be up to 247 characters long but 31 characters are usually adequate, keywords
cannot be used as a variable name.
Declaration of variables: In order to use a variable first declare it by specifying which data type is it to be. The syntax to
declare a new variable is to write the specifier of the desired data type like int, float followed by a valid variable identifier.
For example: int a; float nfc; int a,b,c;
Initializingofvariables: In declaration of a variable, its value is by default undetermined. To store a concrete value to a variable
is called the initialization of a variable.
Example: int a = 10; fload nfc=1.9; char ch = 'NFCIET';
Double : double is used to define BIG floating point numbers. It reserves twice the storage for the number. On PCs this is likely
to be 8 bytes.
{
double Atoms;
Atoms = 2500000;
}
Format Specifiers
These are the operators used in printf() function to print the data which is referred by an object or a variable. The Format
specifier is the sequence passed as the formatting string argument.
Following are the most common used format specifiers.
Escape Sequence
The character combinations, which comprise a backslash (\) followed by some character. They are also called white spaces
because they are not displayed on the screen.
Program example
#include <stdio.h> #include <stdio.h>
#include <conio.h> #include <conio.h>
main( ) main( )
{ {
int a=5, b=10, c; int a;
c=a+b; a = 10000;
clrscr( ); printf("My salary is %d.", a);
printf("%d",c); getch( );
getch( ); }
}
Constants
A constant is a value of any type that has the same value and can never change. The constants can be any of the basic data
types i.e. they can be int, float or char. Constants are also known as literals i.e. constants and literals are one and the same. The
Character constants are enclosed between single quotes.
Example: 1, 2, 3, 4 OR ’a'
Operators
An operator is a symbol which used to command the computer to do a certain mathematical or logical
manipulations. C language has a rich set of operators which can be classified as
Assignment Operators (+=, -=, *=, /=, %=, >>=, <<=, &=, ^=, |=)
It assigns values from right side operands to left side operand. Like C = A + B will assign value of A + B into
C.
Conditional Operators
The conditional operators takes three arguments. It evaluates an expression returning a value if that expression is true and a
different one if the expression is evaluated as false. It consists of 2 symbols the question mark (?) and the colon (:)
like
condition ? result1 : result2
If the condition is true, result1 is returned else result2 is returned.
Examples:
10==5 ? 11: 12 It will return 12, since 10 not equal to 5
10!=5 ? 4 : 3 It will return 4, since 10 not equal to 5
12>8 ? a : b It will return the value of a, since 12 is greater than 8
Program example:
main(){
main( )
int a = 10, b = 11, c; c
{
= (a < b)? a : b
int i=5,,j=10,larger;
printf(“%d”, c);
larger = i > j ? i : j;
}
printf(“The largest of two numbers is %d \n”, larger);
Bitwise Operators
it is used for the manipulation data at bit level. It operates on each bit of data. These operators are used for testing,
complementing or shifting bits to the right on left and it may not be applied to a float or double.
Now apply the operation by comparing each bit with another bit from most significant bit and obtain the result according
to the operator and convert the result into decimal.
AND =
& 0101
0110
--------------
0100 = 4
Program Example:
main( )
{
int x = 5, y = 6, and, or, xor, shift_left, shift_right;
clrscr();
and = x & y;
or = x | y;
xor = x ^ y; shift_left
= x << 1; shift_right
= y >> 1;
printf("%d AND %d = %d\n", x, y, and);
printf("%d OR %d = %d\n", x, y, or); printf("%d
XOR %d = %d\n", x, y, xor);
printf("Shift Left %d by 1 bit = %d\n", x, shift_left); printf("Shift
Right %d by 1 bit = %d\n", y, shift_right); getch();
}
Getch() It is a function that exist in Conio.h header file. It used to read or take the input character from keyboard without echo or
displaying that character on screen.
Example:
{
printf("Welcome to our class");
getch();
}
Getche() It is same as getch. It used to read or take the input character from keyboard and echo or display that character on
screen. For confirmation execute the following program and press Alt+F5, the displayed character will be available there.
Example:
{
printf("Welcome to our class");
getche();
}
Getchar() It read or take the input character from keyboard and echo or display that character on screen in addition it need to
press Enter key to return.
Example:
{
printf("Welcome to our class");
getchar();
}
Lab Task
1. Initialize two integer variables and add the result into third variable.
2. Write a program using conditional operators, initialize two variable, declare third variable, set the condition in-order
to print the greater number.
Conclusion
Lab 14
Objective:
1 PART A: Familiarization with Matlab screen
2 PART B: A minimal Matlab Session
MATLAB is a high performance language for technical computing. It integrates computation, visualization
and programming in an easy-to-use environment where problems and solutions are expressed in familiar
mathematical notation. It is particularly convenient for modeling, simulation, analysis and design of dynamic
systems.
The purpose of this introductory lab is to give you a quick introduction to Matlab enabling you to use the
software from the very beginning of the Signal & Systems course. To run MATLAB, double-click on the
MATLAB icon. Once the program is loaded you will see the prompt”>>” in the command window. The
command window is the main window in which we communicate with the MATLAB interpreter. Anything
typed after “%” sign is treated as a comment and ignored by MATLAB. First we will familiarize with the
Matlab screen.
Procedure
• Provides the same functionality found in most programming language development environments
- Color codes MATLAB built-in functions (blue color)
- Easy access to cut, paste, print, and debug operations
- Checks balance in MATLAB function syntax
MATLAB Figure Window
• Displays the graphic contents of MATLAB code (either from Command Window, an M-file, or output from
MEX file)
MATLAB Workspace
As you develop and execute models in MATLAB the workspace stores all variables names and definitions
for you. All variables are usually available to you unless the workspace is clear with the ‘>>clear’ command
Getting Started:-
If you don’t know anything about Matlab, then Matlab help is the best way to learn about something. In the
command window of Matlab simply write ‘help’;
>> help
It will display list of all toolboxes included in Matlab. Then by investigating the name of toolbox or the name
of a function, which you would like to learn how to use, use the ‘help’ command:
>> help functionname
This command displays a description of the function and generally also includes a list of related functions. If
you cannot remember the name of the function, use the ‘lookfor’ command and the name of some keyword
associated with the function:
>> lookfor keyword
This command will display a list of functions that include the keyword in their descriptions. MATLAB also
contains a variety of demos that can be with the ‘demo’ command.
Matlab as a calucator
>>1+2*3 >>(1+2)*3
Ans = 7 ans = 9
Order of precedence is from left to right and from inner most parenthesis to outermost
Let x=1;
Y=3*x
Y=3
Complex Numbers:
MATLAB also supports complex numbers. The imaginary number is denoted with the symbol I or j. There
are different methods to declare a complex number which are given below
>> com=4+2i
com=4.0000 + 2.0000i
>> c=complex(1,-2)
c=1.0000-2.0000i
sin sine
cos cosine
tan tangent
asin inverse sine
acos inverse cosine
atan inverse tangent
exp exponential
log natural logarithm
log10 common logarithm
sqrt square root
abs absolute value
sign signum
for further functions see help elfun
help specfun
Before quitting, Save .m files in current work (default) directory of Matlab
To end a session
>>exit or quit
Conclusion
Lab 15
Objective: To become familiar with matrices and arrays and operations that can be performed on them
Apparatus: Personal Computer, MATLAB
Theory:
MATLAB stores variables in the form of matrices which are M ×N, where M is the number of rows and N
the number of columns. A 1 × 1 matrix is a scalar; a 1 × N matrix is a row vector, and M×1 matrix is a
column vector. You can enter matrices into MATLAB in several different ways:
• Enter an explicit list of elements.
%Unit Matrix
The n × n identity matrix is a matrix of zeros except for having ones along its leading diagonal (top left to
bottom right). This is called eye (n) in Matlab
>>a=eye(3)
A=
1 0 0
0 1 0
0 0 1
%Diagonal matrix
A diagonal matrix is similar to the identity matrix except that its diagonal entries are not necessarily equal to
1.
>>d=[1 4 7];
>>D=diag(d)
D=
1 0 0
0 4 0
0 0 7
Generating vectors
Vectors can be generated using the ‘:’ command. For example, to generate a vector x that takes on the values
0 to 10 in increments of 0.5, type the following which generates a 1×21 matrix
>> x = [0:0.5:10];
Other ways to generate vectors include the commands: ‘linspace’ which generates a vector by specifying the
first and last number and the number of equally spaced entries between the first and last number, and
‘logspace’ which is the same except that entries are spaced logarithmically between the first and last entry
Elements of a matrix are accessed by specifying the row and column. For example, in the matrix specified
by A = [1 2 3; 4 5 6; 7 8 9], the element in the first row and third column can be accessed by writing
>> x = A(1,3) which yields 3
The entire second row can be accessed with
>> y = A(2,:) which yields [4 5 6]
where the ‘:’ here means “take all the entries in the column”. A submatrix of A consisting of rows 1 and 2
and all three columns is specified by
>> z = A(1:2,1:3) which yields [1 2 3; 4 5 6]
The basic arithmetic operations on matrices (and of course scalars which are special cases
of matrices) are:
+ addition
- subtraction
* multiplication
/ right division
\ left division
^ exponentiation (power)
’ conjugate transpose
sum(A)
MATLAB replies with
ans =
34 34 34 34
A'
Produces sum of rows
ans =
16 5 9 4
3 10 6 15
2 11 7 14
13 8 12 1
and
sum(A')'
produces a column vector containing the row sums
ans =
34
34
34
34
The sum of the elements on the main diagonal is obtained with the sum and the diag functions:
diag(A)
produces
ans =
16
10
7
1
and
sum(diag(A))
produces
ans =
34
>> inv(B)
Note:A matrix can be inverted if and only if its determinant is nonzero: If you try to compute the inverse for
a matrix with non-zero determinant you will get a warning message:
Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate.
>> det(B);
Arrays
When they are taken away from the world of linear algebra, matrices become two-dimensional numeric
arrays. Arithmetic operations on arrays are done element by element. This means that addition and subtraction
are the same for arrays and matrices, but that multiplicative operations are different. MATLAB uses a dot, or
decimal point, as part of the notation for multiplicative array operations.
The difference between matrix multiplication and element-by-element multiplication is
seen in the following example
>>A = [1 2; 3 4]
A=
12
34
>>B=A*A
B=
7 10
15 22
>>C=A.*A
C=
14
9 16
Conclusion:
Lab 16
Objective:
1. PART A: Dealing with Polynomials & Partial Fraction Expansion
2. PART B: Plotting in Matlab
3. PART C: Solving ordinary differential equations (ODE) symbolically
Apparatus: Personal Computer, MATLAB
Theory:
MATLAB provides a full programming language that enables you to write a series of MATLAB statements
into a file and then executing them into a single document. Polynomials are used for the analysis of transfer
function because in case of transfer function we want to see output and input in the form of polynomial. So
it is important to study the polynomials in MATLAB. When trying to find the inverse Laplace transform (or
Z transform) it is helpful to be able to break a complicated ratio of two polynomials into forms that are on
the Laplace transform or Z transform table. We will illustrate here using Laplace transforms. This can be
done using the method of Partial fraction expansion (PFE) which is the reverse of finding a common
denominator and combining fractions. It is possible to do PFE by hand also. We will illustrate hand
computation only for the simplest case when there are no repeated roots and the order of the numerator
polynomial is strictly less than the order of denominator polynomial.
The primary tool we will use for plotting in MATLAB is plot().The MATLAB environment provides a wide
variety of techniques to display data graphically. The type of graph you choose to create depends on the
nature of your data and what you want to reveal about the data. You can choose from many predefined graph
types, such as line, bar, histogram, and pie graphs as well as 3-D graphs, such as surfaces, slice planes, and
streamlines. After you create a graph, you can extract specific information about the data. You can also edit
graph components as well as annotate graphs. Annotations are the text, arrows, callouts, and other labels
added to graphs to help viewers see what is important about the data .lastly you can print your graph on any
printer connected to your computer.
Though MATLAB is primarily a numeric package, it can certainly solve straightforward differential
equations symbolically as well using Math symbolic toolbox as demonstrated in this lab.
Procedure:
PART A: Dealing with Polynomials
Polynomials
Polynomials arise frequently in systems theory. MATLAB represents polynomials as row vectors of
polynomial coefficients. For example, the polynomial s2 +4s−5 is represented in MATLAB by the
polynomial >> p = [1 4 -5]. The following is a list of the more important commands for manipulating
polynomials.
roots(p) Express the roots of polynomial p as a column vector
polyval(p,x) Evaluate the polynomial p at the values contained in the vector x
conv(p1,p2) Computer the product of the polynomials p1 and p2
deconv(p1,p2) Compute the quotient of p1 divided by p2
poly2str(p,’s’) Display the polynomial as an equation in s
Declaring a Polynomial:
[R,P,K] = RESIDUE(B,A) finds the residues, poles and direct term of a partial fraction expansion of the ratio
of two polynomials B(s)/A(s).
[B,A] = RESIDUE(R,P,K), with 3 input arguments and 2 output arguments, converts the partial fraction
expansion back to the polynomials with coefficients in B and A.
Example :% given a ratio of polynomials G(s) = (3s + 7)/(s^3 + 6s^2 + 11s + 6),determine the corresponding
PFE
% this is done by first defining the numerator and denominator polynomials
>> num1=[3 7];
>> den1=[1 6 11 6];
>> [r ,p, k]=residue(num1,den1) % r is the vector of PFE coefficients is the vector of roots of den1 and k=0
if the degree of num1 < degree of den1
r=
-1.0000
-1.0000
2.0000
p=
-3.0000
-2.0000
-1.0000
k=
[]
The primary tool we will use for plotting in MATLAB is plot().The MATLAB environment provides a wide
variety of techniques to display data graphically. The type of graph you choose to create depends on the
nature of your data and what you want to reveal about the data. You can choose from many predefined graph
types, such as line, stairs, stem, bar, histogram, and pie graphs as well as 3-D graphs, such as surfaces, slice
planes, and streamlines. After you create a graph, you can extract specific information about the data. You
can also edit graph components as well as annotate graphs. Annotations are the text, arrows, callouts, and
other labels added to graphs to help viewers see what is important about the data .lastly you can print your
graph on any printer connected to your computer. Annotations can be added from the Insert menu like labels,
titles, legend, line, arrows, text arrow, double arrow, text box, rectangle, ellipse, axes, light etc.
Customization of plots
There are many commands used to customize plots by annotations, titles, axes labels, etc.
A few of the most frequently used commands are
xlabel Labels x-axis
ylabel Labels y-axis
title Puts a title on the plot
grid Adds a grid to the plot
gtext Allows positioning of text with the mouse
text Allows placing text at specified coordinates of the plot
axis Allows changing the x and y axes
figure Create a figure for plotting
figure(n) Make figure number n the current figure
hold on Allows multiple plots to be superimposed on the same axes
hold off Release hold on current plot
close(n) Close figure number n
subplot(a,b,c) Create an a × b matrix of plots with c the current figure
orient Specify orientation of a figure
Procedure:
Grids:-
p pentagram
h hexagram
For example, plot (X,Y, ‘g:’) plots a green dotted line and plot(X,Y,’rd’) plots red diamond at each data point.
You may also edit colors and line styles directly from the menus which appear at the top of the figure
windowThe default is to plot solid lines. A solid white line is produced by
>> plot (x, y, ’w-’)
The third argument is a string whose first character specifies the colour (optional) and the second the line
style.
Multi–plots:-
Subplot:-
The graphics window may be split into an m × n array of smaller windows into which we may plot one or
more graphs. The windows are counted 1 to mn row–wise, starting from the top left. Both hold and grid work
on the current subplot.
>> subplot (221), plot (x,y)
>> xlabel (’x’), ylabel (’sin 3 pi x’)
>> subplot (222), plot (x, cos (3*pi*x))
>> xlabel (’x’), ylabel (’cos 3 pi x’)
>> subplot (223), plot (x, sin (6*pi*x))
>> xlabel (’x’), ylabel (’sin 6 pi x’)
>> subplot (224), plot (x, cos (6*pi*x))
>> xlabel (’x’), ylabel (’cos 6 pi x’)
subplot(221) (or subplot(2,2,1)) specifies that the window should be split into a 2 × 2 array and we select
the first subwindow.
Controlling Axes:-
If it is desired to plot a curve in a region specified by r = [x-min x-max y-min y-max]. Enter the command
axis(r). This command sets the scaling to the prescribed limits. Find-out more about the command “axis” by
typing:
help axis
If you wish to plot cos(t) of exercise 5 from time 0 to 10 seconds, and if you wish that the y-axis should be
from –2 to 2, then enter the following command:
axis([0 10 -2 2])Once a plot has been created in the graphics window you may wish to change the range of
x and y values shown on the picture
Property Editor
Examples in Plotting
Example: Draw graphs of the functions
i. y = sin(x)/x
ii. u= (1/(x-1)2)+x
iii. v= (x2+1)/(x2-4)
iv. ((10-x)1/3-1)/(4 - x2)1/2
PART C: Solving ordinary differential equations (ODE) symbolically
Matlab has a command dsolve that solves ordinary differential equations (ODEs) symbolically.One form of
the dsolve command is
dsolve(‘ODE’,’initial conditions’)
In the ODE string,D is used to represent the first derivative and Dn represents the nth derivative.
Example
To solve the differential equation y’(t) = ay(t) subject to the initial conditions y(0)=c and assign the solution
to y,one give the commands
>> syms a c
>> y=dsolve('Dy=a*y','y(0)=c')
y=
c*exp(a*t)
Conclusion: