LAB Manual: Course: CSC101-Introduction To ICT
LAB Manual: Course: CSC101-Introduction To ICT
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 will 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 will 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 Hill) 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 within 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 will
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 will now be set to Desktop
.
3. Select the file MyDoc from the right pane of the dialog box. The file
name will 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 will now be
selected to Algerian .
9. Save the changes by pressing Ctrl+Sor .
CSC101 –Lab Manual 5
Activity 3:
Change the case of the text to lowercase, UPPERCASE and other capitalization options.
Solution:
1. Select ‘Consider’. From the toolbar/ribbon, click on small arrow besides change
case option . A list of options will appear. Select toggle case . This
will 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 will 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 will 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 different line styles by clicking on the
small arrow beside this option . You can alternatively press Ctrl+U for the
same.
Activity 5:
Using different 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 will
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.
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 will 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 will 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. will 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 will
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 will see different page options in the Page ribbon. Select Cover Page option
. The down arrow will display different styles of cover pages. Select any
format of your choice. A new cover page is now added to the start of your
document.
4. Edit different text boxes on the cover page, selecting them and filling in the
appropriate information.
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 will see matrix in the form of rows and columns. Roll your mouse
over this matrix and different numbers of rows and columns will be highlighted.
Select a matrix of size 3x4.
3. A table with fixed cell size will 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 will 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.”
CSC101 –Lab Manual 11
• Bold the words “no cost”, “November 25th”, “Norseman Inn” and “Cappy’s
Capers”
• Put approx. 4 blank lines after “Warmest regards” to allow space for a
signature
• Your first and last name are typed at the bottom
• Save
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 will begin promptly at 9 p.m. The famous band, Cappy’s Capers, will provide an
entertaining evening of dancing and comedy.
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”
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 will 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 will 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 Hill) 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 different 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.
.
7. Add border to the picture by selecting Picture Border’s down-arrow
.
picture in the middle of a paragraph. Try different Position and Wrap Text
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 different 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 different 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.
will appear on over the toolbar. Select this option and different
format options will be available to format the selected shape. Alternatively, you
can select a shape and click right on it. Different format options will appear.
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 will 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 (A = πr 2 ) in a Word file.
Solution:
1. Open an already existing file.
Footer Tools . When you are finished, choose close header and
footer .
4. You can insert footer to your document by following the same steps. Click on the
footer option in the Insert tab. A list of footer styles will appear. Select one.
9. Select Area of Circle and that equation will 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 will appear on top
of the window. This will let you format the selected equation by applying different
options, such as using different 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.
2. Go to Page Layout tab . On the left-most side of the toolbar, there is
a Themes option . Click on its down arrow and choose a theme for your page.
, page size , and page columns that will 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
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.
3. Select Insert > Pages> Break > Page Break to insert a page break.
*****************
CSC101 –Lab Manual 20
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.
2. In the Table of Contents dialog box, do any of the following:
3. To change how many heading levels are displayed in the table of contents, enter
the number that you want in the box next to Show levels, under General.
4. To change the overall look of your table of contents, click a different format in
the Formats list. You can see what your choice looks like in the Print Preview and
Web Preview areas.
5. To change the type of line that appears between the entry text and the page
number, click an option in the Tab leader list.
6. To change the way heading levels are displayed in the table of contents, click
Modify. In the Style dialog box, click the level that you want to change, and then
click Modify. In the Modify Style dialog box, you can change the font, the size, and
the amount of indentation.
7. Repeat step 1 and step 2 for each heading style that you want to include in the
table of contents.
8. Click OK.
9. Choose a table of contents to fit the document type:
10. Printed document If you are creating a document that readers will read on a
printed page, create a table of contents in which each entry lists both the heading
and the page number where the heading appears. Readers can turn to the page
that they want.
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 will 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 will appear in your Word doc.
10. Edit accordingly (most bibliographies are double spaced)
Activity 8:
Cite references
Solution:
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.
Statement Purpose:
This lab will 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 will 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 will 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 different 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
CSC101 –Lab Manual 27
Fireworks (Equivalent of Theme Fireworks in the new version of PowerPoint). Of the
several search results that you obtain, click and download the one for PowerPoint 2003
(It is compatible with 2010). If there is a problem, read the instructions on how to
manually download it, and the need for uncompressing the file. Remember the location
where you saved it, because you need to go back to it. The file will have a fileextension of
POT.
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 will see four main areas on the
screen:
1. Slides /Outline Tab: it is located on the left hand side of the screen.
• It will 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 will 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 will appear. Click on the Save button.
NOTE: If you want to save an existing presentation you will use SAVE, unless you want to
save it under a different name. Then you will 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)
9. Click on the Microsoft Office button and select the Exit PowerPoint option.
Microsoft PowerPoint will terminate.
Solution:
7. When you have a new slide, you will 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 will 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 will 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 will find among all the buttons,
theIncrease Indent and Decrease Indent buttons. They look like this:
a. Decrease Indent: If it is enabled, you can move an item up the
hierarchy.For example if you have the following outline:
i. Games
ii. WarCraft II
iii. Diablo II
iv. System Shock
If you select item i, then click Decrease Indent, would make the outline look
like this:
a. Games
i.WarCraft II
ii. Diablo II
iii. 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.
Solution:
12. Go to the slide, where you want to have a reminder.
CSC101 –Lab Manual 31
13. Click in the Notes pane. The Notes pane is at the bottom of the screen, below the
slides pane.
14. Type the notes that you wish to use as a reminder
15. Click outside the Notes pane area to finish.
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 view
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.
In the Slide Sorter view, click once the slide to select/ highlight it. Then drag and
release where you want your slide to go. You will see a thin line appear as you
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 will 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 will see a small triangular tool in the lower left. Click on this and it will
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 will 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 fill
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 will 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.
Chart icon or use Insert Chart icon 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 different 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 different 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
will show you all the different 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.
7. Click on the slide title on one of the slides that you’ve already animated
8. Next, click on the [Animation Pane] button in the Advanced Animation group
to display the task pane
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>
CSC101 –Lab Manual 44
3) Stage v (verify)
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:
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 will 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 Hill) 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 will 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 Hill) 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.All 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 like 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 Add Python to environment variables. This does the same
thing as 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:
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:
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')
2. If you are using Windows and Notepad++, it may look something like this:
CSC101 –Lab Manual 56
You can use any text editor to create a Python program.
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 will not show single and multi-
line commented statements/lines.
Activity 10:
Solution:
1. Run Python IDLE and type in print(“hello world”). Press Enter. The output hello
world will 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 will be displayed.
3. Type in the code as shown below.
Activity 12:
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”)
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.
Activity 4:
Type in following pieces of code and examine the output.
CSC101 –Lab Manual 59
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 different 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 will 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 Hill) 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.
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 will be the output.
7. Type print(45.90) and press Enter. The output will 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 will be displayed as Python interpreter
does not understand this as a string.
3. Type ‘hello’ and press Enter. Hello will be displayed.
4. Type ‘Quote me on this!’ and press Enter. Same string will be displayed.
5. Type “What’s your name?” and press Enter. What’s your name? will be printed
on the screen.
6. You can specify multi-line strings using triple quotes – “ “ “ or ‘ ‘ ‘. Type following
text and press Enter
'''This is a multi-line string. This is the first line.
This is the second line.
"What's your name?," I asked.
He said "Bond, James Bond."
'''
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
will 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
CSC101 –Lab Manual 63
Activity 4:
Get an integer answer from division operation. Also get remainder of a division operation
in the output.
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 will be the result.
b. Type 26 % 4. Press Enter. 2 will 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 will 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.
1. 2+3*6
2. (2+3)*6
3. 48565878 * 578453
4. 2 + 2 (note the spaces after +)
5. (5 - 1) * ((7 + 1) / (3 - 1))
6. 5 +
7. 42 + 5 + * 2
Activity 7:
Concatenate two or more strings. Also replicate a string.
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 will 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 will 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 will 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 will 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 instead of
CSC101 –Lab Manual 66
40 at the end of the example. This is called overwriting the variable. Enter the following
code into the interactive shell to try overwriting a string:
5. >>> spam = 'Hello'
>>> spam
6. >>>spam = ‘Goodbye’
>>>spam
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
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)
Statement Purpose:
This lab will 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
CSC101 –Lab Manual 73
14) Stage a1 (apply)
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 will 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.
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.
Activity 2:
Write a Python code to accept temperature value from user (in centigrade) and display
an appropriate message as below.
Statement Purpose:
This lab will 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
The commonly used syntax of while loop is as below.
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 will 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
…
value1 refers to the initial value of the range. It will be considered 0 if not
mentioned.
Value2 refers to the final value of the range. It will be required to perform the loop.
Value3 refers to the step value. It will 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 will be covered in the next lab session.
Solution:
C. Create a new Python file from Python Shell and type the following code.
D. Run the code by pressing F5.
Activity 2:
Repeat the above code using while loop.
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.
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 will be as
below.
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
Statement Purpose:
This lab will 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 different 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 will have an index
0, the second value will 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 will 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.
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 will 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.
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)
Activity 4:
CSC101 –Lab Manual 91
Accept a list of 10 integer values from user and display the list in descending order.
Statement Purpose:
This lab will 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:
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.
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.
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.
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.
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 Hill.)
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.
Solution:
1. Create a database from a template.
Activity 2:
Manipulate data in the tables by adding and deleting different records.
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 will learn to love as much of everyday Ubuntu life is done/can
be done using the Terminal. You will 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.
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 will be using it a lot
cd == change directory
cp == copy a file
mv == move a file
rm == remove a file
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?
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 will 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 will build an Ethernet LAN and connect your LAN to the
Internet. You will also configure your computer to obtain an IP address automatically
using Dynamic Host Configuration Protocol (DHCP). Once the stations obtain IP
addresses, they will be able to communicate with each other and the Internet. You will
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) will 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 will not be able to connect any additional
workstations.
Activity 2:
All PCs on the same row will 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 will 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) will be different between exercises A and B. The
steps from 2 on should be the same.
Exercise B - Each work station will 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.
CSC101 –Lab Manual 110
Fill in the blanks below using the results of the IPCONFIG command from 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 will verify that you have a good OSI Layers 1 through 3 connection.
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 will 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
Merchant model
Brokerage model
Advertisement model
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 different prices e.g some stationary objects by different
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.
CSC101 –Lab Manual 114
5. Create subpages with details e.g. stationary
a. Paper
i. Registers
ii. Writing pads
iii. Diaries
iv. A4 pages
b. Electronics
i. Calculator
ii. Usb
iii. Headphones
iv. Mic
c. Writing
i. Pen
ii. Marker
iii. Pencil
iv. Eraser
v. Sharpener
3) Stage v (verify)
Home Activities:
Activity 1:
4) Stage a2 (assess)
Assignment:
Implement mixed model in Dreamweaver