03 - Lab Manual
03 - Lab Manual
MANUAL
Course: CSC101-Introduction To ICT
Learning Procedure
1) Stage J (Journey inside-out the concept)
2) Stage a1 (Apply the learned)
3) Stage v (Verify the accuracy)
4) Stage a2 (Assess your work)
Lab Sessional 1
Lab # 10 String 68
Lab Sessional 2
Lab # 11 Loop 76
Lab # 12 Functions 84
Lab # 13 Functions 90
Lab # 14 Lists 93
Lab # 15 Tuples 93
Terminal Examination
Statement Purpose:
This lab wil provide a hands-on experience of Microsoft Word. Some basic features and functions of MS Word, which are mostly used
while creating text documents, shall be taught and practiced.
Activity Outcomes:
The lab wil teach students to prepare different text documents by:
• Using different font styles, listing, and line and paragraph styles
• Creating and formatting tables
Instructor Note:
As a pre-lab activity, read Chapters1B and 10 from the book (Introduction to Computers by Peter Norton, 6th edition (2013), McGraw
Hil ) to gain an insight about computer software generally and text processing software, especially.
Introduction
In computing, the term text processing refers to the discipline of mechanizing the creation or manipulation of electronic text. Text usually refers to
all the alphanumeric characters specified on the keyboard of the person performing the mechanization. Text processing involves computer commands
which invoke content, content changes, and cursor movement, for example to search and replace, format, generate a processed report of the
content, or filter a file or report of a text file.
Microsoft Word is word processing software that is used to manipulate a text document, such as a resume or a report. Text is typically entered by
typing and the software provides tools for copying, deleting and various types of formatting. Some of the functions of MS Word include creating,
editing, saving and printing documents, copying, pasting, moving and deleting text wit hin documents, formatting text such as font type and style,
creating and editing tables, inserting elements from other software, such as illustrations or paragraphs and, correcting spelling and grammar.
2) Stage a1 (apply)
Lab Activities:
Activity 1:
Create a new word document, save it on your Desktop and close it.
Solution:
1. Start MS Word.
2. The screen will display an empty document (New Word file).
3. Type the following paragraph.
4. To save the file, click on Save button on the top left corner of the screen. You can also use the shortcut keys (Ctrl + S) to save the file. The
Save button can also be reached by going to File tab on the top left corner.
7. Left click on the Save button at the right bottom of the dialog box. Your file is now saved on Desktop.
8. Close the file by going to File tab and clicking on Close option .
Activity 2:
Open the file you created in Activity 1. Change the font face and size.
Solution:
1. Click on File tab . Select Open . The Open dialog box wil appear.
2. Set the location of the file you want to open. In this case, your file is located on Desktop. Set Desktop as location
from the left pane of dialog box. The location bar wil now be set to Desktop
.
3. Select the file MyDoc from the right pane of the dialog box. The file name wil appear in File
Name drop-down box .
4. Right click on Open . The file will now be displayed on the screen.
5. Change the original text to following format.
6. To make the above changes, first select C of ‘Consider’ using your mouse. Change its font size to 18 or larger by selecting the size
from Font Size option . You can either select the small arrow or type in the desired font size in the box.
7. Font size can be incremented or decremented by using Grow Font (Ctrl+>)
and Shrink Font (Ctrl + <) options respectively. You can see shortcut keys for different
options by moving cursor over that option.
8. Select “Computers are everywhere” using your mouse. Change the font face to Algerian by selecting it from the
font face box . You can either use the small arrow or type in font name in the box. Font face wil now
be selected to Algerian .
9. Save the changes by pressing Ctrl+Sor .
Solution:
1. Select ‘Consider’. From the toolbar/ribbon, click on small arrow besides change case option . A list of options wil appear.
Select toggle case . This wil
change all lower case letters to upper case and vice versa.
2. Select ‘Does it sound like an overstatement or a cliché?’ Click small arrow again to display different
case options. Select . This wil
change the first letters of all words of this sentence to uppercase.
3. Select ‘are’ in the sentence ‘Computers are everywhere.’ Again, click the small arrow and choose option .
This wil capitalize all letters of the selected text.
4. Check remaining options and see the difference.
5. Save the document using or Ctrl+S.
Activity 4:
Use Bold, italics, underline, strike through, superscript and subscript options, and other Font options and make following changes.
Solution:
1. Using your mouse, select “Computers are everywhere.” Choose underline option from the font toolbar.
You can change dif erent line styles by clicking on the small arrow beside this option . You can alternatively press Ctrl+U for the same.
Activity 5:
Using dif erent paragraph options, write the given paragraph.
Consider this sentence: “computers are everywhere.” Does it sound
like
a. an overstatement or
b. a cliché?
Solution:
1. Create a new MS Word document. Write the given paragraph as you did in activity 1. Make it bold (Ctrl+B or select ).
2. Place your cursor after ‘like’ in line # 2. Press Enter from keyboard. Now position the cursor after ‘or’ and press Enter.
Place the cursor after ‘?’ and press Enter. Select the following lines.
3. Select down arrow of Numbering option from Paragraph toolbar. You wil see dif erent numbering styles/formats.
Choose the following format.
4. Again select the same text. From the paragraph toolbar, click on the down arrow of line and paragraph spacing . You wil see
different spacing options. Select
1.5. Try using other options too and note the difference.
5. Repeat step 2 for ‘your family car, your home appliances, and even your alarm clock!’ to have them in
new lines (as shown below). Select the text.
6. Choose Bullets option from the toolbar. You can change the style of bullets by selecting the down arrow.
Re-select the text and change the line and paragraph spacing to 2.5 (as was done in step 4).
Activity 6:
Type-in the following text in either a new word document or an existing one, using different paragraph options.
1. Main item # 1.
2. Main item # 2.
3. Main item # 3.
Solution:
1. Write ‘1. Main item # 1’. Don’t forget to add single space after ‘1.’ by using the spacebar on the keyboard. Press Enter
from the keyboard. You wil see that numbering automatically starts. You can start numbering in any format, e.g. 1.1./a./ A) etc.
2. Add the remaining Main items, i.e. Main item # 2 and Main item # 3 using the same procedure as of Step 1.
3. Once you are done with all the Main items, start with sub-items. Place the cursor after ‘Main item # 1’ and press Enter. A
new item # 2 wil appear. Use backspace key of the keyboard and delete the number 2. Now type ‘1.1. Sub-item
1.1.’ Don’t forget to add a space after ‘1.1.’
4. Press Enter. A new numbered item 1.2. wil appear on the document. Write ‘Sub- item 1.2.’ after it.
5. Place the cursor after ‘1.1. Sub-item 1.1.’ Press Enter. Delete 1.2. by using the backspace key from the keyboard. Write
‘1.1.1.’ and press spacebar once. This wil add another level of numbering. Write ‘Sub-sub-item 1.1.1.’ in front
of 1.1.1.
6. Press enter and repeat step 4 for 1.1.2. item.
Activity 7:
Insert different pages in a Word document such as Cover page or a blank page. Cover page is the first page of any document that displays the
title, date, author name, organization name, etc. Blank page is a new empty page that is added at the cursor position.
Solution:
1. Open MyDoc that was created in activity 1.
2. Select the Insert tab from the toolbar.
3. You wil see different page options in the Page ribbon. Select Cover Page option
. The down arrow wil display dif erent styles of cover pages. Select any format of your choice. A new cover page is now added
to the start of your document.
5. The cursor is at cover page. Now add a blank page by selecting from the ribbon. A new page will be inserted after
cover page.
6. Save the document.
Activity 8:
Insert following tables in the document. Table 1 should be inserted by selecting the matrix from the option and Table 2 should be created by
entering the number of rows and columns in the Insert Table dialog box.
Table 1
Table 2
Introduction To Information And Communication
Technologies
Solution:
1. Open an existing document or create a new one.
2. From the Insert tab , select the Table option by clicking on its down arrow. You wil see
matrix in the form of rows and columns. Roll your mouse over this matrix and different numbers of rows and columns
wil be highlighted. Select a matrix of size 3x4.
3. A table with fixed cell size wil be inserted in the document where the cursor is located.
4. Type in Table 1 in first cell of the table.
5. Write Table2 just below the table and press Enter.
6. Re-select Table option by clicking its down arrow. Select the option Insert table at the bottom. Insert
Table dialog box wil appear as given below.
3) Stage v (verify)
Home Activities:
Activity 1:
You are required to create your personal letterhead. It must include:
• Your name – use Word Art
• Your address
• Your phone number
• Your email
• Your website URL
• Graphics that pertain to you
The placement/location of the items is up to you. Letterheads must extend no more than 2 inches from the top of the page. Display the ruler bar and
adjust the vertical ruler to the top of the page. Save as “letterhead your name”.
Activity 2:
Open the letterhead you created in activity 1. Resave (Save As) and name it “WPexer2 your name.” Type the letter below using the following
instructions:
• Center the words “(your name) Corporation”
• Insert the date (do not type it in).
• Mr. Richardson’s name and address are single spaced.
• Underline the words “confirmation” and “9 p.m.”
This letter is a confirmation of your request for a ticket to the Annual Fireman’s Ball. Our corporation is happy to provide the ticket to you at no
cost.
As you will note from the tickets, the Ball is being held November 25th at the Norseman Inn and wil begin promptly at 9 p.m. The famous band,
Cappy’s Capers, wil provide an entertaining evening of dancing and comedy.
Thank you for allowing our company to be of service to you. Warmest regards,
(Your name)
Activity 3:
Tabs can be left, or right aligned, centered or decimal tabs. All tabs can have dot leaders.
1. Type the exercise below down through (to and including) the first paragraph.
2. After you have typed the first paragraph, delete all tabs.
(On the Home tab or the Page Layout tab, click the Paragraph dialog box launcher. In the Paragraph dialog box,
click Tabs, click Clear all)
3. Before you start typing the line “Store # 1…, set the following tabs Left tab 0.5” Centered tab 2”
Right tab 3.5” dot leader decimal tab 5.5”
4. Type the columns of information on the stores.
5. Save your document as “WPtabsA your name”
Tom, the following monthly sales figures seem to indicate that the new item we are
offering for sale is taking the market by storm. I would suggest that we continue to
advertise as originally planned.
Activity 4:
Create a blank invoice table as shown below.
• Use your own name
• Use your own graphics and type of business
• Shade the cells as shown
• Save as “Invoice Table your name”
Assignment:
Deadline: at the start of next lab
Write a paragraph about yourself. Include information about where you’re from, where you went to school, and anything else you feel is
appropriate. The format of the paragraph should be left justified, single spaced with Times New Roman 12 pt font (no underline, bold or italics).
The paragraph must contain at least 100 words
Statement Purpose:
This lab wil learn more features of Microsoft Word. Some basic features and functions of MS Word, which are mostly used while
creating text documents, shall be taught and practiced.
Activity Outcomes:
The lab wil teach students to prepare different text documents by:
Instructor Note:
As a pre-lab activity, read Chapters1B and 10 from the book (Introduction to Computers by Peter Norton, 6th edition (2013),
McGraw Hil ) to gain an insight about computer software,generally, and text processing software, especially.
Introduction
Word processing programs provides tools for creating all kinds of text based documents. Word processors are not limited to working with text; they
enable you to add images to your documents and design documents. Using word processors, you can create long documents with separate
chapters, table of contents, index and other features. You can also print your documents in customized styles.
2) Stage a1 (apply)
Lab Activities:
Activity 1:
Insert a picture to the document. Apply dif erent options to it.
Solution:
1. Open an existing Word document or create a new.
2. Place the cursor on a location on the page where the picture should be inserted.
In the Insert tab , select Picture from the Illustrations ribbon. An Insert Picture dialog box wil open.
3. Go to the location where the picture is saved in the computer. Select the picture from the right window and select Insert button
. You can also click on the down arrow on the button to see different insert options.
4. The selected picture wil be inserted to the document where the cursor was located.
tab. Use the crop feature to crop the picture. Also rotate your picture 90 degrees anticlockwise using either Rotate option
in the toolbar or rotating the green circle over the picture using the mouse.
11. Save the document.
Activity 2:
Insert drawing canvas and draw the given diagram using dif erent shapes. Group the different shapes used to make one.
Hello
Solution:
1. Open an existing word document or make a new file.
2. Place the cursor on a location on the page where you want to insert canvas.
3. From the Insert tab , select Shapes option by clicking its down- arrow. A list of dif erent shapes will
appear.
4. Select Rectangle under Basic Shapes group . Now draw this rectangle, of any size, on the page
using mouse.
5. Now select an arrow from Lines group and draw a line from the lower mid of the rectangle
downwards.
6. Now select a circle from Basic Shapes group and draw it just below the arrow.
8. Right click on the drawn rectangle and select Add Text feature . Now write Hello inside Rectangle. You can format text
(change color, style, size etc.), as done in previous activities.
9. To group all the shapes, click on rectangle first. It is now selected. While keep pressing Ctrl key on your keyboard, move cursor on
arrow. An arrow with a plus sign wil appear. Select the arrow too. Remember to keep pressing Ctrl key. Now move cursor
near the circle. Select it when you see an arrow with a plus. Now all the shapes you have drawn on the canvas have been
selected. Relieve the Ctrl key.
10. Move mouse over the diagram and see when you get cross arrow . Right click and
choose Grouping and then Group
.All the shapes have now been grouped together to make a diagram. You can now drag/rotate the diagram as a whole.
11. Save the document.
Activity 3:
Insert a header, footer, page numbers and a math’s equation ( ) in a Word file.
Solution:
1. Open an already existing file.
2. Go to Insert tab. Click on the down-arrow of Header option in Header & Footer section. A list of header options wil
appear. Select a header of your choice and you wil header on every page of your document.
3. The header can be edited and formatted by using different options in Header & Footer Tools . When you are finished, choose
close header
and footer .
footer option in the Insert tab. A list of footer styles wil appear. Select one.
5. Design the footer by using different features of Header & Footer Tools. Once designed, close the header and footer.
6. For inserting page numbers, go to Insert tab and select down arrow on Page
the down arrow of Equation option . There are many built-in equations.
9. Select Area of Circle and that equation wil be inserted into the document. You can edit the equation as
well by overwriting with your own variables.
10. When the equation is selected, Equation Tools wil appear on top of the window. This wil let you
format the selected equation by applying dif erent options, such as using dif erent symbols and structures (fraction, script, radical, integral, large
operator, bracket, function, limit and log, matrix, etc.).
11. Save the document and exit.
Activity 4:
Design the layout of document pages. Apply different themes, setup page, and page background.
Solution:
1. Open an existing Word document or make a new Word file.
4. In the page layout tab, you wil find Page Setup section that wil enable you to setup page margins , change page
orientation (portrait or landscape)
, page size , and page columns that wil split the text into two or more columns. Try applying
these options.
5. In the same ribbon, you can number every line of your document by using Line Numbers option .
6. In the same Page Layout tab, there are various options for designing the background of pages. Watermark option
wil insert ghosted text behind the content of the page. You can change the color of the page by utilizing
the Page Color option . Borders can be inserted too by using the Page Border option .
7. Apply these features and save the document.
Activity 5:
Write a paragraph and create four copies of the paragraph by copying the text. Insert a page break before each paragraph so that the first page is blank.
Insert a line before
each paragraph and type a heading line such as “Paragraph 1”, “Paragraph 2”, etc. Set the style of each heading line to be Heading 1.
Solution:
1. Left-click three times to highlight the entire paragraph.
2. Write click the selected paragraph and select Copy (or Ctrl-C) followed by Paste (or Ctrl-V) to create copies of a paragraph.
*****************
4. Left-click three times to highlight the heading line.
5. Select “Heading 1” from the main toolbar of Styles on the home tab.
6. Repeat step 4 & 5 for all paragraphs.
7. Create individual styles for each of the five paragraphs. You are not printing this file, so be creative with colors, animations, etc.
Activity 6:
Create, update and remove table of contents.
Solution:
1. On the References tab, in the Table of Contents group, click Table of Contents, and then click Insert Table of Contents.
1. If you added or removed headings or other table of contents entries in your document, you can quickly update the table of
contents.
2. On the References tab, in the Table of Contents group, click Update Table.
Activity 7:
Insert references.
Solution:
1. Click References tab
2. Click Manage Sources on the Citations & Bibliography menu
3. Either Copy sources from the Master List to the Current List or create New sources that will automatically be added to both the
Master and Current List
4. Sources in the Current List wil be shown in the dropdown Insert Citation list make your selection.
5. Enter information for each source.
6. Once all your sources are entered, close the window.
7. Select Style on the Citations & Bibliography menu and choose the appropriate style (typically APA but differs with professor; for Swasy,
choose Chicago)
8. Click the Bibliography dropdown list and select Insert Bibliography
9. The bibliography wil appear in your Word doc.
10. Edit accordingly (most bibliographies are double spaced)
Activity 8:
Cite references
3) Stage v (verify)
Home Activities:
Activity 1:
Draw the figure given below. Use different shapes and group them.
Activity 2:
A flyer is a pamphlet, which is a form of paper advertisement intended for wide distribution in a public place, handed out to individuals or
sent through the mail.
Consider you work at a company. Your boss has asked you to prepare a flyer that advertises company’s major products and/or services.
Assignment:
Deadline: at the start of next lab
Statement Purpose:
This lab wil provide a hands-on experience of Microsoft PowerPoint. It is a software package used to display information in the
form of a slide show. A slide show is a presentation of a series of still images on a projection screen or electronic display device, typically in a
prearranged sequence. Some basic features and functions of MS PowerPoint, which are mostly used for creating slideshow presentations, shall be taught
and practiced.
Activity Outcomes:
The lab wil teach students to prepare different presentations by:
• Using different slide layouts and inserting multiple slides in a slide show
• Inserting text and drawing, just as you have been taught in Lab 01
• Creating and formatting tables
• Inserting pictures, headers/footers, word art, etc.
• Drawing various diagrams, using built-in shapes
• Using different design options, such as slide orientation, themes, etc.
• Adding Transitions to slides and setting style and timing of each transition
• Adding Animation to the slides
Instructor Note:
As a pre-lab activity, read Chapters1B and 10 from the book (Introduction to Computers by Peter Norton, 6th edition (2013), McGraw Hill) to
gain an insight about computer software.
Introduction
PowerPoint presentations consist of a number of individual pages or "slides". The "slide" analogy is a reference to the slide projector. Slides
may contain text, graphics, sound, movies, and other objects, which may be arranged freely. The presentation can be printed, displayed live on a
computer, or navigated through at the command of the presenter. For larger audiences the computer display is often a video projector. Slides can
also form the basis of webcasts.
• Entrance, emphasis, and exit of elements on a slide itself are controlled by what PowerPoint calls Custom Animations.
• Transitions, on the other hand, are movements between slides. These can be animated in a variety of ways.
• Custom animation can be used to create small story boards by animating pictures to enter, exit or move.
2) Stage a1 (apply)
Lab Activities:
Activity 1:
Start MS PowerPoint.
Solution:
1. Click the Start button
2. Click on Microsoft Office PowerPoint on the Programs menu. If you don’t see it there, go to Microsoft Office group first.
3. Once you run the program, you wil get a new window on the right side of the screen with several sections. Each section has
different options.
The main part of the screen is divided into two sections. The main section shows the current slide, while on the left, slide miniatures appear,
allowing you to see the current slide in its context.
At the very bottom of the window, is the Status Bar. This shows various information,
e.g. which slide you are currently looking at (here you are on slide 1) and the language you’re working in. On the right-hand side
of the Status Bar are icons to change the view of the slides and to zoom in or out.
Activity 2:
Use Design themes.
Solution:
If you are creating a new presentation:
You could use a template dif erent from the ones given to you by default. We go to the website http://office.microsoft.com/en-us/templates/ and
search for the Template
1. In the Design section, left click on the bottom arrow on the right of the Themes
. Select “Browse for Themes”, and look in the folder where you placed the Fireworks
template. Select it
2. You can search for a different theme, also known as template on the same website, to use it for your slides.
Activity 3:
View the PowerPoint window.
Solution:
When you open a presentation or create a new one you wil see four main areas on the screen:
1. Slides /Outline Tab: it is located on the left hand side of the screen.
• It wil display your presentation text in the form of an outline, without the graphics.
• It is easy to move text on or among slides by dragging text to reorder the information
b. If you click the Slides tab:
• It will display the slides of your presentation as small images, called thumbnails.
• You can quickly navigate through the slides in your presentation using this tab.
• You can also add, delete, or rearrange slides on this tab.
At the bottom right corner, there is a set of buttons , collectively called View buttons. These buttons allow you to quickly
switch between PowerPoint views. They are (from left to right):
• Normal View button: it displays the standard size for the Outline, Slide and Notes panes.
• Slide Sorter View button: it displays a smaller version of all your slides. If you havemore slides that what you actually see on
the screen, you can scroll down to see the rest. You see neither the Outline nor the Notes panes.
• Slide Show button: it starts your presentation. You wil see your slides one by one, withslide transitions, special effects, video,
and audio clips if you included any of them.
Activity 4:
Save the presentation.
Solution:
11. Go to the File menu and click Save As. Select a “PowerPoint Presentation”
12. In the File name textbox, type the name that you want to give to your presentation.
13. Click on the Save in list arrow and select the storage device where you want to save your presentation.
14. In the Save as type the extension pptx wil appear. Click on the Save button.
NOTE: If you want to save an existing presentation you wil use SAVE, unless you want to save it under a dif erent name. Then you wil use
the SAVE AS option.
Activity 5:
Close presentation and exit the program.
Solution:
7. Click on the File menu and select the Close option.
8. Click Yes, if necessary (if you want to save your work)
Activity 6:
Enter slide text on a slide.
Solution:
7. When you have a new slide, you wil see something like “Click to add title” or “Click to add text”. Move the
mouse pointer to that area.
8. Click on that area. The insertion point, a blinking vertical line, indicates where your text wil appear in the title or text placeholder.
9. When you finish typing, click outside the area.
10. Or you can go to the Insert Menu, and select Text Box. Place the cursor where you want to insert the text, and make your
box.
Activity 7:
Create a new slide.
Solution:
1. Click the New Slide button on the Home menu. Choose the Layout of your slide among the different layout schemes that
appear when you click on Layout.
2. Each layout wil display the layout’s name (E.g. Title and Content).
3. Click on the desired layout. For example: Title and Content, and select Clip Art.
Solution:
1. Whenever you see the slide icon in the Outline pane, it means that whatever text you see or type next to it represents the slide’s title.
2. On the Paragraph section of the main menu, you wil find among all the buttons, theIncrease Indent and Decrease Indent
a. Games
i.WarCraft II
i. Diablo II
i i. System Shock
b. Increase Indent: If it is enabled, you can move an item down the hierarchy. Forexample if you have
the following:
1. Hardware
2. Software
3. Application Software
4. System Software
If you select items 3 and 4 and click the Increase Indent button, the outline would look like this:
1. Hardware
2. Software
a. Application Software
b. System Software
Activity 9:
Enter Notes for slides.
Activity 10:
View your presentation.
Solution:
There are three view choices in PowerPoint: Normal, Slide Sorter, and Slide Show View. You can access these views
under the View Menu at top or by clicking on the
1. NormalView: This is the main work window. In this view you can easily edit your slide, create a background
color, insert a picture, format a picture, insert text and/or format text.
2. Slide Sorter View: This view shows thumbnails of every slide in your presentation, like a light table. You
can move slides around (click once and highlight, then drag), delete slides and choose where to add new slides.
3. Slide Show View:In the Slide Show tab, you can see different options for viewing the slides e.g. you can view presentation
from the start or from the current slide .You can view your slides just as they wil appear during a
presentation. To view the whole show from the beginning, you can also use Slide Show View show from the top toolbar. If you
select this (instead of the toolbar icon), you wil see a small triangular tool in the lower left. Click on this and it wil give you other options. One
nice option is Pointer Options. This allows you to use a pen or pointer tool as you show your presentation.
Activity 11:
Add a background to your slide.
Solution:
12. From the Design menu on top toolbar click Background.
13. In the Format Background dialogue box click on the pull down color menu to see your color options.
14. Black is recommended for the background. Choose a color or click on More Colors. If you want to apply this color to the
background of ALL YOUR SLIDES click Apply to all.
Solution:
8. Go to View tab.
9. Check box for gridlines.
10. Click the Insert tab, click Picture.
11. Browse to find picture and select it.
In the “Adjust” box you can choose to make changes to your images such as brightness, contrast and color.This is also where the
“Compress” function is found. Use Compress to reduce the size and resolution of an image and of your presentation. For details,
click the help icon and search “Reduce file size of a picture”.
Cropping reduces the picture by removing part of the image at an edge. You can crop by clicking crop on the Picture Tools
Ribbon and using the Crop handles that appear. You can also crop to a specific size or rotate the picture by clicking the arrow at the lower
right corner of the size box on the ribbon to get the size dialog box.
Solution:
1. Select Insert tab and click Text Box.
2. Click where you want your text box and the box wil appear. Grab a corner to resize the box. You can resize and move the box after
you have added your text.
3. Highlight the text. On the Home Tab, Select font and size and color. Other options are also found here. When your text box is active, you can
click on the Drawing Tools Tab for more options.
Activity 14:
Add a hyperlink.
Solution:
A Hyperlink allows you to connect to another slide, a web page or a file.
1. Select the text or object that you want to use as a hyperlink.
2. On the insert tab, select Hyperlink.
3. In the hyperlink dialog box you can click theBrowse the Web .icon or just fil in the url in the address box. It is wise to copy
and paste long urls to avoid typos. Always test your hyperlinks in your presentation.
Solution:
This allows you to take a whole folder of images and bring them all in at the same time, correctly sized.
1. Go to the Insert tab, and select Photo Album.
2. Select “File/ Disk” button and locate the file folder which you want to import. Open the folder and select all the items (click on them
using mouse and the shift key). Now click on the Insert button. Select (highlight) images and click “Insert” button. You should now
see the dialog box.
3. Make sure “Fit to slide” is selected in the Picture layout box, and click on the
Create button. You wil now have one slide for each image file, sized to the slide.
4. To change all the backgrounds to black, simply follow the steps outlined above for Add a Background (color) to Your Slide
and “Apply to all”.
Now create following four slides (starting from left to right, then downwards) in the same way, choosing the correct layout as you proceed.
in the Insert tab to choose a pie chart. The original date in the pie chart was changed through the table that appears, and
the Quick Layout button on the Chart Tools Design tab was used to get percentages.
5. On slide 6, a Tile and Content layout is used. An organization chart is produced.
Activity 17:
Use guides, gridlines and rulers again.
Solution:
When creating your slides, the placeholders have largely been left in their default positions. Often, people move them around slightly, usually to cram extra
information onto a slide. This isn’t good practice – not only do you end up with too much on a slide but the consistency of layout is lost. If you do need
to do this then it’s better to do so on the Master Slide (see later) but it also helps if you display the Rulers and Guides. To do this:
1. Right click on a slide and choose Ruler – a ruler appears at the top and left
2. Right click again and this time choose Grid and Guide - the following dialog box appears:
3. Turn on Display grid on screen and Display drawing guides on screen – press
<Enter> for [OK]
The guides are the lines which split the slide exactly into quarters, while the default grid is shown by dotted lines 2cm square. Each dot represents 0.4cm.
Objects are lined up with the grid; to see this:
4. Click on the Title placeholder (Training on Microsoft Office) on slide 6 then press
<Esc>
5. Use the arrow keys to move the placeholder slightly. Note: If you have Snap objects to grid turned on, each key press moves it
0.2cm (a grid setting) exactly
6. Move the placeholder back to its original position – or use <Ctrl+z> to [Undo] the changes
7. To hide the grid, repeat step 2 then turn off Display grid on screen – press
<Enter> for [OK]
Solution:
It's easiest to delete slides in Slide Sorter view (though you can also do so in Normal view), especially if you have a lot of slides to deal with:
1. Click on the [SlideSorter] button (either on the Status Bar or VIEW tab)
2. Click on the slide to be deleted (e.g. slide 4, Training Topics) then press the
<Delete> key
3. To reinstate the deleted slide (you were just practising), press <Ctrl z> for [Undo]
You might want to temporarily hide a slide – for example, if you are giving the presentation to a dif erent group of people for whom
that slide is not appropriate. You could also have extra hidden slides which you could add in if you had plenty of time or if someone asked a particular
question during the show. When a slide is hidden it remains within the PowerPoint file, but is not displayed during the presentation. To hide a slide:
4. Right click on the slide to be hidden (in Normal View you have to right click on the slide miniature)
5. From the shortcut menu choose Hide Slide - you’ll find that the number underneath the slide now has a line through it
indicating that it’s hidden
6. To show the slide again, just repeat steps 4 and 5
Tip: To display a hidden slide when running a show, press the <h> key on the keyboard or type in the slide number and press <Enter>.
Activity 19:
Instead of simply moving abruptly from one slide to another during a presentation, slide transitions allow slides to dissolve into each other, using
a variety of dif erent special effects. These can make your on-screen presentation look even better and more professional. Use different effects in your
presentation.
Solution:
1. Check you are in Normal view and that the first slide is selected
2. Move to the TRANSITIONS tab to see the following ribbon:
Dominating the ribbon is the Transition to This Slide group. As you click on an icon, you’ll see the transition effect on the slide (there
is also a down arrow that wil show you all the dif erent transition effects in one window). The [Effect Options] button
lets you change the direction of the effect. Timing (the group to the right) lets you change the speed of the transition effects.
3. Choose one of the transition effects for the first slide (the [down] arrow shows all the effects).Note that a small star symbol appears to
the left of the first slide
Activity 20:
PowerPoint allows information on your slides to appear one item at a time. This stops your audience from reading ahead of you, making
them concentrate on each point individually. Try to animate a set of bullet points.
Solution:
1. Move to the ANIMATIONS tab then click on a slide with a bulleted list on it (e.g. slide 2)
2. Click on the bullet points then move the mouse over the Animations icons and watch the effects
3. Click on the [down arrow] at the foot of the Animations scroll bar to see more animations. Try setting up various
animations for your slides.
Tip: You can also set up Exit effects and MotionPaths - for example, when the slide is finished, you can get the picture to exit along a
particular motion path. This is all done via the [Add Animation] button (as above).
Activity 21:
Create a Master slide. Master slides are very important as they control the layout of your whole presentation. They allow you to create your own slide template
which is applied to every slide. This is useful if you want to put your own logo, picture or even just your name in the same place on each slide.
Solution:
1. Move to the VIEW tab then click on the [Slide Master] icon in the MasterViews
group – a window similar to that below appears:
2. A Slide Master tab is displayed on the Ribbon indicating that you are in the Slide Master view. Click on the first (top) slide miniature
on the left
This is the Slide Master which is used by all the slides – any changes you make here are applied to the whole presentation. The slide miniatures below
are all the usual slide layouts that are available, some of which are being used by certain slides. To make changes just to a specific layout, you
make them on that custom layout.
To change the look of all the information at the top/bottom of each slide:
3. Select the footer placeholders using the mouse to draw a selection rectangle over the placeholders – hold down the mouse button and
drag over them (the rectangle must enclose the placeholders)
4. Move to the HOME tab and use buttons in the Font group to change the format, e.g.font size
5. To change any placeholder's position, click on the edge (or, more easily, click on it then press <Esc>) and use the <arrow_keys> to
move it to its new position
6. To see the changes to all the slides, move to the SLIDE MASTER tab and [Close Master View]
7. Save your presentation - press <Ctrl+s>
Home Activities:
Activity 1:
Create the PowerPoint folder in your flash drive. Run MS PowerPoint. Search and select the template named Serenity Nature.
• Type “Introduction to ICT”, as the title of the slides. Type your name as the subtitle.
Press Enter. Type your course code, registration number and section in the line below your name.
• Create a new slide. Its layout should be Tile and Text. In the title section, type CSC 101 – registration number.Type Introduction to ICT in the “Click to Add
Text” section (below the slide’s title). It is going to be the first bulleted item.Type your Full Name as the second bulleted item. Type Fall 2016 as the
third bulleted item.
• Create a new slide. Use the same layout that you used previously.Switch to Outline View,
by clicking the Outline tab.Type BASIC COMPUTER CONCEPTS, next to the icon that represents slide 3 and pressENTER.Click the Increase Indent
button or press Tab and then type, “What is a Computer?” (without the quotes) as the first bulleted item.Type the following: “It is a device
that accepts input, processes data, stores data, and produces output.” (without the quotes) as the second bullet item.In the third bullet, type your full
name.
• For the second slide, type in the Notes pane “This definition is based on the concepts
presented in Dr. John von Neumann’s paper.”
• Spell-check your slides.
• Save your work in your flash disk as a PowerPoint Presentation named FirstPresentation.pptx (you do not need to type .pptx). Save it inside
your PowerPoint folder.
Activity 2:
Create slides similar to the following set of slides. Use SmartArt, Chart and Shapes in the Insert tab.
Activity 4:
Create a Master Slide by using a custom layout:
Assignment:
Deadline: at the start of next Lab.
Make a 15-minute presentation on different Input/Output devices (Chapters 2 and 3 of textbook). Use different effects,
animations, transitions and a custom Master Slide.
Note: this should be a formal presentation. Take care of font size, font color, font names, and other styles and animations accordingly.
Statement Purpose:
This lab is an introductory session on Python.It is a clear and powerful object-oriented programming language, comparable to Perl, Ruby,
Scheme and Java. Some of Python’s notable features are:
• Easy to use that makes it simple to get your first programs working
• Easy to learn that makes it an excellent choice for beginners
• Runs everywhere, including Mac OS X, Windows, Linux and Unix
Activity Outcomes:
The lab wil teach students to:
• Install Python
• Explore Python interpreter and IDLE
• Get familiar with outputting data to the screen
• Writing a basic ‘Hello World’ program
Instructor Note:
As a pre-lab activity, read Chapters12 from the book (Introduction to Computers by Peter Norton, 6th edition (2013), McGraw Hil )
to gain an insight about programming and its fundamentals.
Worksheets:
• Excel’s main screen is called a “worksheet”.
Statement Purpose:
This lab is an introductory session on Python.It is a clear and powerful object-oriented programming language, comparable to Perl, Ruby,
Scheme and Java. Some of Python’s notable features are:
• Easy to use that makes it simple to get your first programs working
• Easy to learn that makes it an excellent choice for beginners
• Runs everywhere, including Mac OS X, Windows, Linux and Unix
Activity Outcomes:
The lab wil teach students to:
• Install Python
• Explore Python interpreter and IDLE
• Get familiar with outputting data to the screen
• Writing a basic ‘Hello World’ program
Instructor Note:
As a pre-lab activity, read Chapters12 from the book (Introduction to Computers by Peter Norton, 6th edition (2013), McGraw Hil )
to gain an insight about programming and its fundamentals.
Introduction
Programming is simply the act of entering instructions for the computer to perform. These instructions might crunch some numbers, modify text,
look up information in files, or communicate with other computers over the Internet.Al programs use basic instructions as building blocks. Here
are a few of the most common ones, in English:
You can combine these building blocks to implement more intricate decisions, too.Programming is a creative task, somewhat like constructing a
castle out of LEGO bricks. You start with a basic idea of what you want your castle to look li ke and inventory your available blocks.
Then you start building. Once you’ve finished building your program, you can pretty up your code just like you would your castle.
Python refers to the Python programming language (with syntax rules for writing what is considered valid Python code) and the Python interpreter
software that reads source code (written in the Python language) and performs its instructions.The name Python comes from the surreal British
comedy group Monty Python, not from the snake. Python programmers are affectionately called Pythonistas.
6) Stage a1 (apply)
Lab Activities:
Activity 1:
Install Python on Windows.
Solution:
1. Visit https://www.python.org/downloads/ and download the latest version.
2. Run the downloaded software. Make sure you check option: Add Python 3.5 to PATH.
3. To change install location, click on Customizeinstallation, then Next and enter
C:\python3.5 as install location or any other location you want.
4. If not checked, check thing as Add Python to environment variables . This does the same
Add Python 3.5 to PATH on the first install screen.
5. You can choose to install Launcher for all users or not, it does not matter much. Launcher is used to switch between different versions of
Python installed.
Solution:
1. For Windows 2000, XP, 2003 , click onControl Panel -> System -> Advanced -> Environment
Variables
2. Click on the variable named PATH in the System Variables section, then select Edit and add ;C:\Python3.5) to the end of what is
already there. Of course, use the appropriate directory name.
3. For older versions of Windows, open the file C:\AUTOEXEC.BAT and add the line
PATH=%PATH%;C:\Python3.5 and restart the system. For Windows NT, use the AUTOEXEC.NT file.
4. For Windows Vista:
• Right click on Computer from your desktop and select Properties or click Start and choose
Control Panel -> System and Security -> System. Click on Advanced system
settings on the left and then click on the Advanced tab. At the bottom click on
EnvironmentVariables and under Systemvariables, look for the PATH variable, select and
then press Edit.
• Go to the end of the line under Variable value and append
;C:\Python3.5 (please verify that this folder exists, it wil be dif erent for newer versions of Python) to the end of what
is already there. Of course, use the appropriate folder name.
• If the value was %SystemRoot%\system32; It wil now become
%SystemRoot%\system32;C:\Python3.5
• Click OK and you are done. No restart is required, however you may have to close and reopen the
command line.
Solution:
1. For Windows users, you can run the interpreter in the command line if you have set the PATH variable appropriately.
2. To open the terminal in Windows, click the start button and click Run. In the dialog box, type cmd and press [enter] key.
3. Then, type pythonor py and ensure there are no errors.
Activity 4:
Run Python IDLE on Windows.
Solution:
IDLE (Integrated DeveLopment Environment or Integrated Development and Learning Environment) is an integrated development environment
for Python, which has been bundled with the default implementation of the language.IDLE is intended to be a simple IDE and suitable for
beginners, especially in an educational environment.According to the included README, its main features are:
• Multi-window text editor with syntax highlighting, autocompletion, smart indent and other.
• Python shell with syntax highlighting.
• Integrated debugger with stepping, persistent breakpoints, and call stack visibility.
1. Click on Start.
2. Search for Python IDLE.
3. Select it.
Solution:
1. Open the terminal in your operating system, as done in Activity 3.
2. Open the Python prompt by typing py and pressing [enter] key.
3. Once you have started Python, you should see >>> where you can start typing stuff. This is called the Python interpreter
prompt.
4. At the Python interpreter prompt, type:print("Hello World")followed by the [enter] key.You should see the words
Hello World printed to the screen.
5. Notice that Python gives you the output of the line immediately! What you just entered is a single Python statement.We use
print to print any value that you supply to it. Here, we are supplying the text Hello World and this is promptly printed to the
screen.
Solution:
11. If you are using a GNU/Linux or OS X shell, you can exit the interpreter prompt by pressing [ctrl + d] or entering exit()
(note: remember to include the parentheses, ()) followed by the [enter] key.
12. If you are using the Windows command prompt, press [ctrl + z] followed by the [enter] key.
Activity 7:
Add comment to a python statement.
Solution:
Comments are any text to the right of the #symbol and are mainly useful as notes for the reader of the program.
OR
3. Comments are not executed i.e. output of the statement would still be hello world.
Activity 8:
Run Python scripts from command line. Use any text editor to write the script.
Solution:
1. Type the text below into a text editor and save as hello.py. Python files usually have the .py extension.
#!/usr/bin/env python3
print('hello world')
3. To start the program, open the command line and typepy hello.py
4. You should see a line of text showing “hello world”
Activity 9:
Write a Python program that uses multi-line comment.
Solution:
1. Single line comments start with #; while multi-line comments use three single- quotes before and after the part you want to be
commented.
2. Type the following piece of code in text editor and save it with the name
multicomment.py
#!/usr/bin/env python3
#print(“I am a single line comment”) print(“I am not a
comment”)
‘’’
print(“we are in a multiline comment) print(“we are still in a
comment”)
‘’’
print(“we are out of the comment”)
3. Execute this script on command line. The result wil not show single and multi- line commented statements/lines.
Solution:
1. Run Python IDLE and type in print(“hello world”). Press Enter. The output
hello world wil be displayed on screen.
2. print(“hello world”) is a single statement of Python. To write single statement in multiple lines (for example, if a
single line gets too long and it should be written in multiple lines for ease of understanding), backslash \ is used.
3. Type print(“hello \ and press Enter. Now the cursor is in next line. Type
world”) and press Enter.
Activity 11:
Repeat Activity 10 by writing code in a separate file, using Python IDLE.
Solution:
1. Run Python IDLE.
2. Go to File->New File. A new window wil be displayed.
3. Type in the code as shown below.
Solution:
1. Run Python IDLE or write python script and run it on command line.
2. Type in the following code.
print(“hello”); print(“world”)
4. In python, semicolon (;) is used to separate two statements, written in a single line.
7) Stage v (verify)
Home Activities:
Activity 1:
Install Python on your laptop/desktop. Run IDLE and change the font size of the editor window.
Activity 2:
Run Python IDLE and print following data on screen:
Activity 3:
Make a Python program that prints out your information (Activity 2) by running python script in a command line.
1. print hello
2. print “hello world”
3. print ‘hello’
4. print(“hello world”)
5. print(‘hello world’)
6. print(“hello”) \
print(“world”)
7. print(“The name of this course is \ Introduction to ICT”)
8. # I am a comment
I am not a comment
9. print(“hello”) print(“world”)
8) Stage a2 (assess)
Assignment:
Deadline: at the start of next Lab.
1. Make a Python program that displays the lyrics of a song. Save it with the name mySong.py. Use single and
multi-line comments to elaborate meanings of lines and stanzas.
Execute the code, both on command line and IDLE. Save the screenshots of the output.
2. Write down the output of each piece of code of Home Activity 4. Give the reason of getting an error output (if
any).
Statement Purpose:
In computer science and computer programming, a data type or simply type is a classification identifying one of various types of
data, such as integer, float or Boolean, that determines the possible values for that type, the operations that can be done on values of that type, the meaning of
the data, and the way values of that type can be stored.
In computer programming, a variable or scalar is a storage location paired with an associated symbolic name (an identifier), which
contains some known or unknown quantity of information referred to as a value.The variable name is the usual way to reference the stored value; this
separation of name and content allows the name to be used independently of the exact information it represents.The identifier in computer source code can be bound
to a value during run time, and the value of the variable may thus change during the course of program execution.
Python has two basic data types: Numbers and Strings. Number data types store numeric values. Python supports four dif erent
numerical types: integers, long, float, and complex.Strings in Python are identified as a contiguous set of characters represented in the quotation
marks. Python allows for either pairs of single or double quotes.
Activity Outcomes:
The lab wil introduce students to:
• Python Numbers
• Python Strings
• Basic operations on numbers
• Basic operations on strings
Instructor Note:
As a pre-lab activity, read Chapters12 from the book (Introduction to Computers by Peter Norton, 6th edition (2013), McGraw Hil )
to gain an insight about programming and its fundamentals.
Introduction
Literal constants are values that are used as such. Their values do not change. An example of a literal constant is a number, like 5, 1.23, or a string
such as ‘This is a string’ or “It’s a string!” The number 2 always represents itself and nothing else. It is a constant because its value cannot be changed
from 2. Numbers are mainly of two types – integers and floats. An example of an integer is 2 which is just a whole number. Examples of
floating point numbers (or floats) are 3.23, 52.3E-4. A string is a sequence of characters. They are bunch of words.
Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory.
Based on the data type of a variable, the interpreter allocates memory and decides what can be stored in the reserved memory. Therefore, by assigning
different data types to variables, you can store integers, decimals or characters in these variables.
Python supports different type of variables such as whole numbers, floating point numbers and text. You do not need to specify the type of variable; you can
simply assign any value to a variable.
Lab Activities:
Activity 1:
Display numbers on screen using Python IDLE.
Solution:
1. Run Python IDLE
2. Type in any number, say 24 and press Enter.
3. 24 should be printed on the screen
4. Now type 4.2, press Enter.
5. 4.2 should be displayed on screen as an output.
6. Now type print(234). Press Enter. 234 wil be the output.
7. Type print(45.90) and press Enter. The output wil show 45.90 on screen.
Solution:
1. Python recognized strings through quotes (single, double). Anything inside quotes is a string for Python interpreter.
2. Type hello, press Enter. An error message wil be displayed as Python interpreter does not understand this as a string.
3. Type ‘hello’ and press Enter. Hello wil be displayed.
4. Type ‘Quote me on this!’ and press Enter. Same string wil be displayed.
5. Type “What’s your name?” and press Enter. What’s your name? wil be printed on
the screen.
6. You can specify multi-line strings using triple quotes – “ “ “ or ‘ ‘ ‘. Type following text and press Enter
Activity 3:
Use Python as a calculator.
Solution:
1. The interpreter acts as a simple calculator: you can type an expression at it and it wil write the value. Expression syntax is
straightforward: the operators + (addition), - (subtraction), * (multiplication) and / (division) work just like in most other
languages.Parentheses (()) can be used for grouping.
2. Type in 2 + 2 and press Enter. Python will output its result i.e. 4.
3. Try following expressions in the shell. a. 50 – 4
b. 23.5 – 2.0
c. 23 – 18.5
d. 5 * 6
e. 2.5 * 10
f. 2.5 * 2.5
g. 28 / 4 (note: division returns a floating point number)
h. 26 / 4
i. 23.4 / 3.1
Solution:
1. Division (/) always gives a float answer. There are different ways to get a whole as an answer.
2. Use // operator:
a. Type 28 // 4 and press Enter. The answer is a whole number.
b. Type 26 // 4 and press Enter.
3. Use (int) cast operator: this operator changes the interchangeable types.
a. Type (int)26 / 4 and press Enter. The answer is a whole number.
b. Type (int) 28/4; press Enter.
4. The modulus (or mod) % operator is used to get the remainder as an output (division / operator returns the quotient).
a. Type 28 % 4. Press Enter. 0 wil be the result.
b. Type 26 % 4. Press Enter. 2 wil be the result.
Activity 5:
Calculate 43, 410, 429, 4150, 41000
Solution:
1. The multiplication (*) operator can be used for calculating powers of a number. However, if the power is big, the task wil be tedious.
For calculating powers of a number, Python uses ** operator.
2. Type following and obtain the results of above expressions. a. 4 ** 3
b. 4 ** 10
c. 4 ** 29
d. 4 ** 150
e. 4 ** 1000
Activity 6:
Write following math expressions. Solve them by hand using operators’ precedence. Calculate their answers using Python. Match the
results.
Solution:
The meaning of an operator may change based on the data types of the values next to it. For example, + is the addition operator when it operates on two
integers or floating- point values. However, when + is used on two string values, it joins the strings as the string concatenation operator.
1. Enter the following into the interactive shell:'Alice' + 'Bob'. The result wil be 'AliceBob'
The expression evaluates down to a single, new string value that combines the text of the two strings. However, if you try to use the + operator on a
string and an integer value, Python will not know how to handle this, and it wil display an error message.
The expression evaluates down to a single string value that repeats the original a number of times equal to the integer value. String replication is a
useful trick, but it’s not used as often as string concatenation.
The * operator can be used with only two numeric values (for multiplication) or one string value and one integer value (for string replication).
Otherwise, Python wil just display an error message.
Activity 8:
Use python variables to store values.
Solution:
You’ll store values in variables with an assignment statement. An assignment statement consists of a variable name, an equal sign (called the
assignment operator), and the value to be stored. If you enter the assignment statement spam = 42, then a variable named spam wil have
the integer value 42 stored in it.
A variable is initialized (or created) the first time a value is stored in it ❶. After that, you can use it in expressions with other variables and values
❷. When a variable is assigned a new value ③, the old value is forgotten, which is why spam evaluated to 42
Activity 9:
Try different variable names and check the output.
Solution:
You can name a variable anything as long as it obeys the following three rules:
1. Balance = 3.0
2. Current-balance = 4
3. currentBalance = 1
4. current_balance = 28/2
5. current balance = 128
6. 4account = ‘Ali’
7. _spam = ‘Ali’
8. 42 = ‘amount’
9. SPAM = ‘amount’
10. Total_$um = 2345
11. Account4 = ‘Ali’
12. ‘hello’ = ‘world’
Activity 10:
Write a Python program that uses assignment operators and comments.
Solution:
Type the code given below either in IDLE or as script. Execute it.
#!/usr/bin/python
print counter
print miles
print name
Activity 11:
Combine numbers and text.
Solution:
Type the following code. Run it.
# Text
x = "Nancy"
print(x)
Activity 12:
Take input from the keyboard and use it in your program.
#!/usr/bin/env python3
Home Activities:
Activity 1:
Try the following expressions in Python.
1. -28 + 56
2. -28 + -56
3. 5 / -2
4. -93 % 4
5. (-93)%4
6. -4 ** 10
7. (-4)**10
8. (-4)**9
Activity 2:
Write more complex math expressions. Solve them by hand using operators’ precedence. Calculate their answers using Python. Match the results.
>>>width =20
>>>height =5*9
>>>width * height
>>> n
>>>tax =12.5/100
>>>price =100.50
>>>price * tax
>>>price + _
Note: the last printed expression is assigned to variable _.
>>> round(_,2)
Activity 4:
Do the following on strings:
x = 3 # a whole number
f = 3.1415926 # a floating point number
name = "Python" # a string
print(x)
print(f)
print(name)
sum = f + f
print(sum)
Assignment:
Deadline: at the start of next Lab.
Statement Purpose:
This lab wil give you practical implementation of different types of Conditional Statements (if- else).
Activity Outcomes:
This lab teaches you the following topics:
• Use of indentation
• Use of simple if statement
• Use of if-else statement
• Use of nested-if statement
Instructor Note:
As pre-lab activity, read Chapter 12 from the book (Learning Python, Mark Lutz, 5th Edition (2013), O'Reilly Media), and also as given by your theory instructor.
Introduction:
‘if’ statement is used to perform logical operation. In order to perform decision making, we need to check certain condition(s) before processing. Python supports
if statement for doing so. There are various formats of if statement including if-else and if-elif.
if condition:
statement1
statement2
…
…
If the condition is true then the specified block will be executed. It is important to note that the block is specified by the use of indentation. Python does not use a pair
of curly bracket { } to specify the block.
We can also write the else block associated with the if statement as below.
if condition:
statement1
statement2
…
…
else:
statement3
statement4
…
…
If we are required to test a number of conditions and want to execute one of the many blocks of statements, then we can use if-elif-else statement as below.
if condition1
statement1
statement2
…
…
elif condition2:
Statement3
Statement4
…
…
elif condition3:
Statement5
Statement6
…
…
else:
Statement7
Statement8
Lab Activities:
Activity 1:
Let us take an integer from user as input and check whether the given value is even or not.
Solution:
A. Create a new Python file from Python Shell and type the following code.
B. Run the code by pressing F5.
Activity 2:
Let us modify the code to take an integer from user as input and check whether the given value is even or odd. If the given value is not even
then it means that it wil be odd. So here we need to use if-else statement an demonstrated below.
Solution:
A. Create a new Python file from Python Shell and type the following code.
B. Run the code by pressing F5.
Let us accept two integer values from user and compare which one is the larger value. If both are equal values then we should display that both are equal
values. In this activity you wil use if-elif-else structure of if statement. This is used when we need to check more than one conditions to
perform certain action.
Solution:
A. Create a new Python file from Python Shell and type the following code.
B. Run the code by pressing F5.
Activity 4:
Let us modify the above code in order to apply nested if structure. Sometimes we need to use an if statement within the block of another
if to find the solution of the problem. The following code example illustrates that how nested if can be used in Python.
Solution:
A. Create a new Python file from Python Shell and type the following code.
B. Run the code by pressing F5.
Home Activities:
Activity 1:
Write a Python code to accept marks of a student from 1-100 and display the grade according to the following formula.
Activity 2:
Write a Python code to accept temperature value from user (in centigrade) and display an appropriate message as below.
Assignment:
For this student wil submit Lab Assignment before the deadline.
Statement Purpose:
This lab wil give you practical implementation of different types of loops including for
loop, while loop and nested loops.
Activity Outcomes:
This lab teaches you the following topics:
• while loop
• for loop
• Use of break statement
• Nested loops
Instructor Note:
As pre-lab activity, read Chapter 13 from the book (Learning Python, Mark Lutz, 5th Edition (2013), O'Reilly Media), and also as given by your theory instructor.
Introduction:
Loops are one of the basic structures of a programming language. Loops are performed to repeat a step or steps for a certain number of times. Python
offers two looping statements called while and for. Both have their own uses and advantages.
while loop
while condition:
statement1
statement2
statement3
…
The statements written after the while statements (indented block) are repeated as long as the condition is true. The control wil transfer to the
statement written outside the indented block when the condition becomes false. We can also break the continuation of the loop by writing break
statement within indented block as below.
while condition1:
statement1
statement2
if condition2:
break
statement3
…
In the above case, the while loop will be stopped if the result of condition2 is true.
While loop can also have an optional else part and is executed if break statement was not executed. The syntax of while loop having else block
is as below.
while condition:
statement1
statement2
statement3
…
else:
statement1
statement2
statement3
…
for loop can be used in a number of ways. One of its syntax is as below.
value1 refers to the initial value of the range. It wil be considered 0 if not mentioned.
Value2 refers to the final value of the range. It wil be required to perform the loop.
Value3 refers to the step value. It wil be added (incremented) every time the loop is repeated. It will considered 1 if skipped.
for loop has an optional else part as well. It works exactly as in while loop. It is executed only if break statement is not
executed. The syntax becomes as below.
There is also use of for loop to be used with lists. It wil be covered in the next lab session.
Lab Activities:
Activity 1:
Calculate the sum of all the values between 0-10 using for loop.
Solution:
C. Create a new Python file from Python Shell and type the following code.
D. Run the code by pressing F5.
Activity 2:
Solution:
C. Create a new Python file from Python Shell and type the following code.
D. Run the code by pressing F5.
Solution:
C. Create a new Python file from Python Shell and type the following code.
D. Run the code by pressing F5.
Activity 4:
Write a Python code to keep accepting integer values from user until 0 is entered. Display sum of the given values.
Solution:
C. Create a new Python file from Python Shell and type the following code.
D. Run the code by pressing F5.
Write a Python code to accept an integer value from user and check that whether the given value is prime number or not.
Solution:
A. Create a new Python file from Python Shell and type the following code.
B. Run the code by pressing F5.
If we run the program again and enter 17 as input value then the output wil be as below.
Home Activities:
Activity 1:
Replace the for loop with while loop in the activity 5 discussed above.
Activity 2:
Write a Python code to display all the prime numbers between 100 to 200.
Activity 3:
Write a program that takes a number from user and calculate the factorial of that number.
Activity 4:
Fibonacci series is that when you add the previous two numbers the next number is formed. You have to start from 0 and 1.
E.g. 0+1=1 → 1+1=2 → 1+2=3 → 2+3=5 → 3+5=8 → 5+8=13
Steps: You have to take an input number that shows how many terms to be displayed. Then use loops for displaying the Fibonacci series up to
that term e.g. input no is =6 the output should be
011235
Assignment:
For this student wil submit Lab Assignment before the deadline.
Statement Purpose:
This lab wil give you practical implementation of different types of sequences including Lists and Tuples. Lists are the most commonly used data
structure in Python. Tuples are also very useful and widely used by Python programmers.
Activity Outcomes:
This lab teaches you the following topics:
Instructor Note:
As pre-lab activity, read Chapter 8 from the book (Learning Python, Mark Lutz, 5th Edition (2013), O'Reilly Media), and also as given by your theory
instructor.
Introduction:
Python provides dif erent types of data structures as sequences. In a sequence, there are more than one values and each value has its own
index. The first value wil have an index 0, the second value wil have index 1 and so on. These indices are used to access a particular value in the
sequence.
Python offers different types of sequences but we wil discuss two of them, lists and tuples.
Lists
Lists are the most important type of sequence being used in Python. It is a collection of same or different type of objects. These objects are separated by
commas to distinguish from each other enclosed in square brackets. The following activities show that how lists are used in Python.
Tuples
Tuples are almost same as Lists but the main difference them is that objects defined in tuples cannot be changed while they can be changed in lists. A minor
difference is that lists are enclosed in square brackets while tuples are enclosed parenthesis (round brackets). The following activities show that
how tuples are used in Python.
Lab Activities:
Activity 1:
Accept 5 values from user and store them in a list. Display all the values (objects) of the list.
Solution:
E. Create a new Python file from Python Shell and type the following code.
F. Run the code by pressing F5.
Activity 2:
Repeat the above code by accepting 5 integer values from user. Store these values in a list and display the sum of given values.
Solution:
E. Create a new Python file from Python Shell and type the following code.
F. Run the code by pressing F5.
Activity 3:
Accept 5 integer values from user. Store these values in a list and display the list in ascending order.
Solution:
E. Create a new Python file from Python Shell and type the following code.
F. Run the code by pressing F5.
Solution:
E. Create a new Python file from Python Shell and type the following code.
F. Run the code by pressing F5.
Activity 5:
Write a Python code to accept a list from user and find a required element in it.
Solution:
C. Create a new Python file from Python Shell and type the following code.
D. Run the code by pressing F5.
If we run the program again and enter 55 to find in the list then the output wil be as below.
Activity 6:
Write a Python code to accept a tuple from user and display the maximum and minimum value of the tuple.
Solution:
A. Create a new Python file from Python Shell and type the following code.
B. Run the code by pressing F5.
Home Activities:
Activity 1:
Create two lists based on the user values. Merge both the lists and display in sorted order.
Activity 2:
Repeat the above activity to find the smallest and largest element of the list. (Suppose all the elements are integer values)
Activity 3:
Repeat the above activity to find the index of the smallest and largest element of the list. (Suppose all the elements are integer values)
Assignment:
For this student wil submit Lab Assignment before the deadline.
Statement Purpose:
This lab wil give you practical implementation of different types of user-defined functions.
Activity Outcomes:
This lab teaches you the following topics:
Instructor Note:
As pre-lab activity, read Chapters 16,17,18 from the book (Learning Python, Mark Lutz, 5th Edition (2013), O'Reilly Media), and also as given by your theory
instructor.
Introduction:
It is usually a better approach to divide a large code in small functions. A function is a small piece of code used to perform a specific purpose. Functions are
defined first then called whenever needed. A program may have as many functions as required. Similarly a function may be called as many times
as required.
def function_name(list_of_parameters):
statement1
statement2
statement3
…
return value
The list of parameters is optional if a function is not accepting any value but is usually required while defining a function. Similarly, return statement
is optional but is required if a function returns a value.
Once a function is defined then it can be called by using its name and providing values to the parameters. Calling a function in Python is same as in other
programming languages.
The following activities demonstrate that how functions are defined and called in Python.
Lab Activities:
Activity 1:
Solution:
G. Create a new Python file from Python Shell and type the following code.
H. Run the code by pressing F5.
Activity 2:
Write a function to accept 2 integer values from user and return their sum.
Solution:
G. Create a new Python file from Python Shell and type the following code.
H. Run the code by pressing F5.
Define a function to accept an integer value from user and check that whether the given value is prime number or not. If the given value is a prime
number then it wil return true otherwise false.
Solution:
G. Create a new Python file from Python Shell and type the following code.
H. Run the code by pressing F5.
Activity 4:
Define a function to accept a list of integer values and return the sum of it.
Solution:
G. Create a new Python file from Python Shell and type the following code.
H. Run the code by pressing F5.
Activity 5:
Write a Python code to accept a list of integers and sort it in descending order.
Solution:
E. Create a new Python file from Python Shell and type the following code.
F. Run the code by pressing F5.
Home Activities:
Activity 1:
Write a function to accept an integer ‘n’ and display ‘n’ elements of Fibonacci series.
Activity 2:
Write a function to accept two lists of integer values and return the largest value.
Activity 3:
Write a function to accept two integer values and swap them with each other.
Assignment:
For this student wil submit Lab Assignment before the deadline.
Statement Purpose:
This lab provides an overview of tables in Microsoft Access 2010, and introduces new or removed table features. This lab also explains how to create a
table, how to add fields to a table, how to set a table's primary key, and how to set field and table properties.
Activity Outcomes:
• Create simple Access tables and forms
• Modify form design
• Create relationship between tables
• Create simple select and crosstab queries
• Extract information from tables or queries
Instructor Note:
• As pre-lab activity, read Chapter 8 from the book (Using Information Technology: A Practical Introduction to Computer & Communications,Stacey,
W.S & Sawyer, C., 10th Edition (2012), McGraw Hil .)
Introduction
Tables are essential objects in a database because they hold all of the relevant data. For example, a database for a Medical Store can have a
table that stores the names of their suppliers, e-mails, addresses, telephone numbers, etc. This lab provides an overview of tables in MS Access.
Before you create tables, consider your requirements and determine all the tables that you might need.
• A database file in Access has *.accdb extension.
• An Access desktop database (.accdb) is a fully functional RDBMS.
• It provides all the data definition, data manipulation, and data control features that you need to manage large volumes
of data.
• You can use an Access desktop database (.accdb) either as a standalone
Relational Database Management Systems (RDBMS) on a single workstation or in a shared client/server mode across a
network.
• A desktop database can also act as the data source for data displayed on
webpages on your company intranet.
• When you build an application with an Access desktop database, Access is the RDBMS.
Lab Activities:
Activity 1:
MS Access Sample Database
Solution:
1. Create a database from a template.
a. Press F11 to open the Navigation Pane. Click the downward-pointing triangle in a circle at the top of that pane. (Note: F11
doesn't work with Access in the virtual machine. If the navigation pane isn't already open, you can click the sideway
arrows to open the pane.)
b. In the list that opens, click Object Type. There are the objects created for
you in this pre-built database.
c. On the Ribbon, click the Create tab.
d. In the Tables group, click Table.
e. In the rightmost column, click the down-arrow next to Click to Add.
f. Select the data type Text.
g. Access creates the new column and selects the field name.
h. Type the name Project Name for the field.
i. Add a Description column in a similar manner.
j. Right-click the Table 1 tab, click Save, and name the table Project.
k. Click the Create tab. In the Forms group, click Form.
l. Click the Create tab. In the Reports group, click Report.
Activity 2:
Manipulate data in the tables by adding and deleting dif erent records.
Home Activities:
Activity 1:
Group the filesinto a database.
Assignment:
Make a databaseof your class consisting of as much files as number of students in the class. Each file should contain three records: a student’s medical record,
personal record and academic record. All of the record should have the required filed.
Statement Purpose:
• It is arguably the most user-friendly version of Linux out there. Ubuntu's whole philosophy is based around making is easier for
the user - hiding any unnecessary complexity behind the scenes
• It has a huge repository of (free) software available - by far the most of any Linux
distribution (distro).
• It has a huge installed base: it's the most popular distro, so there are plenty of people and websites out there supporting it
• It's backed by Canonical, which means that they have the resources to put out six-monthly releases plus bug-fixes
Activity Outcomes:
Bash is the language that you wil learn to love as much of everyday Ubuntu life is done/can be done using the Terminal. You wil soon learn that most
things can be done through both GUI (Graphical User Interface) and CLI (Command Line Interface), however some things are more easily achieved from one or
the other. For example, changing file permissions of a folder and all its sub folders is more easily achieved using CLI instead GUI.
Instructor Note:
As pre-lab activity, read Chapter 3 from the book (Linux unleashed third edition by Tim Parker)
Introduction
Ubuntu is an operating system that is developed by a worldwide community of programmers as well as by employees of
Ubuntu's commercial sponsor, Canonical. Ubuntu is based on the concept of free or open-source software, meaning that you do not pay any
licensing fees for Ubuntu, and you can download, use, and share the operating system free of charge.
Ubuntu is "free software" — a term which is often misunderstood to mean only free of cost. While Ubuntu is free of cost, the term "free software"
more accurately refers to the freedom to run the program for any purpose, to study how the program works and modify it to your needs,
to redistribute copies, and to improve the program and release your improvements to the public.
Being a Linux-based operating system, Ubuntu has a well-deserved reputation for stability and security. Historically, Linux has proven itself to
be a workhorse server operating system, and this is where, up until now, it has been most widely used and best known.
Security updates and bug fixes for applications and the operating system are managed by Ubuntu, and users are notified about these updates through an icon
in the taskbar, which they can click on to install.
2) Stage a1 (apply)
Lab Activities:
Activity 1:
Install and configure Ubuntu
Activity 2:
There are many bash command to learn. The following is an abbreviated list of the most useful ones. To access bash, click on the search icon (a stylized
Ubuntu logo) at the top of the launcher and then type ‘terminal’ in the search bar. You may wish to add the terminal to the launcher since you wil be
using it a lot
expand files
contents
make == build an application using a MakeFile man == read the manual for
mv == move a file
sftp == secure file transfer protocol (connect to another computer) ssh == secure shell hyper–terminal (connect to
tar == tape archiver (the tape drive is optional) wget == web getter
Home Activities:
Activity 1:
1. Where is the bash program located on your system?
2. Use the --version option to find out which version you are running.
3. Which shell configuration files are read when you login to your system using the graphical user interface and then opening a terminal
window?
4. Are the following shells interactive shells? Are they login shells?
A shell opened by clicking on the background of your graphical desktop, selecting "Terminal" or such from a menu.
4) A shell that you get after issuing the command ssh localhost.
5) A shell that you get when logging in to the console in text mode.
6) A shell obtained by the command xterm&.
7) A shell opened by the mysystem.sh script. A shell that you get on a remote host, for which you didn't have to give the login and/or
password because you use SSH and maybe SSH keys.
8) Can you explain why bash does not exist when you type Ctrl+C on the command line?
9) Display directory stack content.
10) If it is not yet the case, set your prompt so that it displays your location in the file system hierarchy, for instance add this line to ~/.bashrc:
export PS1="\u@\h
\w> "
11) Display hashed commands for your current shell session.
12) How many processes are currently running on your system? Use ps and wc, the first line of output of ps is not a process!
13) How to display the system hostname? Only the name, nothing more!
14) Stage a2 (assess)
Assignment:
1. Write a script using your favorite editor. The script should display the path to your homedirectory and the terminal type
that you are using. Additionally it shows all the services started up in runlevel 3 on your system. (hint: use HOME,
TERM and ls /etc/rc3.d/S*)
2. Add comments in your script.
Statement Purpose:
In this lab you learn how to connect two/multiple PCs to create a Peer-to-Peer/simple LAN or workgroup. You wil share a folder on one
workstation and share that folder from the other workstation.
Activity Outcomes:
• Create a simple LAN with two PCs using a single crossover cable to connect the workstations.
• Create a simple LAN with multiple PCs using an Ethernet switch and a straight-
through cable to connect each workstation.
• Map a logical Drive and use Universal Naming Convention (UNC) to share available resources.
• Use the Control Panel / Network utility to verify and configure the network settings.
• Use the ICMP Ping command to verify the TCP/IP connection between the two workstations.
• Use the IPCONFIG.EXE utility to verify some of the IP configuration settings
Instructor Note:
As pre-lab activity, read Chapter 7 from the book (Introduction to computers by Peter Norton)
Introduction
In this laboratory exercise, you wil build an Ethernet LAN and connect your LAN to the Internet. You wil also configure your computer to obtain an
IP address automatically using Dynamic Host Configuration Protocol (DHCP). Once the stations obtain IP addresses, they wil be able to
communicate with each other and the Internet. You wil use the Window’s ping and tracert utilities to test connectivity, and the arp program to
view the hosts ARP table.
2) Stage a1 (apply)
Lab Activities:
Activity 1:
Two PCs (or workstations) wil be connected directly to each other from one Network Interface card (NIC) to the other NIC using a crossover cable.
This can be useful to allow you to create a minilab for testing purposes without the need for a hub. Since the NICs on the workstations are directly
connected you wil not be able to connect any additional workstations.
Activity 2:
All PCs on the same row wil be connected with a switch. Using a switch allows for more than just two workstations to be connected. Switches
can have anywhere from four to twenty four ports.
Solution:
The following resources wil be required:
✓ Two workstations with a NIC in each (Make sure that you boot up with the Windows 8
✓ Exercise A - One CAT 5 Crossover cable to connect two workstations without a hub.
✓ Exercise B - An Ethernet switch (12 or 24 port) and a CAT 5 straight through cable for each work station.
Steps 1 (physical LAN connections) wil be dif erent between exercises A and B. The steps from 2 on should be the same.
Exercise A - A single CAT 5 crossover cable is used to connect two workstations together. Refer to figure 1
Exercise B - Each work station wil connect to the switch using a straight through cable. Refer to figure 1
Cross
Over
Straight Through Cable. This cable will connect This crossover cable will connect
PC1's lowest-numbered NIC to the switch PC2's lowest-numbered NIC to
PC4's lowest-numbered NIC
(Figure 1)
Go to Control Panel, Network and dialup connections. You should be able to see three icons:
2. The Lowest-Numbered NIC which is used to connect you to the Cisco lab. This NIC is disabled by default and has to be
enabled when you do the labs. Right-click on it and enable it. Notice that you might get the IP address
conflict message. If so, just click OK out of it as this problem will be fixed in
Step 4.
Right click on the lowest-numbered NIC and choose properties from the shortcut menu. Check to be sure that you have the following networking
Components installed:
Right-click my computer icon and choose properties. Select the network identification tab. Click the properties button. In the computer name textbox,
change the name to Station# (where # could be anything from 1-24 depending on the location of the PC).Leave the default workgroup
name as WORKGROUP.
For this lab, use the Class C network address of 200.150.100.0 andset the value of the last octet to equal that of the PC #. Set the default subnet
mask on each workstation to255.255.255.0.Make sure that you are configuring the lowest-numbered NIC
Step 5 - Check the TCP/IP Settings with the Ipconfig /all Utility
Click on Start, Programs and then select the MS-DOS Prompt.Enter the ipconfig /all command to see all TCP/IP related
settings for your workstation.
1. Host name
2. MAC Address
3. IP address
4. Subnet Mask
Click on Start, Programs and then the MS-DOS Prompt. Enter the Ping commandfollowed by the IP
address of the other workstation (Example - ping 200.150.100.1).
Explanation: This wil verify that you have a good OSI Layers 1 through 3 connection. Was the Ping successful?
Right-click on my computer icon and choose explore from the short-cut menu.
3) Stage v (verify)
Home Activities:
Activity 1:
Read and understand IPv4 with its classes and have concepts of sub-net masking.
4) Stage a2 (assess)
Assignment:
Managing the MAC Address Table by recording the MAC addresses of the hosts. Determine the MAC addresses that the switch
has learned.
After reading Address Resolution Protocol and Internet Protocol (ARP and IP), please prepare a table consisting of the MAC addresses and IP
addresses in the lab.
Statement Purpose:
Dreamweaver is a tool for making web sites. We wil design and implement Business models
Activity Outcomes:
Students will design fully-functional multi-page website, complete with
1. a home page
2. Jumping from home to hyper link
Instructor Note:
Study e-commerce business models from chapter 9 (Introduction to computers by Peter Norton)
Introduction
E-commerce is buying and selling goods and services over the Internet. Ecommerce is part of e-business. E-business is a structure that includes not only those
transactions that center on buying and selling goods and services to generate revenue, but also those transactions that support revenue generation. These activities
include generating demand for goods and services, offering sales support and customer service, or facilitating communications between business partners.
2) Stage a1 (apply)
Lab Activities:
Activity 1:
Install Dreamweaver CS6
Solution:
1. Install and configure Dreamweaver.
2. Develop a web page (static or dynamic) showing some sellable items e.g.
Stationary objects: pen, notebook, calculator etc.
3. To develop brokerage model, create a page with some vendors and some items with dif erent prices e.g some
stationary objects by dif erent vendors
4. Create a home /main page with many information. Moreover, this page represents an online store with many
categories:
a. Stationary
b. Electronics
c. Garments
d. Grocery, etc.
3) Stage v (verify)
Home Activities:
Activity 1:
4) Stage a2 (assess)
Assignment:
Implement mixed model in Dreamweaver