Professional Documents
Culture Documents
COMP1 Handouts-1 PDF
COMP1 Handouts-1 PDF
Subject: COMP 1
Descriptive Title: Computer Fundamentals & Programming
Course Description:
The subject covers the fundamentals of a computer, its components,
Windows, and Visual BASIC Programming Languages. It deals with the
understanding of computer, its history, computer hardware, computer software
and the programming concept. The subject teaches the students how to make
programs Visual BASIC Programming Language properly and efficiently.
Credits: 3 units
General Objectives:
1. To establish the basic knowledge about computer, their history and actual
use needed in society
2. To recognize the importance of computer literacy.
3. To manipulate the computer
4. To develop programming skills in Visual Basic
5. To apply basic methods and techniques in software design
Contents
PART 1. COMPUTER FUNDAMENTALS
I. Introduction to Computers
II. Electronic Data Processing Systems
III. Input Devices
IV. Output Devices
V. System and Storage Units
VI. Computer Software
PART 2. PROGRAMMING
VII. Windows Desktop Familiarization
VIII. Introduction to Visual BASIC
IX. Methods and Event Procedures
X. Basic Elements of a Visual BASIC Program
XI. Decision Structures
PART 3. LABORATORY ACTIVITIES
Page 1 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
CHAPTER I
INTRODUCTION TO COMPUTERS
Guide Questions:
1. Do you believe that computers make life easier and better? Explain.
2. List down separately four uses of computers in the home and business.
3. If you were given a chance to become part of the computer history, what would
you contribute? Explain why or how.
4. Do you feel any discomfort or anxiety about computers? Explain why or why not.
Outcomes:
At the end of the Chapter, the students can:
☺ understand fundamental computer concepts
☺ realize the importance of computer literacy
☺ be familiar with the history of computer
☺ find out the reason for the development of computer
☺ name the persons who dedicated their studies in the development of
computers
Pre-Test:
Multiple Choice. Write the capital letter of your answer on the space provided.
____1. The father of modern computer a) Bill Gates b) Carlos Cabbage c)
Charles Babbage d) Howard Aiken
____2. The word for raw material that is given to a computer for processing.
a) data b) information c) list d) output
____3. Apple Company was formed by
a) Gates and Allen b) Jobs and Wozniak c) Eckert & Mauchly
d) Bardeen and Shockley
____4. In 1997, IBM Deep Blue beats ________ in a full chess match
a) Karpov b) Kasparov c) Torre d) Yuri
____5. To place data/information into files a) Classifying b) Duplicating
c) Storing d) Retrieving
1.1. Introduction
A computer is a machine that performs tasks,
such as calculations or electronic communication,
under the control of a set of instructions called a
program. Programs usually reside within the
computer and are retrieved and processed by the
computer’s electronics. The program results are stored
in or routed to output devices, such as video display
monitors or printers. Computers perform a wide variety of activities reliably,
accurately, and quickly. Technically speaking it is an automatic high speed, electronic
Page 2 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
digital device with internal storage, and is controlled by a stored program - a self-
directing digital device because its operations are performed within the system
where it measures quantities in discrete or exact numbers.
People use computers in many ways. In business, computers track inventories
with bar codes and scanners, check the credit status of customers, and transfer
funds electronically. In homes, tiny computers embedded in the electronic circuitry
of most appliances control the indoor temperature, operate home security systems,
tell the time, and turn videocassette recorders (VCRs) on and off. Computers in
automobiles regulate the flow of fuel, thereby increasing gas mileage. Computers
also entertain, creating digitized sound on stereo systems or computer-animated
features from a digitally encoded laser disc. Computer programs, or applications,
exist to aid every level of education, from programs that teach simple addition or
sentence construction to programs that teach advanced calculus. Educators use
computers to track grades and communicate with students; with computer-
controlled projection units, they can add graphics, sound, and animation to their
communications. Computers are used extensively in scientific research to solve
mathematical problems, investigate complicated data, or model systems that are
too costly or impractical to build, such as testing the air flow around the next
generation of aircraft. The military employs computers in sophisticated
communications to encode and unscramble messages, and to keep track of
personnel and supplies.
Page 3 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
(Fig9)
1945 John Von Neumann developed an electronic
computer at the IAS that uses a stored program
concept. (Fig10)
1946 John P. Eckert Jr& John W. Mauchly designs the
ENIAC. (Fig11)
1947 Invention of the Transistor by John Bardeen, Walter Brattain,
William Shockley at Bell Telephone Laboratories. (Fig12) Vacuum Tube
1951 Grace Murray Hopper invented the High level language
compiler.
Page 4 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
(Fig16)
1970 Development of UNIX , LSI chips.
(Fig17)
Fig.9
1971 First microprocessor was made, the
Intel 4004 , Dr. Ted Hoff. (Fig18)
1972 Atari founded
1974 MITS, Inc. developed the Altair, the first personal
computer. (Fig19)
1975 BASIC implemented by Bill Gates and Paul Allen
Fig.10
Fig.12
Fig.14
Fig.11 Fig.18
Fig.15 Fig.16
Fig.17
Fig.19
Fig.13
Page 5 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Fig.38Page 6 of 118
Fig.34 Fig.35 Fig.36 Fig.37
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Fig.39
Page 7 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Page 8 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Post Test.
Multiple Choice. Write the capital letter of your answer on the space provided.
____1. The first microprocessor.
a) Athlon 64 b) Intel Pentium D c) Intel 4004 c) Intel 486
____2. In which of the following areas do you think will the use of computers not be
imperative? a) Law enforcement b) Health and Medicine c) Robots d) None of
the above.
____3. Which of the following device is the most outdated?
a) ABACUS b) APPLE PC c) ENIAC d) PASCALINE
____4. Which of the following is an input device?
a) keyboard b) mouse c) joystick d) all of the above
____5. Which of the following is not a computer.
a) Calculator b) Desktop PC c) Internet Server d) Typewriter
____6. Who was named as the “First Programmer”
a) Ada Byron b) Bill Gates c) George Boole d) George Bush
____7. The first personal computer
a) Altair b) Apple1 c) INTEL 4004 d) Pentium MMX
____8. The first laser printer was developed by
a) AMD b) Apple c) IBM d) HP
____9. The father of Computer Science
a) Alan Turing b) Bill Gates c) Blaise Pascal d) Steven Jobs
____10. Founders of Microsoft
a) Gates and Allen b) Jobs and Wozniak c) Eckert & Mauchly d) Bardeen
and Shockley
Page 9 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
CHAPTER II
ELECTRONIC DATA PROCESSING SYS TEMS
Guide Questions:
1. What are the elements of a computer system? List down at least 3 examples of
each.
2. Differentiate hardware from software.
3. List at least 3 characteristics that make computers indispensable. Explain why.
4. How do you think will the end-user revolution affect the computer industry?
5. Name at least 2 examples of computers according to size.
Outcomes:
At the end of the Chapter, the students can:
☺ recognize the advantages of electronic data processing systems
☺ understand the limitations and failures of computers
☺ differentiate the classifications of computers
☺ distinguish the elements of the computer system
☺ classify computers according to their use
Pre-Test:
Multiple Choice. Write the capital letter of your answer on the space provided.
____1. A microsecond is equal to ________ of a second. a) 1/10 b) 1/1000 c) 1/10000
d) 1/1000000
____2. The physical component of EDP systems a) firmware b) hardware c) peopleware
d) software
____3. Components of third generation computers that makes the computer smaller
and faster: a) integrated circuits b) resistors c) transistors d) vacuum
tubes
____4. Which of the following is the fastest? a) mainframes b) microcomputers
c) minicomputers d) supercomputers
____5. Which of the following is a hardware? a) DOS b) Mouse c) programmer
d) Windows
2.1. Introduction
All through the different stages of civilization, man has tried to look for
ways to simplify work and to solve problems more efficiently. Many problems
involved numbers and quantities, so man started looking for easier ways to
count, and to add, subtract, multiply, and divide then invent the necessary tools
and the rest became history. After electricity powered these tools, then the
electronic data processing (EDP) system or simply the computer system was
realized. Computers exist in a wide range of sizes and power. The smallest are
embedded within the circuitry of appliances, such as televisions and
wristwatches. These computers are typically preprogrammed for a specific task,
Page 10 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Input
Process Output
Storage
Page 11 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
is a Tablet PC, using a digital pen, it allows you to write or draw on the
screen and would issue instructions to the PC by simply tapping the screen.
Smaller than the laptop computers are called the mobile devices. Four popular
types of mobile devices are handheld computers, PDA’s, smart phones, and
smart watches.
Desktop
Notebook Tablet PC
Handheld computers. Sometimes called a handtop computer, is a
computer small enough to fit in one hand. Its capable of communicating
with other handheld computers wirelessly and includes a digital pen or
stylus for input.
PDA(Personal Digital Assistant). One of the more popular lightweight
mobile devices in use today. It provides personal organizer functions such
as a calendar, appointment book, address book, calculator, notepad,
word processing, spreadsheet, personal finance, and games. Many PDA’s
are internet-enabled, supports voice input and provides telephone
capabilities.
Smart Phone. Offering the convenience of one-handed operation, a
smart phone is an internet-enabled telephone that usually also provides
PDA capabilities, color screens, play music, radio capable, and include
built-in cameras so you can share photographs or videos with others as
soon as you capture the image.
Smart Watch. An internet-enabled watch. In addition to
basic timekeeping capabilities, a smart watch
automatically adjusts to time zone changes, store personal
messages, appointment reminder, wirelessly accesses
news, weather, sports and stocks.
Midrange Server
Midrange Servers. More powerful and larger than a
workstation computer. It typically supports several hundred
and sometimes up to few thousand connected computers at
the same time. Used to store data and programs where in
most cases another server or a personal computer is used
access these stored data.
Page 12 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Supercomputer
Page 13 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
the mistakes were not the fault of the computers themselves. It is true that
there are sometimes equipment failures, but most errors supposedly made
by the computers are “human errors”.
3. Automatic Operation. A computer can carry out a sequence of many data
processing operations without human intervention. The various operations
are executed automatically by way of a stored computer program.
4. Decision Making Capability. A computer can perform certain decision
instructions automatically. It can determine whether a certain statement is
true or false, or could even determine the course of action out of alternatives
included in the computer program.
5. Compact Storage. Computer systems are able to store tremendous amounts
of data, which can be retrieved quickly and efficiently.
6. Communications. Most computers today can communicate with other
computers, often wirelessly. Computers with this capability can share any of
the four information processing cycle operations – input, process, output,
and storage- with another computer or user.
Page 14 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
4. Improper Controls
5. Lack of standard
6. Lack of adequate manufacturer support
2.7. Elements of Computer System
1. Hardware. These are equipment involved in the function of a computer.
Computer hardware consists of the components that can be physically
handled. The function of these components is typically divided into four main
categories: input, processing, output, and storage. Components in these
categories connect to microprocessors, specifically, the computer's central
processing unit (CPU), the electronic circuitry that provides the computational
ability and control of the computer. Although microprocessors are still
technically considered to be hardware, portions of their function are also
associated with computer software.
2. Software. These are set of instructions a computer uses to manipulate data,
such as a word-processing program or a video game, also computer
instructions that cause the hardware—the machines—to do work. Software as
a whole can be divided into a number of categories based on the types of work
done by programs. These programs are usually stored and transferred via the
computer's hardware to and from the CPU. Software also governs how the
hardware is utilized; for example, how information is retrieved from a storage
device.
3. People. The term “peopleware” represents the personnel involved in the
function of the computer. Computer professionals are referred to as those
persons involved in system analysis, maintenance, production, programming,
and the like. Computer users that utilize an existing computer using a program
are termed as end-users.
Page 15 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Post-Test.
Multiple Choice. Write the capital letter of your answer on the space provided.
____1. The cause/s of computer anxiety: a) age b) communication gap c) improper
controls
d) all of the above
____2. In electronic data processing, a computer is considered to be _____ accurate.
a) 20% b) 50% c) 75% d) 100%
____3. A PDA is a _______: a) Microcomputer b) Minicomputer c) Mainframe d)
Supercomputer
____4. GIGO means _______ a) Go-In, Go-Out b) Garbage-In, Garbage-Out c) Go-
Input, Go-Output d) Get-In, Get-Out
____5. In electronic data processing, _____ are the physical elements. a) Firmware
b) Hardware c) Peopleware d) Software
____6. Which is not a computer classification? a) maxicomputer b)
microcomputer c) minicomputer c) mainframe
____7. Which is not a computer limitation? a) Dependent on programs and/or
instructions
b) Cannot by itself generate information c) Cannot correct wrong
instructions d) none of the above
____8. How many Hz are there in 2.6 GHz? a) 2.6 b) 2,600 c) 2,600,000
d) 2,600,000,000
____9. Which of the following is not an advantage of a computer?
a) accuracy b) compact storage c) sensitive d) speed
____10. The computer to which a user’s computer connects to access the Internet:
a) server b) supercomputer c) notebook d) PDA
Page 16 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
CHAPTER III
INPUT DEVICES
Guide Questions:
1. What is Input?
2. How do pointing devices work?
3. What are various types of scanners and reading devices, and how do they work?
4. List down the benefits of source data automation devices.
5. What are biometric devices?
Outcomes:
At the end of the Chapter, the students can:
☺ define input
☺ differentiate the common computer input devices and peripherals
☺ list down the characteristics of a keyboard
☺ summarize how various pointing device work, and
☺ discuss various scanners and reading devices and how they work.
Pre-Test:
Multiple Choice. Write the capital letter of your answer on the space provided.
____1. Which of the following is not an input device a) mouse b) OMR c) RAM
d) Scanner
____2. Which of the following is not a source data automation device?
a) MICR b) OCR c) OMR d) touch screen
____3. A series of instructions that tells a computer what to do and how to do it is
called a ____. a. program b. command c. user response d. processor
____4. Pressing the ____ key displays the Windows Start menu. a. APPLICATION b.
NUM LOCK c. WINDOWS d. ALT
____5. The process of transferring copies of the images from the digital camera to the
computers' hard disk is called ____. a. fetching b. uploading c. pulling
d. downloading
3.1. Introduction
Input is any data and instruction entered into the memory of the computer.
Data as input is a collection of unprocessed text, numbers, images, audio, and
video. An input device is any hardware component that allows users to enter
data and instruction from the user to the computer. Input in this category
includes bar codes, speech that enters the computer through a microphone and
data entered by means of a device that converts motion to on-screen action.
Page 17 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
0 Mouse – A pointing device that fits under the palm of your hand
comfortably. The mouse is the most widely used pointing device on
desktop computer. The rolling movement causes a corresponding
movement of the pointer on the screen. Moving the mouse and then stick Touchpad
clicking it at the desired location on the screen allows you to
reposition the pointer, or the cursor. The process of
communicating with the computer by clicking on the objects on
the desktop is referred to as graphical user interfacing. Light pen
Types of mouse
1. Mechanical mouse - has a rubber ball on its underside.
2. Optical mouse – uses a device that emits and sense light to
detect the mouse’s movement. Some uses optical
sensors, others use a laser.
0 Trackball – an upside-down mechanical mouse where you roll
the ball directly with your hand. Often built in on portable
computers when there is no flat surface to roll the traditional
mouse. A variation of this theme is the track pad, with
your finger as the pointer.
0 Touchpad – a small, flat, rectangular pointing device
that is sensitive to pressure and motion. To move the
pointer using a touchpad, slide your fingertip across the
surface of the pad.
0 Pointing Stick – a pressure-sensitive pointing device
shaped like a pencil eraser that is positioned between keys on a keyboard. To
move the pointer, you push the pointing stick with a finger, the pointer on the
screen moves in the direction you push the pointing stick.
Page 18 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
0 Light Pen – a handheld input device that can detect the presence of light.
Some light pens requires a specially designed monitors while others work with
a standard monitor. To select objects on the screen, a user presses the light
pen against the surface of the screen or points the light pen at the screen and
then presses a button on the pen.
0 Touch Screen and Touch Sensitive Pads – a touch-sensitive
display device. Users can interact with these devices by
touching areas of the screen. The edges of a touch screen emit
horizontal and vertical beams of light that crisscross the
screen. When a finger touches the screen, the interrupted
light beams can pinpoint the location selected on the screen.
0 Pen Input – mobile users often enter data and instructions with a pen-type
device. With pen input, users write, draw, and tap on a flat surface to enter
input. The surface may be a monitor, a screen, or a special type of paper. Two
devices for pen input are the stylus and digital pen. A stylus is a small metal or
plastic device that uses pressure instead of ink. A digital pen is slightly larger
than a stylus, some are pressure-sensitive; others have built-in digital cameras.
stylus
digital pen
digitizer
Page 19 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
to accepts the spoken word through a microphone and converts it into binary
code(0s and 1s) that can be understood by the computer. Typical users are the
disabled, those with “busy hands” or hands too dirty for the keyboard, and
those with no access to a keyboard.
0 Audio Input. Voice input is part of a larger category of input
called audio input. Audio input is the process of entering any
sound into the computer such as speech, music, and sound
effects. Users enter sound into a computer via devices such
as microphones, tape players, CD/DVD players, or radios, DV Camera
each of which plugs in a port on the sound card.
3.5. Video Input
The process of capturing full-motion images and storing them on a
computer’s storage medium such as hard disk or DVD.
0 Digital Video (DV) Camera. Captures and records video digital signals. Most DV
cameras can capture still frames, as well as motion.
0 PC Video Camera – a type of digital video camera that enables a
home or small business user to capture video and still images, send e-
mail messages with video attachments, add live images to instant
messages, broadcast live images over the Internet, and make video telephone
calls.
Web Cam – any video camera that displays its output on a web page. A Web
cam attracts web site visitors by showing images that change regularly.
Video Conferencing – A video conference is a meeting between two or more
geographically separated people who use a network or the internet to
transmit audio and video data. To participate in a video conference, you
need a video conferencing software along with a microphone, speakers,
and video camera attached to a computer.
Page 20 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
OPTICAL READERS
An optical reader is a device that uses a light source to read characters,
marks, and codes and then converts them into digital data that a
computer can process.
Wand Reader
0 Optical Mark Recognition(OMR) – a technology that reads
hand-drawn marks such as small circles or rectangles. RFID tags
Page 21 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
MICR Reader
0 Bar Code Reader – Also called a bar code scanner. Each product on Bar Code
the store shelf has its own unique number, which is part of the
Universal Product Code(UPC). This code number is represented on
the product label by a pattern of vertical
marks, or bars, called the bar code. These
zebra stripes can be sensed and read by a bar
code reader, a photoelectric device that reads 2D Bar Code
Page 22 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Hand Geometry System. Measures the shape and size of a person’s hand.
Iris Recognition System. A camera is used to read pattern in the iris of the eye.
This type of recognition system are quite expensive and are used by
government security organizations, the military, and financial institutions that
deal with highly sensitive data.
Page 23 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Post-Test
Multiple Choice. Write the capital letter of your answer on the space provided.
____1. A bar code reader is an example of: a) processing device b) input device
c) storage device d) output device
____2. A(n) ____ is a key that switches between two letter case states each time a user
presses the key. a. function key b. toggle key c. Shift key d. ALT key
____3. The technology that involves reading typewritten, computer-printed, or hand
printed characters from ordinary documents and translating the images into a
form the computer can process is called ____. a. OCR b. MICR c. UPC
d. OMR
____4. An input device that translates the motion of a ball rolled on a flat surface to the
screen is a: a) bar code reader b) keyboard c) mouse c) wand reader
____5. The ____ mouse operation will display a shortcut menu. a. click b. right-click
c. double-click d. triple-click
____6. To transfer recorded images to a hard disk or CD or DVD, users connect DV
cameras directly to a USB port or a ____ port on the system unit. a. FireWire
b. serial c. parallel d. SCSI
____7. High security areas use ____. a. fingerprint scanners b. hair recognition
systems c. iris recognition systems d. signature verification systems
____8. A mouse with a rubber or metal ball on its underside is called a(n) ____.
a. optical mouse b. mechanical mouse c. trackball d. cordless mouse
____9. Tablet PCs use a pressure-sensitive ____. a. digital pen b. trackball c.
touchpad d. pointing stick
____10. ____ scanners are very expensive and are often used in the publishing
industry. a. Flatbed b. Drum c. Pen or handheld d. Sheet-fed
Page 24 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
CHAPTER IV
OUTPUT DEVICES
Guide Questions:
1. What are the four categories of Output?
2. What are LCD monitors, LCD screens, Plasma monitors and HDTVs?
3. What are the advantages of non-impact printers? What are the advantages of
impact printers?
4. What are softcopy outputs?
5. Imagine that you are buying a personal computer. What output device would
you choose and why?
Outcomes:
At the end of the Chapter, the students can:
☺ describe the four categories of output
☺ explain the relationship of graphic chips and monitors
☺ differentiate between a non-impact printer and an impact printer
☺ recognize the terminologies used in identifying computer monitor
specifications
☺ describe various ways to print
Pre-Test:
Multiple Choice. Write the capital letter of your answer on the space provided.
_____1. Individually illuminated dots on a cathode ray tube or a liquid crystal
display device: a) bit b) digit c) pixel d) resolution
_____2. Speakers and ____ are two commonly used audio output devices.
a. woofers b. microphones c. headsets d. monitors
_____3. Laser printers use a powdered ink called ____. a. wax b. toner c. dye d.
pigment
_____4. ___ printing devices transmit output to a printer via radio waves. a.
Infrared b. Laser c. Bluetooth d. Large-format
_____5. Any hardware component that conveys information
to one or more people is considered a(n) ____
device. a. output b. storage c. communications
d. input
4.1. Introduction
Output is data that has been processed into a Plasma Monitors
useful form. A computer generates several types of
output depending on the hardware and software being
used and the requirements of the user. A user
encounters four basic categories of output: text,
graphics, audio, and video. Output hardware consists of
external devices that transfer information from the
LCD Monitors
Page 25 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Page 26 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
screen used for graphics is divided into dots which can be illuminated
individually on the screen called pixel. The resolution of the screen-its clarity-
is directly related to the number of pixels on the screen: The more pixels, the
higher the resolution.
Color Screen Standards
CGA(color graphics adapter) –320 X 200 pixels
EGA(enhanced graphics adapter) –640 X 350 pixels
VGA(video graphics adapter) –640 X 480 pixels
SVGA(super VGA) –800 X 600 pixels or
1024 X 768 pixels
0 Data Projectors – a device that takes the text and images displaying on a
computer screen and project them on a larges screen so an audience can see
the image clearly. Used for displaying computer images (data) as well as video
from a VCR, VHS, VCD, DVD player, Computer, or a Video Camera. There are 2
types of smaller, lower cost projectors, the LCD(Liquid Crystal Display) and the
DLP(Digital Light Processing) projectors.
0 Rear projection screens - used in higher lighting conditions since the projector
is behind the screen usually in a small room or large closet along with any
other associated equipment. Rear projection screens also are used in higher
lighting conditions since the projector does not have to "fight the light". Rear
screens can also be integrated into a housing much like large screen televisions
used in a home.
0 SMART Boards are Interactive whiteboards. SMART Boards get hooked up to a
computer and the computer saves the information written on the board.
SMART Boards when used with a multimedia projector allows the user to
control the computer and all of its programs by simply touching the board.
SMART Boards also allow for users to write and annotate on top of any
application even the web.
4.3. Printers
An output device that produces text and graphics on a physical medium
such as paper or transparency film. Printed information, called hard copy,
exists physically and is a more permanent form of output than presented on a
display device(softcopy).
0 Impact Printers – uses some sort of physical contact with the paper to produce
Impact Printer
an image, by physically striking the paper, ribbon, and hammer
Photo Printer
or tiny wire pins together
Line Printers. A high speed impact printer that prints an
entire line at a time. Mainframes, midrange servers, or
network applications, such as manufacturing, distribution, Line Printer
or shipping, often use line printers. It typically use 11x17 inches
continuous-form paper.
Page 27 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Page 28 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Speakers
Headsets
Fax Machine
Multifunction Peripheral
Page 29 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Post-Test
Multiple Choice. Write the capital letter of your answer on the space provided.
____1. Given the same computer time, which of the following output device consumes
the least power? a) CRT Monitors b) LCD Monitors c) Plasma Monitors d)
Smart Boards
____2. Which of the following can store the most data?
a) 3.5” floppy disk b) cassette tape c) hard disk d) optical disk
____3. Which of the screen standard has the highest resolution?
a) CGA b) EGA c) SVGA d) VGA
____4. The core of a CRT monitor is a(n) ____. a. LCD monitor b. high-definition
television c. active-matrix monitor d. cathode-ray tube
____5. A single device that looks like a copy machine but provides the functionality of a
printer, scanner, copy machine, and perhaps a fax machine is called a ____. a.
total printer b. subwoofer c. multifunction peripheral d. master printer
____6. A(n) ____ boosts low bass sounds. a. subwoofer b. headset c. microphone
d. internal speaker
____7. Sophisticated printers used to produce high-quality drawings such as blueprints,
maps, and circuit diagrams are called ____. a. laser printers b. plotters c.
thermal printers d. line printers
____8. ____ devices display information in one color on a different color background.
a. Unichrome b. Monochrome c. Color d. LCD
____9. LCD monitors are also called ____. a. plotters b. flat panel monitors c. HDTV
(high-definition television) monitors d. gas plasma displays
____10. Print Orientation where the shorter side of the paper is on the sides. A)
portrait b) landscape
Page 30 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
CHAPTER V
SYSTEM AND STORAGE UNITS
Guide Questions:
1. Describe the Central Processing Unit.
2. What are the components of a processor, and how do they complete a machine
cycle?
3. What is the unit of the speed of computer processor?
4. What are the various type of memory?
5. What is a bit?
6. Imagine that you are buying a personal computer. What specification of the
processor and its hard disk would you choose and why?
Outcomes:
At the end of the Chapter, the students can:
☺ identify the parts of the system unit
☺ differentiate various personal computer processors on the market today
☺ differentiate storage device and storage media
☺ recognize the terminologies used in identifying computer storage
specifications.
☺ describe the characteristics of optical discs.
Pre-Test:
Multiple Choice. Write the capital letter of your answer on the space provided.
____1. ____ loses its contents when the computers power is turned off. a. ROM
b. Flash memory c. Nonvolatile memory d. Volatile memory
____2. The case of the system unit is sometimes called the ____. a. processor
b. chassis c. motherboard d. control unit
____3. The number system that has just two unique digits, 0 and 1, is called the ____.
a. digital system b. bit system c. analog system d. binary system
____4. The new ____ processor integrates the functions of a processor, memory, and
video card on a single chip. a. microprocessor b. power processor c. system
on a chip d. multimedia processor
____5. Optical discs used in personal computers are ____ inches in diameter. a. 3.5
b. 4.75 c. 5 d. 8
5.1. Introduction
The system unit is a case that contains electronic components of the computer
used to process data. System units are available in a variety of shapes and sizes. The
case of the system unit, sometimes called the chassis, is made of metal or plastic
and protects the internal electronic components from damage. The storage unit
holds data, instructions, and information for future use. Every computer uses
storage to hold system software and application software. A storage medium, also
Page 31 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
called secondary storage, is the physical material on which a computer keeps data,
instructions and information.
System Unit
Motherboard
Page 32 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Page 33 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Page 34 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Storage Terms:
BIT – smallest unit of information
BYTE – a collection of bits
WORD – collection of bytes
1 Byte = 8 bits of binary nos.
Term Approx. # of bytes Exact # of bytes Approx. # of
pages of text
Kilobyte(KB) 1 thousand 210 or 1,024 ½
Megabyte(MB) 1 million 220 or 1,048,576 500
Gigabyte(GB) 1 billion 230 or 1,073,741,824
Terabyte(TB) 1 trillion 240 or 1,099,511,627,776
Petabyte(PB) 1 quadrillion 250
Exabyte(EB) 1 quintillion 260
Zettabyte(ZB) 1 sextillion 270
Yottabyte(YB) 1 septillion 280
Page 35 of 118
Optical Disks
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Magnetic/Cassette
Tape. Magnetic coated
ribbon of plastic capable
of storing large amounts
Compact Flash Memory Stick
SmartMedia Secure Digital xD Picture Card
of data and information at a low cost. A tape cartridge is a
small, rectangular, plastic housing for tape.
PC Cards. A thin, credit card-sized device that adds memory, USB Flash Drive
storage, sound, fax/modem, network, and other capabilities
to mobile computers
Flash Memory Cards. A removable flash
memory device that allows user to transfer
data and information conveniently from mobile
devices like PDAs, smart phones, digital microfilm
cameras and digital music players to desktop computers.
USB Flash Drives. Sometimes called a pen drive, is a flash Microfilm reader
memory device that plugs in a USB port on a computer or portable device.
Microfilm and Microfiche. Store microscopic images of documents on roll or
sheet film. Microfilm is a 100 to 215 foot roll of film. Microfiche is a small
sheet of film, usually about 4 inches by 6 inches. A computer output
microfilm recorder is the device that records the images on the film.
Solid State Drive (SSD) is a storage device
that typically uses flash memory to store
data, instructions, and information. With
available form factors of 3.5 inches,2.5
inches, and 1.8 inches, SSDs are used in all
types of computers including servers,
Page 36 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Post-Test
Multiple Choice. Write the capital letter of your answer on the space provided.
____1. 1 byte = _____ bits: a) 0 b) 8 c) 80 d) 1024
____2. An example of storage unit: a) CPU b) Scanner c) spreadsheet d) DVD
____3. Another name for memory is: a) Secondary storage b) Primary storage
c) disk storage d) tape storage
____4. The CD-ROM is an example of: a) software b) hardware c) a program d) an
output unit
____5. The unit that transform data into information:
a) CPU b) disk drive c) bar code reader d) wand reader
____6. Which of the following can store the most data?
a) 3.5” floppy disk b) cassette tape c) hard disk d) optical disk
____7. PC Cards commonly are used in ____. a. midrange servers b. notebook
computers c. mainframe computers d. supercomputers
____8. A ____ is an erasable multisession disc you can write on multiple times. a. CD-
ROM b. CD-R c. CD-RW d. DVD-ROM
____9. Storage media are sometimes referred to as ____. a. primary storage b.
storage drives c. secondary storage d. RAM
____10. Devices such as a keyboard and mouse usually attach to ____ on the
system unit by a connector on a cable. a. processors b. ports c. adapter cards
d. drive bays
Page 37 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
CHAPTER VI
INTERNET AND COMPUTER SOFTWARE
Guide Questions:
1. When people call software user-friendly, what do they mean?
2. Name at least three things a computer program should be able to do.
3. Why is writing instructions for a computer more difficult than writing
instructions for a person?
4. Is e-mail important on your part as student? Discuss your answers in detail.
5. What is the main reason for having an operating system?
6. Is Internet important to you? Explain why or why not.
Outcomes:
At the end of the Chapter, the students can:
☺ understand the internet and its use
☺ identify programs installed in the computer
☺ categorize the different computer software installed in a computer
☺ explain ways software is distributed
☺ identify the key features of widely used home, personal, and educational
programs, and
☺ understand the anatomy of an e-mail address
Pre-Test:
Multiple Choice. Write the capital letter of your answer on the space provided.
____1. One is not a system software: a) Defragmenter b) DOS c) FIXDISK d) Solitaire
____2. An application software used to create graphs and charts
a) Computer Aided Design b) Database c) Spreadsheet d) Word Processor
____3. A software that converts high-level language programs to machine language:
a) compiler b) debugger c) scanner d) translator
____4. As of 2004, the world’s #1 software company is: a) Intel b) Microsoft c)
Oracle d) Sun
____5. In the internet, .com means: a) company b) commerce c) commercial d)
command
6.1. Introduction
One of the major reasons business, home, and other users purchase
computers is for Internet access. The Internet is a widely used research tool,
providing society with access to global information and instant communications.
Further, access to the Internet can occur anytime from a computer anywhere: at
home, at work, at school, in a restaurant, on an airplane, and at a park. The
Internet, also called the Net, is a worldwide collection of networks that links
millions of businesses, government agencies, educational institutions, and
individuals. Each of the networks on the Internet provides resources that add to
Page 38 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
the abundance of goods, services, and information accessible via the Internet.
Today, more than one billion home and business users around the world access a
variety of services on the Internet, some of which are shown in Figure 2-1. The
World Wide Web, or simply the Web, and e-mail are two of the more widely
used Internet services. Other services include chat rooms, instant messaging,
and VoIP (Voice over Internet Protocol). To enhance your understanding of these
Internet services, the chapter begins by discussing the history of the Internet and
how the Internet works and then explains each of these services.
With the proper software, a computer is a valuable tool. Software is a set
of instructions a computer uses to manipulate data, such as a word-processing
program or a video game. These programs are usually stored and transferred via
the computer's hardware to and from the CPU. Software also governs how the
hardware is utilized; for example, how information is retrieved from a storage
device. There are two basic types of software: system software and application
software. Once a computer has system software, application software can be
added. Application software allows you to apply the computer to solve a specific
problem or perform a specific task.
6.2. The Internet
It is a computer-based global information system. The Internet is composed
of many interconnected computer networks. Each network may link tens,
hundreds, or even thousands of computers, enabling them to share information
with one another and to share computational resources such as powerful
supercomputers and databases of information using a protocol or
communication rules called TCP/IP (Transmission Control Protocol/Internet
Protocol). The Internet has made it possible for people all over the world to
effectively and inexpensively communicate with one another. Unlike traditional
broadcasting media, such as radio and television, the Internet does not have a
centralized distribution system. Instead, an individual who has Internet access
can communicate directly with anyone else on the Internet, make information
available to others, find information provided by others, or sell products with a
minimum overhead cost.
The Internet is not a place nor a company nor a computer program.
Rather, the Internet is a free-for-all of people, businesses and organizations who
have linked their computers together by cables, telephone lines, and satellites.
Current estimates place that the Internet has about 30, 000 networks, and 7
million hosts. One and all these people contribute in making the Net a
repository of data, programs, utilities and information for everybody on
everything and any topic under the sun. As the Internet grows, people have
created many different ways to use it to share information to the world. The
World Wide Web is an important part of the Internet. The Web has received so
much attention that in the minds of some, it has become synonymous with the
Internet. However, it is important to note that the Web is not the Internet, but
merely a resource that is available via the Internet.
Page 39 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
To go to a specific page
Standard URL format: http://www.domain_name.domain name
Example 1: http://www.yahoo.com
Example 2: http://www.wit.edu.ph
Meaning:
http – HyperText Transport Protocol
- identifies the Web site as one on the WWW using HTML.
:// - alerts the browser that the next words will be the actual URL,
which is broken up by periods (.) each referred to as dot.
www - identifies the site as part of the World Wide Web
yahoo or wit - this is the domain name – a unique name that must be
registered with the company called Network Solution.
com/edu - this is the top-level domain name – com for commercial, edu
for education
ph - geographic zone name for Philippines
6.4 The World Wide Web
Although many people use the terms World Wide Web and Internet
interchangeably, the World Wide Web actually is a service of the Internet. While the
Internet was developed in the late 1960s, the World Wide Web emerged in the early
1990s. Since then, it has grown phenomenally to become one of the more widely
used Internet services. The World Wide Web (WWW), or Web, consists of a
worldwide collection of electronic documents. Each electronic document on the
Web is called a Web page, which can contain text, graphics, animation, audio, and
video. Additionally, Web pages usually have built-in connections to other
documents.
6.5 E-Mail
Page 40 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
E-mail (short for electronic mail ) is the transmission of messages and files via a
computer network. E-mail was one of the original services on the Internet, enabling
scientists and researchers working on government-sponsored projects to
communicate with colleagues at other locations. Today, e-mail is a primary
communications method for both personal and business use. You use an e-mail
program to create, send, receive, forward, store, print, and delete e-mail messages.
Outlook and Windows Live Mail are two popular desktop e-mail programs; Gmail
and Windows Live Hotmail are two popular free e-mail Web applications.
6.8 Netiquette
Netiquette, which is short for Internet etiquette, is the code of acceptable behaviors
users should follow while on the Internet; that is, it is the conduct expected of
individuals while online. Netiquette includes rules for all aspects of the Internet,
including the World Wide Web, e-mail, instant messaging, chat rooms, FTP, and
newsgroups and message boards. The following outlines some of the rules of
netiquette.
Netiquette
1. In e-mail, chat rooms, and newsgroups: • Keep messages brief. Use proper
grammar, spelling, and punctuation.
• Be careful when using sarcasm and humor, as it might be misinterpreted.
• Be polite. Avoid offensive language.
• Read the message before you send it.
Page 41 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Classification of Software
6.9. SYSTEM SOFTWARE
Set of programs prepared by the manufacturer to facilitate operation of
the computer by the user. System software handles such essential, but often
invisible, chores as maintaining disk files and managing the screen, whereas
application software performs word processing, database management, and the
like. It serves as an interface between the user, the application software, and the
computer hardware.
Operating Systems Program. A program which has the ultimate control of
all operations of the system, it manages and control the activities of a
computer. It is the most important piece of software in a computer system,
without it, the computer cannot function.
Functions of an Operating System
1. Allocating and assigning system resources.
2. Scheduling operations
3. Monitoring system activities
Categories of Operating Systems
Stand-alone Operating Systems.
Disk Operating System, DOS –(Microsoft)
Page 42 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Windows (Microsoft)
Windows 8
Windows 7
Windows VISTA
Windows XP Home Edition
Windows XP Professional
Windows XP Media Center Edition
Windows XP Tablet PC Edition
Windows XP 64-bit Edition
Windows 2000 Professional
Windows Millennium Edition
Windows 98
Windows 95
Windows 3.x
Mac OS X (Apple)
UNIX
Linux
Network Operating Systems.
Netware(Novell)
Windows Server 2003(Microsoft)
UNIX
Linux
Solaris(Sun Microsystem)
Embedded Operating Systems
Windows CE
Windows Mobile
Palm OS
Symbian OS
Page 43 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Page 44 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Page 45 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Programming Cycle
Post-Test
Multiple Choice. Write the capital letter of your answer on the space provided.
______1.Geographical zone name of Philippines in the Internet is: a) .fi b) .fil c)
.ph d) .ps
______2.Making illegal copies of copyrighted software is called:
a) software piracy b) browsing c) collaboration d) electronic distribution
______3.Raw data is processed by the computer into:
a) number sheets b) paragraphs c) updates d) information
______4.Software used to access the Internet: a) browser b) web c) server
d) e-mail
______5.Step-by-step instructions that directs the computer:
a) hardware b) CPU’s c) documents d) programs
______6.The CPU is an example of: a) software b) hardware c) a program d) an
output unit
______7.The only language the computer can understand: a) Assembly Language
b) English Language c) High-Level Language d) Machine Language
______8.The underlying software: a) application b) operating system c)
groupware d) shareware
______9.When preparing an office memo, use a ___ software:
a) CAD b) Database c) Desktop Publishing d) Word Processing
______10. Which of the following is not an operating system?
a) DOS b) Linux Kernel c) MS Word 2000 d) Windows 95
Page 46 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
CHAPTER VII
WINDOWS DESKTOP FAMILIARIZATION
Guide Questions:
1. List down at least 5 special keys found on the keyboard and explain their uses.
2. What do you think is the main reason why mouse was conceived? Explain your
answer.
3. Awareness, Knowledge and Interaction are the three components of computer
literacy. Discuss why these three should be present in you.
Outcomes:
At the end of the Chapter, the students can:
☺ recognize the parts and usage of the mouse and computer keyboard
☺ use the Windows Operating System
☺ identify the elements of the Windows Desktop and its components
☺ identify the elements of a window
☺ use the accessories programs in Windows
Pre-Test:
Multiple Choice. Write the capital letter of your answer on the space provided.
____1. Pictorial representation of files and programs in a GUI programs
a) buttons b) forms c) icon d) menu
____2. Who developed the QWERTY keyboard? a) Christopher Sholes b) Howard Aiken
c) James Qwerty d) Walter Brattain
____3. A standard equipment included by IBM and Apple to computer design for
graphic user interface. a) disk drives b) keyboard c) mouse d) optical disk
____4. A type of icon that represents area for stored files such as documents, graphics
and programs. a) document b) folder c) original d) program
____5. A window displayed by the computer used to solicit response from the user.
a) dialog box b) menu bar c) program d) splash screen
7.1. INTRODUCTION
Familiarization is one vital issue one must consider in mastering computer
utilization. Exposure to the computer environment necessitates the user’s
acquaintance with the computer. With the advent of GUI(Graphic User Interface),
where the screen display is in the format that enables the user to choose
commands, start programs, and see lists of files and other options by pointing to
pictorial representations (icons) and lists of menu items on the screen by using the
GUI device called mouse, computer interaction has been trouble-free as a result of
its user-friendly environment. Most personal computers (PCs) include a keyboard
because it is easy to use and efficient for everyday tasks such as word processing. A
mouse is another input devices that help the user point, select, and move objects on
a video display monitor. The proper use of the computer keyboard and mouse is
discussed in this chapter.
Page 47 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
7.3. MOUSE
A common pointing device was
LEFT BUTTON
popularized by its inclusion as
standard equipment with the Apple RIGHT BUTTON
Macintosh and IBM computers. The MOUSE
basic features of a mouse are a casing
MOUSE PAD
with a flat bottom, designed to be
gripped by one hand; one or more buttons at the Mouse and its parts
top; a multidirectional detection device (usually a ball) at
the bottom; and a cable connecting the mouse to the computer. By moving the
mouse on a surface (such as a desk), the user typically controls an on-screen cursor.
A mouse is a relative pointing device because there are no defined limits to the
mouse's movement and because its placement on a surface does not map directly to
Page 48 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
a specific screen location. To select items or choose commands on the screen, the
user presses one of the mouse's buttons, producing a “mouse click”.
Parts of a Mouse
A. Left button
B. Right button
Mouse Operations
A. Point - moving the mouse around the mouse pad and the
positioning of the mouse pointer on the text, programs or
icons on the monitor .
B. Click of left click - the quick press and release of the left mouse button.
C. Right click - the quick press and release of the right mouse button.
D. Double Click - The quick press and release of the left mouse button twice
in rapid succession.
E. Drag - to press and hold the left mouse button at the same time
moving the mouse around the mouse pad.
7.4. WINDOWS OPERATING SYSTEM
Personal computer operating system sold by Microsoft Corporation allows
users to enter commands with a point-and-click device, such as a mouse, instead of
a keyboard. An operating system is a set of programs that controls the basic
functions of a computer. The Windows operating system provides users with a
graphical user interface (GUI), which allows them to manipulate small pictures,
called icons, on the computer screen to issue commands. Windows is the most
widely used operating system in the world. It is an extension of and replacement for
Microsoft’s Disk Operating System (MS-DOS).
Versions released by Microsoft( as of 2014)
Icons
1. Windows 3.11
Desktop
2. Windows 95
3. Windows 98 Mouse Pointer
4. Windows CE Start
5. Windows 2000
Taskbar
6. Windows ME
7. Windows NT Clock
8. Windows XP
9. Windows Vista
Windows Desktop
10. Windows 7
11. Windows 8
Page 49 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
desk. Items on your desktop can be moved, thrown away, or placed in folders to
work with later. The desktop can be arranged to contain the items that you use
most frequently. For example, if you work on a weekly report, that document can
be accessed easily if you place it directly in your desktop.
Icons. Symbols or pictures that represent items stored on your computer.
Sample icons include folders (directories or groups), documents,
programs, and even computer hardware.
Folder icons Document icons Program icons Original icons
Taskbar
Start button. This button is used to open the start menu, which provides
you with access to applications or documents, Help, the Find feature, and
the Control Panel settings.
Clock. A clock displays on the right of your Taskbar. If you hold your
mouse pointer over clock, the current date displays.
Page 50 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Parts of a window
Folder window
Since all windows have essentially the same parts,
Types of Windows
once you learn to work with one window you are able to
work with all windows. If you use Windows or the
Macintosh operating system, you should be familiar with the basic concepts of a
window.
Title Bar. The title bar is at the top of the window; it displays the
document, program, or folder name, along with the name of the
application that is open (in program windows only). The title bar also tells
you which window is “active.” The title bar of the active window on your
desktop is blue; all other windows will have gray title bars. Even though
you may have more than one window open on your desktop, you can only
work with one at a time. The one you are working with is the “active”
window. You can make a window “active” by clicking any place on the
window.
Window buttons. The title bar also displays three small buttons on the
right of the title bar, which change the display of the window; the
minimize, maximize, and close buttons.
Page 51 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Minimize button
When you click the Minimize button (on the left), the window
disappears and is represented by a button on the Taskbar. When a
window is minimized, you display it again by clicking the window
button on the Taskbar.
Maximize button
When you click the Maximize button (in the center), the window
is enlarged to take up the entire Desktop if it is a program or
folder window. When you maximize a document icon, the window
takes up the entire application window.
Restore button
When you maximize a window, the Restore button replaces the
Maximize button. The Restore button has two small boxes.
Clicking the Restore button displays the window in its previous
opened size and location.
Close button
The Close button (on the right) closes the window. Click the Close
button once to completely close the document, application, or
folder windows.
Title Bar
Border
Scroll Bar
Status Bar
Parts of a Window
The Menu bar. The Menu bar appears just below the Title bar and displays
additional options when you click the menu name. The commands and
features that you access on the menu bar tell Windows and the Windows
programs what actions to carry out. A menu is a group of related
commands or instructions that tells Windows what you want to do
Elements of a Menu
Pull down menu – a menu that appears to pull-down from the
Menu bar.
Page 52 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Page 53 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Toolbars – May appear in some of the dialog boxes you use. Toolbars have icon
buttons that act as shortcuts for performing tasks
Option buttons – Little round buttons that turn a feature on or off. A black dot
in the option button means the feature is turned on. Option buttons
usually represent a group of choices from which you can choose only
one at a time.
Command Button – carries out the command displayed on the button, such as
executing (OK) or canceling (Cancel) the option.
Tabs –represent multiple section of a dialog box. Choosing a tab changes the
option that appears in the dialog box.
Tabs
Text Box
List Box
Scroll Bar
Check boxes
Drop-down List
Command Buttons
Option Buttons
Toolbars
Notepad . You can use Notepad to create or edit text files that do not require
formatting and are smaller than 64K (kilobytes). Notepad opens and saves
text in ASCII (text-only) format. To create or edit files that require formatting
or are larger than 64K, use WordPad.
Calculator. You can use Calculator in standard view to perform simple
calculations, or in scientific view to perform advanced scientific and
statistical calculations.
Paint. You can use Paint to work with pictures that use the bitmap (.bmp) file
format. You can paste a Paint picture into another document you've created,
or use it as your desktop background. You can even use Paint to view and
edit scanned photos.
Page 54 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Windows Accessories
Post Test.
Multiple Choice. Write the capital letter of your answer on the space provided.
____1. A mouse is _______ device : a) Input b) Output c) Process d) Storage
____2. A windows accessories program used to draw pictures. a) Calculator
b) Notepad c) Paint d) all of the above
____3. In a dialog box, these are little round buttons that turn a feature on or off.
a) command button b) check box c) list box d) option button
____4. The latest version release of Windows operating system. a) Windows XP b)
Windows 2000 c) Windows ME d) Windows 2005
____5. The number of ENTER keys on the keyboard. a) 1 b) 2 c)3 d) 4
____6. To click is to press the ______ mouse button. a) Center b) Left c) Right
d) Scroll
____7. To display the START button. a) Click – b)press CTRL - ESC c) press
key from keyboard d) all of the above
Page 55 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Page 56 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
CHAPTER VIII
I N T R O D U C T I O N T O V I S U A L B ASIC
Guide Questions:
1. Explain how to open a new project.
2. What is the use of the Properties window? Why should it be necessarily
displayed?
3. In your own words, describe a form. List at least ten windows elements that uses
a form.
Outcomes:
At the end of the Chapter, the students can:
☺ define RAD.
☺ describe and be familiar with the environment of Visual Basic.
☺ identify and use appropriately the different windows in Visual Basic
programming.
☺ distinguish the different functions and uses of the control buttons.
Pre-Test:
Multiple Choice. Write the capital letter of your answer on the space provided.
____1. Developers of BASIC : a) Gates and Allen b) Jobs and Wozniak c) Kenemy and
Kurtz d) Marcos and Arroyo
____2. The process of rapidly creating an application in a graphic user interface
program: a) CAD b) IDE c) RAD d) RAM
____3. Which of the following is not an attribute that can be used to describe a human
being? a) brown eyes b) female c) talk d) thin
____4. In a procedure oriented languages, the emphasis of a program is on how to
accomplish a task. a) TRUE b) FALSE
____5. A function key to run a Visual BASIC program: a) F1 b) F2 c) F5 d) F8
8.1. INTRODUCTION
Welcome to Microsoft Visual Basic, the fastest and easiest way to create
applications for Microsoft Windows®. Whether you are an experienced
professional or brand new to Windows programming, Visual Basic provides you
with a complete set of tools to simplify rapid application development. The
"Visual" part refers to the method used to create the graphical user interface
(GUI). Rather than writing numerous lines of code to describe the appearance and
location of interface elements, you simply add prebuilt objects into place on
screen. If you've ever used a drawing program such as Paint, you already have
most of the skills necessary to create an effective user interface. Beginners can
create useful applications by learning just a few of the keywords, yet the power of
Page 57 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Page 58 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Standard EXE: Creates a stand-alone program that you can copy, give away, or
sell to others. Examples of stand-alone programs are Microsoft Word, Lotus 1-2-
3, and Netscape Navigator. Stand-alone programs have an EXE file extension.
To choose one of these options from the New Project dialog box, just
click on the option you want and click on OK.
If you choose File->New Project (or press Ctrl+N), Visual Basic displays a
New Project dialog box that does not contain the Existing or Recent tabs.
Creating ActiveX, DHTML, IIS, and Data Project files is fairly advanced, so
don't worry about such files until you figure out how to create a simple
(Standard EXE) Visual Basic program first.
Three Tabs contained in the Project dialog box
New – for creating a new project
Existing – for opening an existing project
Recent – for opening a project that has been previously loaded into the
IDE.
Page 59 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Project
Explorer
Window
Sizing
handle
Properties
Window
Form
Layout
Window
Properties Window
The Properties window displays the properties for a form or a
control. Properties are attributes such as size, position, etc. Like a form,
each control type has its own set of properties. Some properties, like
Width and Height, such as, are common to both forms and controls,
while other properties are unique to a form or a control. Controls often
differ in the number and type of properties.
Type of control
Name of control
Selected
property
Selected
property
description
Properties Window
Project Window
The window titled Project-Project1 is called the Project Explorer and
contains the project files.
View Code Project name
Project Explorer
View Code button – displays a window for writing Visual Basic code.
View Object button – displays the form.
Toggle Folders button – toggles the Forms folder
Toolbox
Page 61 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
PictureBox
Pointer
TextBox
Label
CommandButton
Frame
OptionButtonn
CheckBox
ComboBox ListBox
VScrollBar
HScrollBar
DriveListBox
Timer
DirListBox FileListBox
Shape Line
Image Data
OLE
Toolbox Window
Prefi Description
Control
x
Pointer Used to interact with the controls on the form (I.e., resize them,
move them, etc.). The pointer is not a control.
PictureBox Pic A PictureBox control can display a graphic from a bitmap, icon, or
metafile, as well as enhanced metafile, JPEG, or GIF files. It clips
the graphic if the control isn't large enough to display the entire
image.
Label Lbl A Label control is a graphical control you can use to display text
that a user can't change directly. You can write code that changes
the text displayed by a Label control in response to events at run
time. Set the AutoSize and WordWrap properties if you want the
Label to properly display variable-length lines or varying numbers
of lines.
TextBox Txt A TextBox control, sometimes called an edit field or edit control,
displays information entered at design time, entered by the user,
or assigned to the control in code at run time.
To display multiple lines of text in a TextBox control, set the
MultiLine property to True.
Frame Fme A Frame control provides an identifiable grouping for controls. You
can also use a Frame to subdivide a form functionally—for
example, to separate groups of OptionButton controls.
Page 62 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
To group controls, first draw the Frame control, and then draw the
controls inside the Frame. To select multiple controls in a Frame,
hold down the CTRL key while using the mouse to draw a box
around the controls
Command cmd Use a CommandButton control to begin, interrupt, or end a
Button process. When chosen, a CommandButton appears pushed in and
so is sometimes called a push button.
To display text on a CommandButton control, set its Caption
property. A user can always choose a CommandButton by clicking
it.
CheckBox chk A control that provides the user with a toggle choice (checked or
unchecked). Use this control to give the user a True/False or
Yes/No option.
To display text next to the CheckBox, set the Caption property. Use
the Value property to determine the state of the control—
selected, cleared, or unavailable.
OptionButto opt A "radio button". OptionButtons are used in groups where only
n one at a time can be True.
An OptionButton control displays an option that can be turned on
or off.
When a user selects an OptionButton, the other OptionButton
controls in the same group are automatically unavailable. In
contrast, any number of CheckBox controls can be selected.
ListBox Lst A ListBox control displays a list of items from which the user can
select one or more. If the number of items exceeds the number
that can be displayed, a scroll bar is automatically added to the
ListBox control.
ComboBox cbo A control that provides a short list of items. A ComboBox control
combines the features of a TextBox control and a ListBox control—
users can enter information in the text box portion or select an
item from the list box portion of the control.
To add or delete items in a ComboBox and ListBox controls, use
the AddItem or RemoveItem method. Set the List, ListCount, and
ListIndex properties to enable a user to access items in the
ComboBox. Alternatively, you can add items to the list by using the
List property at design time.
HScrollBar hsb A horizontal scrollbar.
VScrollBar vsb A vertical scrollbar
Scroll bars provide easy navigation through a long list of items or a
large amount of information. They can also provide an analog
representation of current position. You can use a scroll bar as an
input device or indicator of speed or quantity—for example, to
control the volume of a computer game or to view the time
Page 63 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Page 64 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
bound controls.
OLE ole A control for interacting with other window application.
The OLE container control enables you to add insertable
objects to the forms in your Visual Basic applications.
Table 1. Controls
Menu Bar and Tool Bar
Commands for developing, maintaining and executing programs are
contained in the IDE’s menus. Menus contains groups of related capabilities
from which the user may select appropriate choices. Rather than having to
navigate the menus for certain commonly used commands, the programmer
can select them from the tool bar. The tool bar comprised of pictures called
icons that represent commands.
Menu Description
Contains options for opening projects, closing projects,
File
printing projects, etc.
Edit Contains options such as cut, paste, find, undo, delete, etc.
View Contains options for displaying IDE windows and toolbars.
Contains options for adding features such as forms to the
Project
project.
Format Contains options for aligning and locking a form's control.
Debug Contains option for debugging.
Contains option for executing a program, stopping a program,
Run
etc.
Contains options for manipulating data retrieved from a
Query
database.
Contains options for editing and viewing the design of
Diagram
database.
Contains options for IDE tools and options for customizing the
Tools
environment.
Contains options for using, installing and removing add-ins.
Add-Ins Add-ins are typically independent software vendor (ISV)
products that extend Visual Basic's features.
Windows Contains options for arranging and displaying windows.
Help Contains option for displaying help
Table 2. Menus
Page 65 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Page 66 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Page 67 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Page 68 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
11. Repeat steps 8 through 11 over and over again until you get tired of
searching for more bugs.
Although you don't have to memorize these eleven steps, you do have to
follow them. Shortcuts aren't an option. Trying to skip from Step 1 to Step 5 is like
trying to start a car by using the gas pedal but forgetting to turn the ignition key.
You can try it, but you're not going to get anywhere.
Believe it or not, Step 1 is actually the hardest and most important step of all.
After you know exactly what you want your program to do, it's just a matter of
finding ways to do it. Persistence and creativity are helpful, as are lots of caffeine-
laden beverages and plenty of sleepless nights in front of the computer screen.
Create New
Up one level
Existing Folder
Page 69 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Step 3. Open the folder(ex. Sample1) by clicking the folder and click
. . Note that current folder on the Save-in textbox is the folder you
just created.
Step 4. Click on the Filename: textbox and type the name of the form. Ex.
frmMyform1(Note: The text on the Save as Type: should be Form Files
(*.frm)
Step 5. Click SAVE or press Enter from your keyboard.( you have just saved the
form)
Step 6. Click on the Filename: textbox and type the name of the project. (Note:
The text on the Save as Type: should be Project Files (*.vbp)
Step 7. Click SAVE or press Enter from your keyboard. ( you have just saved the
project)
Step1
Steps 2 & 3
Steps 6 & 7
Steps 4 & 5
Saving Procedure
When you have completed all the files for a project, you can convert the
project into an executable file (.exe): From the File menu, choose the Make
project.exe command.
Page 70 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Font
Lists all the fonts that you have installed for Windows. When the box
first appears, the font already in use for the selected element is
highlighted.
Font Style
Lists four additional attributes that you can assign to the font
selected:
Regular — Standard, unmodified style
Bold —will make the text bolder or darker
Italic — will make the text slant to the right
Bold Italic — Bold text slanted to the right
Size
Lists common point sizes for the highlighted font. When the box
first appears, the point size for the font already in use for the selected
element is highlighted, and the highlighted point size appears in the edit
box at the top. You can select directly from the list or type the new point
size in the edit box at the top. For common fonts, 1 pt is equal to 1/72 of
an inch. Thus, a 72 pts. Font is 1 inch in actual height.
Effects
Lists two additional options that you can use for highlighting the
selected font.
Strikeout — Prints the strikeout character across the font
Underline —
Underlines the font
Sample
Displays a sample of
the font you have selected.
The sample shows the font,
style, size, effects, and color
you have specified. You can
use this box to preview the
results as you experiment
with different formatting
options.
Font Dialog Box
Page 71 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Post-Test.
Multiple Choice. Write the capital letter of your answer on the space provided.
______1. A control which appears like a push button a) check box
b)command button c) frame d) Label
______2. A menu that contains the START/RUN command. a) Edit b) File c) Run
d) Tools
______3. In which window do you set the characteristics that control an object’s
appearance and behavior?
a) Main b) Form c) Properties d) Toolbox
______4. To delete a control on a form at design-time, use the _____ button. a)
Backspace b) Delete c) Enter d) Cut
______5. Tools you use when designing your application are found in the
a) toolbox b) toolbar c) user interface d) user screen
______6. Visual Basic 6.0 was developed by
a) APPLE b) HP c) Microsoft d) UNIX
______7. Visual Basic is a/an ______ language.
a) assembler b) mnemonic c) object-oriented/event driven
d) procedure-oriented
______8. Which is true about the form layout window?
a) permanent b) movable c) fix d) none of the above.
______9. Which window in Visual Basic is the most important?
a) form layout b) Project c) properties d) all of the above
______10. You design your user interface in a
a) design bar b) form c) menu bar d) toolbar
Page 72 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
CHAPTER IX
METHODS AND EVENT PROCEDURES
Guide Questions:
1. Explain the difference between properties methods and events.
2. List down at least 5 properties of a form and explain its use.
3. What are event procedures? How do they differ from procedures in other low
level programming language?
Outcomes:
At the end of the Chapter, the students can:
☺ create a simple graphic user interface after the first laboratory session.
☺ save correctly the different files associated with a visual basic project
☺ understand the Visual Basic procedures, events and object properties
Pre-Test.
Multiple Choice. Write the capital letter of your answer on the space provided.
____1. A function key to open the code window a) F2 b)F7 c) F8 d) F12
____2. Reserve words in Visual Basic code window is colored _____
a) black b) blue c) green d) red
____3. An event called when the user moves the mouse. a) activate b) keyup c)
mousemove d) mouseup
____4. A textbox property that changes the color of the text.
a) backcolor b) fontcolor c) forecolor d) fontbold
____5. Which of the following is an event? a) alignment b) change c) height
d) hide
9.1. INTRODUCTION
In Visual Basic an object is a combination of code and data that can be treated
as a unit. An object can be a piece of an application, like a control (e.g. textbox,
command button, label, etc.) or a form. An entire application can also be an object.
Most of the programming tasks in visual basic is done through working with the
objects.
Visual Basic objects have their own properties, methods and events. Properties
can be thought of as an object's attributes, methods as its actions, and events as its
responses.
An everyday object like a child's helium balloon also has properties, methods
and events. A balloon's properties include visible attributes such as its height,
diameter and color. Other properties describe its state (inflated or not inflated), or
attributes that aren't visible, such as its age. By definition, all balloons have these
properties; the settings of these properties may differ from one balloon to another.
Page 73 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
A balloon also has inherent methods or actions that it might perform. It has an
inflate method (the action of filling it with helium), a deflate method (expelling its
contents) and a rise method (if you were to let go of it). Again, all balloons are
capable of these methods.
Balloons also have predefined responses to certain external events. For
instance, a balloon would respond to the event of being punctured by deflating
itself, or to the event of being released by rising into the air.
If you were able to program a balloon, the Visual Basic code might look like the
following. To set the balloon's properties:
Balloon.Color = Red Balloon.Diameter = 10
Balloon.Inflated = True
Note the syntax of the code — the object (Balloon), followed by the property
(.Color), followed by the assignment of the value (Red). You could change the color
of the balloon from code by repeating this statement and substituting a different
value. Properties can also be set in the Properties window while you are designing
your application.
A balloon's methods are invoked like this:
Balloon.Inflate Balloon.Deflate Balloon.Rise 5
The syntax is similar to the property — the object (a noun) followed by the
method (a verb). In the third example, there is an additional item, called an
argument, which denotes the distance to rise. Some methods will have one or more
arguments to further describe the action to be performed.
The balloon might respond to an event as follows:
Sub Balloon_Puncture()
Balloon.Deflate
Balloon.MakeNoise "Bang"
Balloon.Inflated = False
Balloon.Diameter = 1
End Sub
In this case, the code describes the balloon's behavior when a puncture event
occurs: invoke the Deflate method, then invoke the MakeNoise method with an
argument of "Bang" (the type of noise to make). Since the balloon is no longer
Page 74 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
inflated, the Inflated property is set to False and the Diameter property is set to a
new value.
While you can't actually program a balloon, you can program a Visual Basic
form or control. As the programmer, you are in control. You decide which properties
should be changed, methods invoked or events responded to in order to achieve the
desired appearance and behavior.
Form objects are the basic building blocks of a Visual Basic application, the
actual windows with which a user interacts when he runs the application. Forms
have their own properties, events, and methods with which you can control their
appearance and behavior.
Forms and controls have their own properties, events, and methods
The work with forms and controls, set their properties, and write code for their
events at design time, which is any time you're building an application in the Visual
Basic environment. Run time is any time you are actually running the application and
interacting with the application as the user would.
Suggestions and Reminders about Visual BASIC Programming
1. Plan ahead
2. Think like a user
3. Think components
4. Learn by doing
5. Learn from Visual BASIC programs
9.2. WRITING BASIC CODE
When you're happy with the way your program looks, the next step involves
writing BASIC commands (also known as code) to make your program actually work.
The whole purpose of Visual Basic code is to tell objects on a form what to do
when the user does something. For example, if the user clicks on an OK or Cancel
command button, nothing happens unless you've written BASIC commands to tell
your computer exactly what to do.
Any time a user presses a key, moves the mouse, or clicks the mouse button,
it's called an event. Whenever an event occurs, your BASIC commands tell the
computer, "Something just happened. Let's do something about it!"
Page 75 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Essentially, writing a Visual Basic program means drawing your user interface
and then writing BASIC code to make it work. If you can handle these two steps
without losing your mind, you can start writing your very own programs using Visual
Basic.
9.3. EVENT PROCEDURES
Whenever the user takes any action, such as clicking the mouse, pressing a
key, passing out on the keyboard, or putting a bullet through the monitor, the action
is called an event. The moment an event occurs, Visual Basic looks for BASIC code to
tell the program what to do. The BASIC code that responds to a specific event is
called an event procedure.
A single Visual Basic program can consist of several thousand event
procedures. If you have that many, however, you either have a tremendously
complicated program or you're an incredibly incompetent programmer.
With so many possible events and so many possible event procedures in a
single program, how does Visual Basic know which event procedure to use?
The answer is easy. When an event occurs, this event is usually directed at
some part of your program's user interface. For example, most users click the mouse
button only when the mouse is pointing at an object, such as a command button,
check box, or menu command on the screen.
Every object can have one or more event procedures, and each event
procedure responds to one specific event, such as clicking the mouse or pressing a
key.
Types of Events
Events can be classified into three categories:
1. Keyboard events occur when the user presses a certain key, such as Tab, or a
certain keystroke combination, such as Ctrl+P.
2. Mouse events occur when the user moves the mouse, clicks or doubleclicks
the mouse button, or drags the mouse across the screen.
3. Program events occur when a Visual Basic program does something on its
own, such as loading, opening, or closing a form. Whereas keyboard and
mouse events occur when the user does something, program events occur
when BASIC code does something.
Page 76 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Visual Basic then finds that particular command button's event procedure,
which contains BASIC code that tells your program what to do when the user
clicks the mouse button.
Make sure that all the objects of your user interface have names before
creating any event procedure. If you create an event procedure for an object
and later change that object's name, you will have to rewrite your event
procedures.
The following three parts of a user interface can have events associated with
them:
1. Forms
2. Objects (command buttons, check boxes, and so on)
3. Pull-down menus
To create an event procedure for a form, follow these steps:
1. Click anywhere on the form, but not on any object on the form.
2. Open the Code window by pressing F7, choosing View Code, or
double-clicking anywhere on the form (but not on any object on
the form).
Visual Basic displays the Code window on the screen along with an
empty event procedure.
To create an event procedure for an object, such as a command button or
check box, follow these steps:
1. Click on the object so that little black rectangles (handles) appear
around it.
2. Open the Code window by pressing F7, choosing View-Code, or by
double-clicking on the object.
Visual Basic displays the Code window on the screen along with an
empty event procedure. You may still have to click on the Procedure list
box to choose a specific event to respond to, such as Click or KeyPress.
If you double-click on an object (such as a command button), Visual
Basic displays the Code window right away.
Page 77 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Page 78 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
When you enter the name of a control in your code, the Auto List Members
feature presents a drop-down list of properties available for that control. Type in
the first few letters of the property name and the name will be selected from the
list; the TAB key will complete the typing for you. This option is also helpful when
you aren't sure which properties are available for a given control. Even if you
choose to disable the Auto List Members feature, you can still access it with the
CTRL+J key combination.
The Auto Quick Info feature displays the syntax for statements and
functions. When you enter the name of a valid Visual Basic statement or
function, the syntax is shown immediately below the current line, with the first
argument in bold. After you enter the first argument value, the second argument
appears in bold. Auto Quick Info can also be accessed with the CTRL+I key
combination.
keywords
control name
input area
Page 79 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Otherwise, Visual Basic doesn't know which event procedures belong to which
objects on your user interface.
9.5. COMMON EVENTS
Activate – occurs when a form becomes the active window
Change – occurs when the contents of a combo box, directory list box, drive
list box, scroll bar, label, picture box, or text box change.
Click – occurs when the user clicks the mouse button once on the object
DblClick – occurs when the user clicks the mouse button twice in rapid
succession on an object
Deactivate – occurs when a form changes from being an active window
to an inactive window
DragDrop – occurs when the user holds down the mouse button on an object,
moves the mouse, and releases the mouse button
DragOver – occurs when the user holds down the mouse button on an object
and moves the mouse.
DropDown – occurs when the list portion of a combo box drops down
to display a list of choices
GotFocus – occurs when an object becomes highlighted when the user
presses Tab or clicks on an object, or if a form loads.
KeyDown – occurs when the user presses a key
KeyPress – occurs when the user presses and releases an ANSI key, such as a
keyboard character, Ctrl key combination, Enter, or backspace
key. (Basically, an ANSI key can be any letter, number, or oddball
keystroke combination that you press).
KeyUp – occurs when the user releases a key
LostFocus – occurs when an object is no longer highlighted because the user
pressed Tab or clicked on another object, or if a form has
unloaded.
MouseDown – occurs when the user presses a mouse button
MouseMove – occurs when the user moves the mouse
MouseUp – occurs when the user releases a mouse button
The combination of the object name and the event name defines the
name for an event procedure. Because object names must always be unique, no
two-event procedures on the same form can have the same name.
Page 80 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Post-Test .
Multiple Choice. Write the capital letter of your answer on the space provided.
____1. A property that displays text in a button is: a) Alignment b) Appearance
c) Caption d) Text
____2. chkfree.value = 1 : a) b) c) d)
____3. lblGo’s caption can be centered by the code: lblGo.Alignment=____ : a) 0 b) 1
c) 2 d) null
____4. On the code window, the color of “cmdenter_click( )” is : a) black b) blue
c) green d) red
____5. The extension of a Visual Basic form : a) .bas b) .fme c) .frm d) .vbp
____6. The first procedure in Visual Basic programming : a) Coding
b) Designing c) Documenting d) Planning
____7. To execute/run a Visual Basic program click this button. a) b) c) d)
____8. Which of the following is an event? a) click b) color c) frame d) form
____9. Which of the following is not a mouse event? a) click b) dragover c) gotfocus
d) keydown
____10. Window to access to change the Height property of a control:
a) form b) form layout c) property d) toolbox
Page 81 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
CHAPTER X
B A S I C E L E M E N T S O F A V I S U A L B ASIC P R O G R A M
Guide Questions:
1. What are data types and variables? What are the important facts a programmer
always should remember when using them in the program?
2. What is/are the difference of the integer division operator (\) and the modulus
operator (mod)?
3. Convert the Pythagorean theorem formula to programming formula.
Outcomes:
At the end of the Chapter, the students can:
☺ understand the basic elements of a Visual BASIC program
☺ write simple programs in Visual BASIC
☺ be familiar with the use of fundamental data types
☺ use arithmetic operators
☺ understand the precedence of arithmetic operators
Pre-Test.
Multiple Choice. Write the capital letter of your answer on the space provided.
____1. Which of the following is a valid declaration?
a) Dim x as integer b) Private x as float c) Sub x as long d) Variable x as double
____2. A variable declared at module level can be available in:
a) all modules b) all programs c) current procedure d) all forms
____3. Which is a valid variable? a)As b)intarea c) 2>1 d) dim
____4. A data type assigned to undeclared variables: a) byte b) date c)long d) variant
____5. Which of the following operators will be the last to be evaluated?
a) \ b) ^ c) + d) *
10.1. INTRODUCTION
The Visual BASIC language facilitates a structured and disciplined approach
to computer program design. When writing a program, it is equally essential to
understand the types of building blocks that are available and to employ proven
program construction principles. In this chapter, we introduce the Visual BASIC
programming concepts and illustrate many of its important features like memory
concepts, arithmetic operators, decision-making or comparison operators, and
data types used in Visual BASIC programming.
10.2. VARIABLES, CONSTANT, DATA TYPES AND OPERATORS
In Visual Basic, you use variables to temporarily store values during the
execution of an application. Variables have a name (the word you use to refer to
the value the variable contains) and a data type (which determines the kind of
data the variable can store).
Page 82 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
A variable name:
Must begin with a letter.
Can't contain an embedded period or embedded type-declaration
character.
Must not exceed 255 characters.
Must be unique within the same scope, which is the range from which
the variable can be referenced — a procedure, a form, and so on.
The optional As type clause in the Dim statement allows you to define the
data type or object type of the variable you are declaring (see Table 4). Data
types define the type of information the variable stores. Some examples of data
types include String, Integer, and Currency. Variables can also contain objects
from Visual Basic or other applications. Examples of Visual Basic object types, or
classes, include Object, Form1, and TextBox.
Examples:
Valid variables: x, q1, y2k, Exer2, Quiz_12,watchamacallit, etc.
Invalid variables : 808Q, as, we=2, v>b, dim, if, end, etc.
The scope of a variable defines which parts of your code are aware of its
existence. When you declare a variable within a procedure, only the code within
that procedure can access or change the value of that variable; it has a scope
that is local to that procedure.
Page 83 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Page 84 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
10.4. CONSTANT
A constant is a meaningful name that takes the place of a number or
string that does not change. Although a constant somewhat resembles a
variable, you can't modify a constant or assign a new value to it as you can to a
variable. There are two sources for constants:
Intrinsic or system-defined constants are provided by applications and
controls. Visual Basic constants are listed in the Visual Basic (VB) and
Visual Basic for applications (VBA) object libraries in the Object Browser.
Other applications that provide object libraries, such as Microsoft Excel
and Microsoft Project, also provide a list of constants you can use with
their objects, methods, and properties.
Symbolic or user-defined constants are declared using the Const
statement.
Page 85 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Memory
Data Type Pre- fix Stores Range of values
Required
Before using a non-Variant variable, you must use the Private, Public, Dim
or Static statement to declare it As type. For example, the following statements
declare an Integer, Double, String, and Currency type, respectively:
Private H As Integer
Dim Amt As Double
Static YourName As String
Public BillsPaid As Currency
A Declaration statement can combine multiple declarations, as in these
statements:
Private intJ As Integer, dblAmt As Double
Private strYourName As String, curBillsPaid As Currency
Private intTest, intAmount, intJ As Integer
Page 86 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Page 87 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
2. m = a * (a - b) ^ b * (b - c) ^ c * (c - a) ans. = -6
3. m = a ^ (a - b) * b ^ (b - c) + c ^ (a - c) ans. = 7
Page 88 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
CHAPTER XI
DECISION STRUCTURES
Guide Questions:
1. How do you think the decision making capability of the computer differs from
yours? Explain the limitations.
2. List down the limitations when using If..then..else statement.
3. Can you enumerate examples of real life application programs that uses decision
making. Site the applications where it is applicable.
Outcomes:
At the end of the Chapter, the students can:
☺ use the comparison and logical operators
☺ write decision-making programs in Visual BASIC
☺ write simple decision-making statements
☺ use the IF/THEN, IF/THEN/ELSE and SELECT-CASE statements.
Pre-Test.
Multiple Choice. Write the capital letter of your answer on the space provided.
____1. A comparison operator not suited for the given equation: 12 ___ 7 = true
a) > b) < c) < > d) >=
____2. Which is correct? a) Case 9 - 11 b) Case 11,115,119 c) case A, 5 d) Case none
____3. Evaluate the expression: 3 > 6 AND 7 > 4 a) True b) False
____4. Evaluate the expression: X - Y = Z when x=5, y=3 and z=2 a) True b) False
____5. Evaluate the expression: A OR B when A=true and B=false a) True b) False
11.1. INTRODUCTION
You use the selection structure, also called the decision structure, when
you want a program to make decision or comparison and then based on the
result of that decision or comparison, to select one of two paths. You can think
of the selection structure as being a fork in the road. The theory and principles of
structured programming will also be presented in this chapter. The techniques
that you will learn here are applications of decision-making capability in
computer programming applicable to most of high-level languages including
Visual BASIC. Application of pre-built functions in Visual BASIC will also be
covered in this chapter.
11.2. COMPARISON OPERATORS
Comparison operators compare two operands and returns Boolean values
depending on the outcome of the evaluation.
Page 89 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Comparison Boolean
Example
Operators Value
10 = 10 - (10 is equal to 10) TRUE
Equality (=)
1=5 - ( 1 is equal to 5 ) FALSE
10 < > 10 - (10 is not equal to 10) FALSE
Inequality (<>)
1<>5 - ( 1 is not equal to 5 ) TRUE
10 < 10 - (10 is less than 10) FALSE
Less than (<)
1<5 - ( 1 is less than 5 ) TRUE
10 > 10 - (10 is greater than 10) FALSE
Greater than (>)
1>5 - ( 1 is greater than 5 ) FALSE
Less than or equal 10 < = 10 - (10 is less than or equal to 10) TRUE
to (<=) 1<=5 - ( 1 is less than or equal to 5 ) TRUE
Greater than or 10 > = 10 - (10 is greater than or equal to 10) TRUE
equal to (>=) 1>=5 - ( 1 is greater than or equal to 5 ) FALSE
11.3. LOGICAL OPERATORS
These operators are used in Boolean expressions. Logical operators may
be used to form more complex conditions by combining simple conditions.
Boolean
Logical Evaluation Example
Value
Not Ex. Not expression Not ( 1 > 10 ) TRUE
- Evaluates to True if the Not (10 = 10) FALSE
expression is false,
otherwise, False.
And Ex. Expression1 And (10 = 10 ) And (1 < 5) TRUE
Expression 2 (10 <> 10) And ( 1 > 5) FALSE
- evaluates to True if (10 > 10) And ( 1 < 5 ) FALSE
expressions are true,
otherwise, False.
Or Ex. Expression1Or (10 = 10 ) Or (1< 5) TRUE
Expression2 (10 <> 10) Or ( 1 > 5) FALSE
- Evaluates to True if either of (10 > 10) Or ( 1 < 5 ) TRUE
the expression is true,
otherwise, False
11.4. DECISION STRUCTURE STATEMENTS
Visual Basic procedures can test conditions and then, depending on the
results of that test, perform different operations. The decision structures that
Visual Basic supports include:
1. If...Then
2. If...Then...Else 3. Select Case
Page 90 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
If-Then Statement
Use an If...Then structure to execute one or more statements
conditionally. You can use either a single-line syntax or a multiple-line block
syntax:
1. If condition Then statement
2. If condition Then
statements
End If
The condition is usually a comparison, but it can be any expression that
evaluates to a numeric value. Visual Basic interprets this value as True or
False; a zero numeric value is False, and any nonzero numeric value is
considered True. If condition is True, Visual Basic executes all the statements
following the Then keyword. You can use either single-line or multiple-line
syntax to execute just one statement conditionally (these two examples are
equivalent):
If x < 10 Then Print “Hello”
---- or -----
If x < 10 Then
Print “Hello”
End If
Notice that the single-line form of If...Then does not use an End If
statement. If you want to execute more than one line of code when
condition is True, you must use the multiple-line block If...Then...End If
syntax.
If x < 10 Then
Print “Hello”
cmdOk.Enabled = False ' Disable button control.
End If
If -Then-Else
Use an If...Then...Else block to define several blocks of statements, one
of which will execute:
If condition1 Then
[statementblock-1]
[ElseIf condition2 Then
[statementblock-2]] ...
[Else
[statementblock-n]]
End If
Visual Basic first tests condition1. If it's False, Visual Basic proceeds to
test condition2, and so on, until it finds a True condition. When it finds a True
condition, Visual Basic executes the corresponding statement block and then
executes the code following the End If. As an option, you can include an Else
Page 91 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
statement block, which Visual Basic executes if none of the conditions are
True.
If...Then…ElseIf is really just a special case of If...Then...Else. Notice
that you can have any number of ElseIf clauses, or none at all. You can
include an Else clause regardless of whether you have ElseIf clauses.
Example:
If Number < 10 Then
Digits = 1
ElseIf Number < 100 Then
Digits = 2
Else
Digits = 3
End If
Notice that you can always add more ElseIf parts to your If...Then
structure. However, this syntax can get tedious to write when each ElseIf
compares the same expression to a different value. For this situation, you
can use a Select Case decision structure.
Select Case
Visual Basic provides the Select Case structure as an alternative to
If...Then...Else for selectively executing one block of statements from among
multiple blocks of statements. A Select Case statement provides capability
similar to the If...Then...Else statement, but it makes code more readable
when there are several choices.
A Select Case structure works with a single test expression that is
evaluated once, at the top of the structure. Visual Basic then compares the
result of this expression with the values for each Case in the structure. If
there is a match, it executes the block of statements associated with that
Case:
Select Case testexpression
[Case expressionlist1
[statementblock-1]]
[Case expressionlist2
[statementblock-2]]
.
[Case Else
[statementblock-n]]
End Select
Each expressionlist is a list of one or more values. If there is more
than one value in a single list, the values are separated by commas. Each
statementblock contains zero or more statements. If more than one Case
matches the test expression, only the statement block associated with the
first matching Case will execute. Visual Basic executes statements in the Case
Page 92 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Else clause (which is optional) if none of the values in the expression lists
matches the test expression. Example:
Post-Test.
Multiple Choice. Write the capital letter of your answer on the space provided.
______1. Evaluate the expression: 4 > 6 OR 10 < 2*6 a) True b) False
______2. Evaluate the expression: 7 >= 3+4 OR 6 <4 AND 2 < 5 a) True b) False
Use the following information: x=5, y=3, z=2, A=true and B=false
______3. Evaluate the expression: X*Z > X*Y AND A a) True b) False
______4. Evaluate the expression: X*Z < X*Y OR A a) True b) False
______5. Evaluate the expression: A AND B a) True b) False
______6. Evaluate the expression: X*Y > Y^Z a) True b) False
______7. Evaluate the expression: X*Y>Y^Z AND A OR B a) True b) False
______8. A function that returns the sign of s number a) Atn b) Rnd C)Sgn d)Val
______9. ABS(-210-5) is equal to a) -215 b)-205 c) 205 d)215
______10. RIGHT$(“Unbelievable”, 4) is a) Unbel b) liev c) live d) able
Page 93 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
Programming Exercise.
1. Prepare a program that requests the cost and revenue for a company’s
business venture and displays “Break Even” if the cost and revenue are equal;
otherwise display the profit or loss.
2. Prepare a program that will determine if the first number entered by the user
is less than, greater than, or equal to the second number entered.
3. Develop a program that would determine if the number entered by the user is
POSITIVE, NEGATIVE, or ZERO.
4. Revise programming exercise Set A # 3, create a condition when there will be
no roots available for the entered data. (In case where imaginary number will
be one of the roots.)
5. Create a program that would tell the user if the numbered entered by the user
is ODD or EVEN.
6. Create a program for a Cartesian Plane. Two numbers will be entered by the
user as data for X and Y. After clicking a button, the program will display its
location on the Cartesian Plane.
Page 94 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
LABORATORY
ACTIVITIES
Page 95 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
INTRODUCTION
Each time you turn on your computer, it goes through a start-up process during
which it loads the system files necessary for you to interact with your computer and for
your computer to interact with other devices, such as the monitor, keyboard, and
mouse. When the start-up process is complete, your computer will open Windows.
Familiarization of this operating systems program and its applications will help a lot in
understanding the computer.
OUTCOMES
At the end of this activity, the students can:
1. manage files using folders
2. explore the windows desktop
3. efficiently utilize the keyboard and mouse
4. use the accessories program included in Windows, and;
5. find information about the computer system's storage.
PROCEDURE
I. Creating Folder
a. Open My Computer
b. Double click Comp##(C:)
c. Click File NewFolder
d. Type your family name and press Enter
e. Click your folder and press Enter.
f. Close the My Computer window and other opened windows.
II. NotePad
a. Click StartProgramsAccessories Notepad
Type the following for ten(10) times on the opened window :
The quick brown fox jumps over the lazy dog near the bank of the
river and cried for help.
b. Click FileSave
c. Locate and find your folder on the Save-As dialog box
a. Click the down arrow opposite the Save-in textbox
b. Click CPU###(C:)
c. Click your folder.( If you can’t find your folder, click the arrows on
the horizontal scroll bar to view the left or the right part of the
window.)
d. Click or press Enter on your keyboard
Page 96 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
V. Shut-Down Procedure
a. Click Start Shut-down Yes/OK
b. Wait until the message “ It is now safe to turn-off the computer.” is
displayed before turning the power off.
Page 97 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
INTRODUCTION
In a graphical user interface operating system, a dialog box or dialogue box is a
new window that appears above the rest that lists additional information, errors, or
options. A box that pops up to enable communication between the computer and you,
the user. Dialogue boxes may ask you questions or give you information about the next
processing it will do. Identifying the elements of this object will be learned on this
activity.
OUTCOMES
At the end of this activity, the students can:
1. identify the elements of the dialog box
2. understand the use of the different objects in the dialog box
3. differentiate the use of option buttons and check boxes
PROCEDURES
Listed below are some dialog boxes you can find in Windows.
Task #1. Open the dialog boxes one at a time(see the click direction for every
dialog box)
Task #2. List down the names and number of elements of the dialog box you can
find.
A. Start Programs Accessories WordPad Insert Date & Time…
Ex.
Listbox – 1
Command Button – 2
___________________ - ____
___________________ - ____
___________________ - ____
Page 98 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
___________________ - ____
___________________ - ____
___________________ - ____
___________________ - ____
___________________ - ____
___________________ - ____
___________________ - ____
___________________ - ____
___________________ - ____
___________________ - ____
___________________ - ____
___________________ - ____
___________________ - ____
___________________ - ____
___________________ - ____
Page 99 of 118
COMP 1 (COMPUTER FUNDAMENTALS & PROGRAMMING)
INSTRUCTION & LABORATORY MANUAL
INTRODUCTION
In Visual Basic Programming, programs or dialog box contains objects that
should be designed to its specific property. Properties are attributes such as size,
position, etc. Like a form, each control type has its own set of properties. Some
properties, like Width and Height, such as, are common to both forms and controls,
while other properties are unique to a form or a control. Controls often differ in the
number and type of properties. These object's properties can be changed on the
Properties window.
OUTCOMES
At the end of this activity, the students can:
1. display and use the Properties Window in Visual Basic
2. differentiate the settings applied in different objects when used on a
form; and
3. open, close or hide the properties window at anytime.
PROCEDURES
Some properties have predefined settings and some do not. You can tell if
a property has predefined settings by first selecting the property in the property
list, and then looking in the Settings box next to the selected property. Use the
following key to complete this exercise.
A This property has no predefined setting
B This property has predefined settings. The list arrows in the
Setting box will display either a list of the valid choices or a palette
C This property has predefined settings. The ellipsis in the Setting
box will display a dialog box.
D Not Available
Task 1: Start Visual Basic and open a new
project.
Task 2: On the form draw a 1) label, 2)textbox,
3)command button, 4)option button,
5)check box, 6)combo box, 7)shape and a 8)timer.
Task 3: Select the individual object and given the table below, write A, B, C or D
on the corresponding column according to the key given above.
Alignment 1. 2.B 3. 4. 5. 6. 7. 8. 9.
Caption 10. 11. A 12. 13. 14. 15. 16. 17. 18.
Enabled 19. 20. B 21. 22. 23. 24. 25. 26. 27.
FillColor 28. 29. B 30. 31. 32. 33. 34. 35. 36.
FillStyle 37. 38. B 39. 40. 41. 42. 43. 44. 45.
Font 46. 47. C 48. 49. 50. 51. 52. 53. 54.
ForeColor 55. 56. B 57. 58. 59. 60. 61. 62. 63.
Icon 64. 65. C 66. 67. 68. 69. 70. 71. 72.
Interval 73. 74. D 75. 76. 77. 78. 79. 80. 81.
Left 82. 83. A 84. 85. 86. 87. 88. 89. 90.
Name 91. 92. A 93. 94. 95. 96. 97. 98. 99.
Picture 100. 101. D 102. 103. 104. 105. 106. 107. 108.
TabIndex 109. 110. D 111. 112. 113. 114. 115. 116. 117.
Text 118. 119. D 120. 121. 122. 123. 124. 125. 126.
Value 127. 128. D 129. 130. 131. 132. 133. 134. 135.
Task 4: After accomplishing the above table. Save the form and the project
Name of the folder (for step 2): Activity1
Filename for the form (for step 4): frmForm1.frm
Filename for the project ( for step 6): Activity1.vbp.
Task 5: Close the project by clicking on the close button.
Filing
INTRODUCTION
Before writing a Visual Basic program, knowing your way in the development
cycle would pass by the understanding of how the user interface would be used.
Layouting the objects on the form should be easier when you knew the use of the
windows/toolbars that are displayed on the user interface. This activity guides you
on the process of developing the project user interface.
OUTCOMES
At the end of this activity, the students can:
1. differentiate the use of the Properties, Form Layout and Project Properties
Window in Visual Basic;
2. create a program and understand the use of the toolbox; and
3. save and open the project with confidence.
PROCEDURE:
On your computer, open Visual basic and replicate the given layouts, change
the corresponding property settings found at the left side and save the project using
the given data below the form. When done, execute(run) the program to view
required output.
A. Layout1
Task 1: Start Visual Basic and open a New project
Task 2:Add controls on the form and layout Task 3: Define object properties
Object Property Property Setting
Task 2: Add controls on the form and layout Task 3: Define object properties
Property
Object Property
Setting
Form Name FrmAct3
Caption Sample 2
Textbox Name txtDisplay
Text Visual BASIC
Frame Name fmeColors
Caption Text Color
Option Name OptBlack
Button Caption Black
Value True
Option Name OptRed
Task 4: Run the program
Button
Caption Red
Task 5: Save the form and the project
Option Name OptBlue
Folder name: Activity3 Button Caption Blue
Form name: frmAct3.frm
Command Name CmdApply
Project name: Activity3.vbp
Button Caption &Apply
Command Name CmdExit
Button Caption &Exit
B. Layout 3.
On your own, create a form with the following objects.
INTRODUCTION
Whenever the user takes any action, such as clicking the mouse, pressing a key
in the keyboard the action is called an event. When an event occurs, this event is
usually directed at some part of your program's user interface. This activity will
teach the student how the codes are done and how the program would work when
some actions will be made by the user.
OUTCOMES
At the end of these activities, the students can:
1. make his program do some work when objects are clicked
2. create a program and understand the use of the code window; and
3. open, edit and save the project without difficulty.
PROCEDURE
On your computer, open Visual Basic and replicate the given layouts, change
the corresponding property settings found at the left side and save the project using
the given data below the form. When done, execute(run) the program to view
required output.
A. Hello World. Develop a program (displays “Hello World!” on the form) as illustrated
below:
Task 1: Start Visual Basic and open a New project
Task 2: Lay-out the controls on the form Task 3: Define object properties
b
Activity2 Activity2
a
c
C. WIT Color. Develop a program changing the color, hiding and displaying a label on the form.
Task 1: Start Visual Basic and open a New project
Task 2: Layout objects on the form as illustrated Task 3: Define object properties on the Properties window
D. Simple Database. Develop a program that adds entered items in a list(as shown below).
Task 1: Start Visual Basic and open a New project
Task 2: Layout objects on the form as illustrated Task 3: Define object properties
Object Property Property Settings
Form Name frmAct7
Caption List of Names
Label Font Arial, Bold, 10 pts
Caption First Name
Label Font Arial, Bold, 10 pts
Caption Last Name
Label Font Arial, Bold, 10 pts
Caption Age
Textbox Name txtFN
Textbox Name txtLN
Textbox Name txtAge
Task 4: Supply the codes to make the program work
List Box Name LstTable
Checkbox Name chkBold
Caption Bold
Checkbox Name chkItalic
Caption Italic
Checkbox Name chkRegular
Caption Regular
Enabled False
Command Name cmdAdd
Button Caption &Add to List
Command Name cmdClear
Button Caption Clear
Command Name cmdExit
Button Caption Exit
Note: the underscore( _ ) on the code
means that the next line is still the
continuation of the same line of code.
Entering data on textboxes Clicking the checkboxes Clicking the regular checkbox
Try to use the CLEAR button and enter new set of names
INTRODUCTION
In programming, understanding the types of building blocks that are
available and to employ proven program construction principles are necessities.
In these activities, we introduce the Visual BASIC programming concepts and
illustrate many of its important features like memory concepts, arithmetic
operators, and data types used in Visual BASIC programming.
OUTCOMES
At the end of these activities, the students can:
1. solve problems requiring mathematical solutions
2. create an object-oriented program and understand the use of the
variables, data types and operators; and
3. provide electronic solutions to their math, engineering or financial
problems.
PROCEDURE
On your computer, open Visual Basic and replicate the given layouts, provide
codes, when done, execute(run) the program to view required output.
A. Sum and Product. Develop a program that computes for the sum and product of 2
numbers entered:
Task 1: Start Visual Basic and open a New project
Task 2: Layout objects on the form as illustrated Task 3: Define object properties
B. EXAM Average. Develop a program that computes for the average of 3 exams
entered by the user:
Task 1: Start Visual Basic and open a New project
Task 2: Layout objects on the form as illustrated
Task 5: Run the program and enter values to check the computations
INTRODUCTION
When you want a program to make decision or comparison and then based on
the result of that decision or comparison, to select one of two paths, we use the
decision structure. The application of the decision making capability of the computer
is the theory and principle of structured programming.
OUTCOMES
At the end of these activities, the students can:
1. write decision-making programs in Visual Basic
2. create a program in situations to provide options; and
3. use the IF/THEN, IF/THEN/ELSE and SELECT-CASE statements.
PROCEDURE
On your computer, open Visual Basic and provide codes, when done, execute(run)
the program to view required output.
A. Pass or Fail. Open Activity 9 and add Passed or Failed remarks based on the
computed average.
Task #1 Extend the form downwards and add a label.
Object Property Property Settings
Task#3. Run the program and enter different values to check the output
B. Grades. Open Activity9 and add grades equivalent for the computed average.
Task #1. Extend the form downwards and add another label.
Task#3. Run the program and enter different values to check the output. Save
References:
Capron, L., Johnson, J.A. Capron, Computers, Tools for an Information Age, 7th Ed.,
2009, The Benjamin/Cummings Publishing Company, Inc.
Kenneth C. Laudon, Jane P. Laudon, Jane Price Laudon, Carol Guercio Traver,
Information Technology: Concepts and Issues (2nd edition), 1997, Course
Technology
Zak, Diane, Programming with Microsoft Visual Basic 6.0, 1999,Course Technology
Dietel, H.M., Dietel, P.J. and Nieto, T.R., Visual Basic 6 How to Program, 1999, Prentice-
Hall
Ken Getz & Mike Gilbert, Visual Basic Language Developer’s Handbook, 2000, SYBEX
77
RUBRICS
The files were The files were done The files were The files were
Delivery finished before on time. finished after the long overdue.
the time. due time.
The files were The files were saved The files were The files were
saved correctly correctly but saved but saved on
on the specified filenames are not locations and unknown
Saving
folders with the named as filenames are not locations.
proper prescribed. prescribed.
filenames.
Score 20
Unsatisfac-
Objective Exceptional (7) Acceptable (5) Amateur (3) Score
tory (1)
The dialog box The dialog box were The dialog box The dialog box
were promptly located on time and were located with were located
located and named. delay and named. with delay and
Operations identified. named
incorrectly.
The type of The type of controls The controls in The dialog box
controls in the in the dialog box the dialog box were not
Mastery dialog box were were partially listed. were not located.
completely completely
listed. answered.
The listing was The listing was done The listing was The listing was
Delivery finished before on time. finished after the long overdue.
the time. due time.
Score 21
Unsatisfac-
Objective Exceptional (4) Acceptable (3) Amateur (2) Score
tory (1)
The program The program works The program The program is
works and meets and produces the produces correct producing
all of the results but displays results but does incorrect
Specificat- specifications. them without not display them results.
ions format. It also correctly.
meets most of the
other specifications.
Score 20