Cit191.0 Computer Laboratory 1.0
Cit191.0 Computer Laboratory 1.0
GUIDE
CIT 191
COMPUTER LABORATORY I
Lagos Office
14/16 Ahmadu Bello Way
Victoria Island, Lagos
e-mail: [email protected]
URL: www.nou.edu.ng
ISBN: 978-978-058-754-3
Contents
Introduction……………………………………………… iii
Working through this course materials Study units…….. iii
Course materials………………………………………… iv
Study units………………………………………………. iv
Introduction
The course will consist of twelve (12) units of lectures organized into 3
modules. The lectures will cover the concepts of Computer Hardware,
Networking and Computer Programming. The course aims to assist you
in gaining practical understanding of the diverse contexts of Computer
Hardware Networking and Computer Programming.
This Course Guide tells you briefly what the course is all about, what
course materials you will be using, and how you can work your way
through these materials. It suggests some general guidelines for the
amount of time you are likely to spend on each unit of the course in
order to complete it successfully. It also gives you some guidance on
your tutor-marked assignments (TMAs).
You will be required to attend some tutorial classes that are linked to
the course. Details of times and locations of, and tutors for, the tutorials
will be communicated later.
To complete this course, you are required to read the study units and
read other materials provided by the department. You will also need to
ii
CIT 191 COURSE GUIDE
Course materials
Study units
There are 12 study units in this course organized into three modules as
follows:
iii
CIT 191 MODULE 1
1.0 Introduction
The system unit is the main unit of a PC. It is the Computer itself
while other units attached to it are regarded as peripherals. It could be
viewed as the master conductor orchestrating your PC’s operation. It
is made up of several components like the Motherboard, Processor,
Buses, memory, power supply unit, etc. This unit (system unit) has
been confused over the years by novices as the CPU. This is not
true. The CPU (Central Processing Unit) or simply processor is a
component within the system unit and it is not the only thing that
makes up the system unit. Hence, it will be wrong to equate the
system unit with the CPU.
Light
Your system may display a variety of colored light on the front panel,
including power and turbo signals, and light to indicate if the Hard or
Floppy disk are being read or written to.
Key Lock
You can stop intruders tampering with your PC by using the Lock on
the front panel. Turning the key prevents the key board from working.
1
CIT 191 COMPUTER LABORATORY I
Turbo Button
Some PCs offer a choice of speeds at which they can run. A turbo
switch is usually left so the computer runs at its fastest speed.
Reset Button
If your PC “freezes” and won’t respond to any command, try starting
it up again using the reset button. Pressing the reset button loses all the
work you have not saved in that session, so use it only as a last resort.
Power On/Off
All PCs have main power switch on the system unit. Sometimes this
control is placed on the outside back panel.
A CD-ROM Drive or optical drive is the device used to read Compact Disc
Read-Only Memory. CD-ROM drives have speeds ranging from 1x to 72x,
meaning it reads the CD roughly 72 times faster than the 1x version. As you
would imagine, these drives are capable of playing audio CDs and reading
data CDs, including CD-R and CD-RW discs.
Fan Housing
The electronic components in your PC generate a lot of heat. To
prevent overheating, a fan at the back of the unit removes hot air from
the system.
USB Ports
A USB port is a standard cable connection interface for personal computers
and consumer electronics devices. USB stands for Universal Serial Bus, an
industry standard for short-distance digital data communications. USB ports
allow devices such as keyboard, mouse etc. to be connected to each other
with and transfer digital data over USB cables.
2
CIT 191 MODULE 1
Battery
A small battery powers a clock to keep track of the time when the PC is
turned off. It also maintains low electricity to certain RAM chips that
record which components are installed.
Expansion Slots
ROM Chips
3
CIT 191 COMPUTER LABORATORY I
RAM Chips
Intel Processor
4
CIT 191 MODULE 1
CPU fan
Speaker
The speaker emits the computer’s sound output.
5
CIT 191 COMPUTER LABORATORY I
Motherboard
All the electronic components in a PC are mounted on a piece of
fiberglass called the motherboard. Fiberglass cannot conduct
electricity, so each component is insulated from all the others. Thin
lines of metal on the surface of the fiberglass connect pins from one
component to another, forming the computer’s electrical circuits.
Intel CPU
The earliest PCs were equipped with a CPU from Intel Corporation
called the 8088. the next generation of PCs used CPU known by
the number “80286 and were called “PC/AT” computers.
Subsequently, PCs have been supplied with more and more
powerful CPUs – the 80386, the 80486, and the more recent and
impressive of all, the Intel Pentium (I, II, III, IV& M).
6
CIT 191 MODULE 1
million components to the 3,500 that were in the first 8088. Because of
these differences, the latest Pentiums runs over ten times faster.
7
CIT 191 COMPUTER LABORATORY I
8
CIT 191 MODULE 1
1.0 Introduction
The computer peripheral devices are those devices which are attached to
the system unit. The devices are necessary to ensure that the computer
is able to accept input and display the result for the user. This section
therefore discusses the input unit and the output unit.
9
CIT 191 COMPUTER LABORATORY I
3.2 Mouse
3.3.1 Printers
A printer is the computer component that lets you create copies of the
information stored in your computer on paper. The printed material is
often called hard copy, to differentiate it from the data stored on a disk,
or held in the computer's memory.
3.3.2 Monitors
The monitor does not do any processing itself. The monitor only
displays the information that the video card tells it to. The two most
common monitor sizes are 15-inch and 17-inch. If you have an older,
hand- me-down PC or a very inexpensive starter PC, you may have a
smaller 14-inch monitor. 21-inch monitors are also available but mostly
used by graphics professionals.
10
CIT 191 MODULE 1
3.3.3 Scanners
The built-in speakers in most PC cases are used just for making system
sounds, such as warning beeps and action indicators. To play more
sophisticated sounds on your PC, you need a set of external speakers.
Usually speakers come in pairs, and there is a plug that connects them
to your sound card. Arrange the speakers with one on the left and one
on the right of your desk or work area to get a stereo effect.
4.0 Conclusion
The system unit cannot function without the peripheral devices. The
input and the output units are very important peripheral devices that
must be taken care of in setting up a computer system.
5.0 Summary
11
CIT 191 COMPUTER LABORATORY I
a. Justify the need for the input and the output units in a computer
system.
b. Describe the functions of the following keys: the numeric keys,
control keys, shift keys and the function keys.
c. In what situation will you recommend the laserjet printer and
the dot matrix printer.
12
CIT 191 MODULE 1
1.0 Introduction
The auxiliary equipment as their name suggests are not computers but
are necessary in a computing environment in order to ensure proper
functioning and smooth running of computing activities. In this unit,
we shall address in some details the importance of equipment such as
air conditioner, voltage stabilizer, uninterruptible power system and
line transformer in a data processing environment.
The free air is basically, dust laden. Dust is metallic in nature and, as
such, capable of conducting electricity. If dust is allowed to settle
on a computer, particularly the electronic circuits, the dust can
bridge two circuits. The bridging of two electronic circuits may
cause a serious damage to the computer. Thus, air conditioners are
needed in a computer environment to:
(a.) Control the temperature
(b.) Prevent dust.
A computer when switched on, takes off at a cold state, warms up and
gradually gets to a hot state. At a hot state, a computer is always
roaming in an attempt to find something to do. In a situation where the
public electricity such as that of PHCN in Nigeria is cut suddenly, the
computer would suddenly be brought to a halt. The sudden power cut
may cause the computer to lose the memory of some basic
housekeeping operations when power eventually returns and the
13
CIT 191 COMPUTER LABORATORY I
computer is switched on. The sudden power cut may also cause
irreparable damages to the file the computer was processing at the time
the power was suddenly cut.
4.0 Conclusion
14
CIT 191 MODULE 1
5.0 Summary
15
CIT 191 MODULE 2
1.0 INTRODUCTION
Coaxial Cable
Coaxial cables have a single copper conductor at the center, while a
plastic layer provides insulation between the center conductor and
braided metal shield. The metal shields outside interference.
Coaxial cabling is highly resistant to signal obstruction, although it can
be complex to install. It can handle greater cable lengths between
network devices than twisted pair cables. The two types of coaxial
cables are thick coaxial and thin coaxial cables.
16
CIT 191 COMPUTER LABORATORY I
Shielded twisted pair cables can be perfect if you want to set up cables
in an area with potential interference and risks to an unshielded twisted
pair cable’s electrical current. Shielded twisted pair cables can also help
to expand the distance between the cables.
Procedure:
1. Start by stripping off about 2 inches of the plastic jacket off the
end of the cable. Be very careful at this point, as to not nick or
cut into the wires, which are inside. Doing so could alter the
characteristics of your cable, or even worse render is useless.
Check the wires, one more time for nicks or cuts. If there are any,
just whack the whole end off, and start over.
2. Spread the wires apart, but be sure to hold onto the base of the
jacket with your other hand. You do not want the wires to
become untwisted down inside the jacket. Category 5 cable must
only have 1/2 of an inch of 'untwisted' wire at the end; otherwise
it will be 'out of spec'. At this point, you obviously have ALOT
more than 1/2 of an inch of un-twisted wire.
17
CIT 191 MODULE 2
18
CIT 191 COMPUTER LABORATORY I
Exercise 1
Practically implement the cross-wired cable and straight through cable
using clamping tool, and RJ45 connectors.
19
CIT 191 MODULE 2
1.0 INTRODUCTION
At the end of this unit, students should be familiar with the functions of
the following Network device:
3.1 Repeaters
When a signal is sent over a long network cable, signal gets weakened due to
attenuation. This results in some data getting lost in the way. In order to
boost the data signal, Repeaters are needed to amplify the weakened signal.
3.2 Bridges
3.3 Switches
3.4 Hubs
Hubs are multi–port repeaters and as such, they obey the same rule
as repeaters. Hubs are used to provide a Physical Star Topology. They
are also used to interconnect various incoming connections with
different outgoing connections at the Physical layer of the OSI Model.
20
CIT 191 COMPUTER LABORATORY I
3.5 Routers
3.6 Gateway
3.7 Modem
Exercise 2
Identify the following devices and outline two functions for each.
a.
(2 marks)
b.
21
CIT 191 MODULE 2
(2 marks)
c.
22
CIT 191 COMPUTER LABORATORY I
1.0 INTRODUCTION
• Classify of IP address
• D e v e l o p a n d c a l c u l a t e Sub netting
• D e v e l o p a n d c a l c u l a t e Super netting
8 bits (the first decimal number) represent the network part, while the
remaining 24 bits represent the host part. For Class B, the first 16 bits
(the first two numbers) represent the network part, while the remaining
16 bits represent the host part. For Class C, the first 24 bits represent the
network part, while the remaining 8 bits represent the host part.
Consider the following IP addresses:
24
CIT 191 COMPUTER LABORATORY I
25
CIT 191 MODULE 2
Advantage of Supernetting
• It reduces the size of routing updates.
• It provides a better overview of network.
• It decreases the use of resources such as Memory and CPU.
• It decreases the required time in rebuilding the routing tables.
26
CIT 191 COMPUTER LABORATORY I
1.0 INTRODUCTION
In this unit, the computers are connected in LAN by configuring both the
host and client computers considering the following steps:
Note: You can also assign a unique static IP address in the range of
192.168.0.2 to 254. For example, you can assign the following static IP
address, subnet mask, and default gateway:
8. IP Address 192.168.31.202
9. Subnet mask 255.255.255.0
10. Default gateway 192.168.31.1
11. In the Local Area Connection Properties dialog box, click OK.
12. Quit Control Panel.
Exercise 3
Practically implement the connection of client -host computers in a
LAN.
Instructor will inspect each student's LAN implementation. Print and
append output.
28
CIT 191 COMPUTER LABORATORY I
29
CIT 191 MODULE 2
1.0 INTRODUCTION
ping:
ping(8) sends an ICMP ECHO_REQUEST packet to the specified host.
If the host responds, you get an ICMP packet back. Sound strange?
Well, you can “ping” an IP address to see if a machine is alive. If there is
no response, you know something is wrong.
30
CIT 191 COMPUTER LABORATORY I
Tracerout:
Tracert is a command which can show you the path a packet of
information takes from your computer to one you specify. It will list all
the routers it passes through until it reaches its destination, or fails to
and is discarded. In addition to this, it will tell you how long each
'hop' from router to router takes.
nslookup:
Displays information from Domain Name System (DNS) name servers.
NOTE :If you write the command as above it shows as default your pc's
server name firstly.
pathping:
A better version of tracert that gives you statics about packet lost and
latency.
31
CIT 191 MODULE 2
Getting Help
In any command mode, you can get a list of available commands by
entering a question mark (?). Router>?
To obtain a list of commands that begin with a particular character
sequence, type in those haracters followed immediately by the question
mark (?).
Router#co?
configure connect copy
To list keywords or arguments, enter a question mark in place of a
keyword or argument. Include a space before the question mark.
Router#configure ?
memory Configure from NV memory network Configure from a TFTP
network host terminal. Configure from the terminal.
Configuration Files
Any time you make changes to the router configuration, you must save
the changes to memory because if you do not they will be lost if there is
a system reload or power outage. There are two types of configuration
files: the running (current operating) configuration and the startup
configuration.
Switch(config)#hostname CustomerSwitch
Step 2: Configure the privileged mode password and secret.
a. From global configuration mode, configure the password as cisco.
CustomerSwitch(config)#enable password cisco
b. From global configuration mode, configure the secret as cisco123.
CustomerSwitch(config)#enable secret cisco123
32
CIT 191 COMPUTER LABORATORY I
33
CIT 191 MODULE 2
Exercise 4
5 Configure an IP 1.5
address on
interface
VLAN1.
7 Verify the 1
configuration.
34
CIT 191 COMPUTER LABORATORY I
MODULE 3
1.0 INTRODUCTION
These sessions will include learning how to work with graphical objects
in the Visual Basic Environment and using general Visual Basic
Programming concepts.
The application wizard can be selected from the New Project dialog box.
If you cancel the New Project dialog box, and then later want to start the
Application wizard, select File, New Project to display the New Project
dialog box once again. The screen you see looks like that in Figure 1.
35
CIT 191 MODULE 3
Figure 1
When you select the icon labeled VB Application Wizard on the New
tab, the wizard begins its work. The interface type you select will
determine how your application will process multiple windows. See
figure 2.
Figure 2
36
CIT 191 COMPUTER LABORATORY I
Figure 3
You can select the options you want your application’s menu to contain
as shown in Figure 3 above. The options are common Windows options
found on most Windows programs. The ampersand (&) next to a letter
in a menu name indicates the underscored accelerator key letter; in other
words, &New indicates that New appears on the menu and that the use
can select the option by pressing Alt+N.
The next wizard screen, shown in Figure 4, lets you select the toolbar
buttons that your application will have. Click next to accept all the
default toolbar settings.
Figure 4
The next wizard screen to appear is the Resource screen from which you
can select to use resources in your program. The next one is the Internet
Connectivity screen from which you can add an Internet interface to
your program if you want one. The next screen gives the option of
adding one of these standard screens to your application:
37
CIT 191 MODULE 3
You can also select a form template from here. A form template is
model of a form that you can customize.
Click Next to get to the last screen and click the Button labeled Finish
to instruct Visual Basic to complete your initial application.
The New Project window appears, when you first start Visual Basic or
when you select File, New Project. You will always need toolbars in
your project. Visual Basic has a total of four toolbars:
• Debug. This toolbar appears when you use the interactive
debugging tools to trace and correct problems.
• Edit. This toolbar aids your editing of Visual Basic code.
Form Editor. This toolbar helps you adjust objects on forms.
Standard. This toolbar is the default toolbar that appears
beneath the menu bar.
You can display and hide these toolbars from the View, Toolbars menu.
Label boxText
Option
Combo box
buttonList
Horizontal
scrollbar box
Lin
Timer
Figure 5
38
CIT 191 COMPUTER LABORATORY I
Most of your work goes on inside the Form window. You’ll design all
your application’s forms, which are the background windows that your
users see, in the central editing area where the Form window appears.
You can resize the Form window to make the windows you create in
your application as large or small as needed. An application may contain
multiple forms: you can display one or more of those forms in their own
Form window editing areas. Activate a form by clicking a form by
clicking anywhere within the window or on the title bar.
4.0 CONCLUSION
5.0 SUMMARY
(a) The concept of working with graphical objects and the general
Visual Basic Programming concepts.
(b) How to design a project from the application wizard and,
(c) How to use the toolbox.
39
CIT 191 MODULE 3
40
CIT 191 COMPUTER LABORATORY I
1.0 INTRODUCTION
The objective is to enable user gain more mastery of the Visual Basic
programming environment.
• Projects
• Forms
• Modules
• Class modules
• User controls
• User documents
• Property pages
A form can hold many controls. As you add controls to a form, you can
select a control by clicking the control. When you select a control, the
Properties window changes to list every property related to that control.
When you add a control to a Visual Basic application, Visual Basic sets
the control’s initial property values. When you display the Properties
window for a control, you can modify its values. You can do that by
selecting the view option and then Properties window.
Figure 6 shows a Properties window listing some of the properties for a
Label control.
41
CIT 191 MODULE 3
Figure
Example 1
Figure
42
CIT 191 COMPUTER LABORATORY I
While writing your application, you can run the application to see what
you have done by pressing F5.
You need to add some codes to finalize the application. Double click
the form somewhere on the grid inside the Form window to display the
code window. Add the codes shown in Figure 8.
To return to the Form window, click the Project window’s View Object
button.
43
CIT 191 MODULE 3
Figure 3
Run your program and click the command button. An image like that
shown in Figure 7 appears. Save your project and click the Close
window to terminate the program. To save, Select File, Save Project.
The Save Project option saves every file inside your project as well as
a project description file with the filename extension. VBP. Visual
Basic asks first for the filename you want to assign to your form. Visual
Basic then asks first for a project for the project description file.
Answer No if Visual Basic asks to add the project to the Source Safe
library.
Example 2
Figure 4
44
CIT 191 COMPUTER LABORATORY I
Add the following code seen on the screen in Figure 10 to activate the
password- based form:
Figure 5
45
CIT 191 MODULE 3
Figure 6
4.0 CONCLUSION
The project window and the property window are very important to
features of the Visual Basic programming environment that are of
immense importance to the programmer.
5.0 SUMMARY
In this unit we have studied the importance of the project window and
the propertywindow.
Create an application with three multiline text boxes. Make the text
boxes tall enough to display three or four lines of text. Give the first one
a vertical scrollbar, the second a horizontal scrollbar, and the third one
both kinds of scrollbars. In all the three text boxes, supply the default
text “Type here”. In addition to the text boxes, include an Exit
command button, so the user can press Alt+X to terminate program.
46
CIT 191 COMPUTER LABORATORY I
47
CIT 191 COMPUTER LABORATORY I
1.0 INTRODUCTION
One of the basic features of the Graphical User Interface (GUI) is that
enables user to select the operations to be performed through menus
with the aid of the mouse. In this unit students are introduced to the
rudiments of creating a menu application.
The objective of this unit is to enable students learn the steps involved in
creating visual basic applications with menu.
You can generate menus for your applications using the application
wizard. After you click the menu options and submenus you want in
your applications, the Application wizard generates the appropriate
menu controls and places them in the generated application.
The Menu Editor helps you design menus for your applications. In a
way, the Menu Editor acts like a Properties window for the menu bar
because you will designate the names of the menu controls as well as
the captions that the users see on the menus and other related
information from within the Menu Editor.
Menu
properties
Menu control
list box
Figure 1
CIT 191 MODULE 3
A menu bar offers a special kind of control that lets your select options
and issue Menu bar
commands.
Shortcut
Checked option
Figure 2
Example 1
160
CIT 191 COMPUTER LABORATORY I
Figure 3
Guide to solution
To create the menu bar, click the form and press Ctrl+E to display the
Menu Editor.
► Type &File for the Caption field. As with all other Visual Basic
values, the ampersand indicates that the F will be the accelerator
key for the menu selection. As you type the caption, Visual Basic
displays the caption in the Menu control list box in the bottom
half of the Menu Editor.
► Press Tab to move to the Name field. Tab and Shift+Tab shift the
focus between the Menu Editor fields.
► Type mnuFile for the name of the first menu option.
► Leave all other fields alone and click the Next button to prepare
for the remaining menu bar options. The Next button lets the
Menu Editor know that you are through with the first option and
want to enter another.
► Type &Color for the next menu bar caption and type mnuColor
for the name.
► Click Next to add the next item.
► Type &Message for the third and final menu bar caption and
type mnuMessage for the caption. Your Menu Editor should look
like the one in Figure 2.
CIT 191 MODULE 3
Figure 4.
You can either create pull-down menus as build the menu bar or add the
menus later. If you create the complete menu bar first, however as
you’ve done in this exercise, you’ll have to insert the menu options in
their respective locations when you are ready to add them. The Menu
Editor’s Insert button lets you do just that.
Example 2
Add three checked options: Blue, Green, and Red, to the second menu,
Color. These colors will be mutually exclusive; the label will not be able
to be all three colors at once, but only one color at a time. Such colors
make perfect candidates for checked menu options. Your application
should like Figure 17 after running. Also, include a submenu to the
Message menu. Let it contain the checked messages displayed in Figure
18, and include a separator bar as shown.
162
CIT 191 COMPUTER LABORATORY I
Figure 17
Figure 5.
Figure 6
Open the code window and type the code shown in Figures 19 and 20.
The code controls the label’s colour and contents.
Figure 7
164
CIT 191 COMPUTER LABORATORY I
Figure 8
When the application is run, the screens look that those in Figures 4
and 5. For Figure 4, colour blue was selected with the second message
“VB is Simple”.
Figure 9
CIT 191 MODULE 3
Figure 10
4.0 CONCLUSION
5.0 SUMMARY
166
CIT 191 COMPUTER LABORATORY I
1.0 INTRODUCTION
Here, Students will learn more about the Code window, and practice
their programming skills on declaration of data, use of variables of
different data types and use of operators.
The objective of this unit is to enable students learn more about the
code window and gain mastery of how to operate in the code window.
Figure 1 shows the declarations sections in the first set of codes. After
the first wrapper line, there is an event procedure followed by another
one. General-purpose procedures can be meant to perform any kind of
function like computing some data, while event procedures will be
executed after the clicking of a mouse once or twice, the loading of a
form, or any other event.
Figure 1
168
CIT 191 COMPUTER LABORATORY I
Figure 2
Example 1
Write and Run a Visual Basic Program to solve the Quadratic Equation
Problem, ax2+bx+c.
Solution
The code that provides the solution to the problem using the IF- THEN
statement are shown in Figures 3 and 4. This contains statements
explaining most of the basic concepts a beginning VB Programmer
needs to know. The output of the program is displayed in Figure 5. As it
can be seen, key words are in blue, comments are in green while the
other codes are in black.
CIT 191 MODULE 3
Figure 3
Figure
170
CIT 191 COMPUTER LABORATORY I
Figure 5
Figure 6
CIT 191 MODULE 3
Example 2
172
CIT 191 COMPUTER LABORATORY I
5.0 SUMMARY
Using the code window, write a program to display the current time.