Comp Prog 12 W7 W8
Comp Prog 12 W7 W8
This module was collaboratively designed, developed and evaluated by the Development and Quality
Assurance Teams of SDO TAPAT to assist you in helping the learners meet the standards set by the K
to 12 Curriculum while overcoming their personal, social, and economic constraints in schooling.
As a facilitator, you are expected to orient the learners on how to use this module. You also need to
keep track of the learners' progress while allowing them to manage their own learning. Furthermore,
you are expected to encourage and assist the learners as they do the tasks included in the module.
This module was designed to provide you with fun and meaningful opportunities for guided and
independent learning at your own pace and time. You will be enabled to process the contents of the
learning resource while being an active learner.
1. Use the module with care. Do not put unnecessary mark/s on any part of the module.
Use a separate sheet of paper in answering the exercises.
2. Don’t forget to answer Let’s Try before moving on to the other activities included in
the module.
3. Read the instruction carefully before doing each task.
4. Observe honesty and integrity in doing the tasks and checking your answers.
5. Finish the task at hand before proceeding to the next.
6. Return this module to your teacher/facilitator once you are through with it.
If you encounter any difficulty in answering the tasks in this module, do not hesitate to consult
your teacher or facilitator. Always bear in mind that you are not alone.
We hope that through this material, you will experience meaningful learning and gain deep
understanding of the relevant competencies. You can do it!
3
Lesson
INTRODUCTION TO
1 PROGAMMING (Part 2)
Let’s Learn
In this module, the lessons are mostly concerned with how the learners
understand the basic concepts that appear in modern programming languages,
their interaction, and the relationship between programming languages and
methods for program development.
Let’s Try
In this activity, the trainer would try to assess the learners’ prior knowledge and
experience on the Microsoft Visual Studio including some terms related to proper
coding.
PRE - ASSESSMENT
4
4
5
3
1
TEST I - LABELING
Direction: Name the following parts of the Microsoft Visual Basic Screen.
Write your answer on the space below:
1. _______________________________________
2. _______________________________________
3. _______________________________________
4. _______________________________________
5. _______________________________________
1) This variable type has only two values, usually called \true" and \false".
a. Characters c. Boolean
b. Variable d. Value of variable
2) This variable represent the fractional numbers encountered while computing,
examples we gave as alternative representations for the constant of gravity:
0.00000000006673, 6.673e-11, and 0.6673e-10.
a. Characters c. Boolean
b. Floating-point d. Integer
3) It is a set of values.
a. Characters c. Block
b. Type d. Control
4) This is not one of its attributes, but is determined by its content and by its type.
a. Characters c. Boolean
b. Variable d. Value of variable
5) It is a sequence of definitions and statements enclosed in braces.
a. Expressions c. Block
b. Type d. Control
6) These are an advance over the early days of programming, when every statement
corresponded to a single machine instruction.
a. Expressions c. Block
b. Type d. Control
7) This represent to a value of any expression can be made to depend on the value of a
Boolean expression.
a. Expressions c. Conditional expression
b. Type d. Control
8) This depends on conditions, this may be skipped or repeated or retrieved from
function bodies and then general topic of what gets executed or evaluated next.
a. Expressions c. Conditional expression
5
b. Type d. Control
9) It is memory of which it is known at compile time that it will be needed at run time.
This memory is allocated at compile time.
a. Array c. Dynamic memory
b. Static memory d. Data type
10) The following are examples of mathematical operators use in flowcharting and
programming, except ________________.
a. Add c. +
b. * d. /
PERFORMANCE STANDARD
Let’s Recall
In this portion of the module, the learners will be given series of challenges as
to develop critical and creative thinking so when the new programming lesson
is tackled, they will find it fun and easy to learn.
Mechanics: This will be done via group activity challenge. Every group will be
given 3-5 minutes to complete the task. Presentations will follow .
6
Let’s Explore
As the lessons progress, the students are going to have broad understanding
of the programming in the world we live in today.
Directions: Browse the hyperlink to see the video about POS done in VB.Net. Watch the video
closely; replay it if not properly understood.
https://www.youtube.com/watch?v=SQnG_1k_Fek
Let’s Elaborate
7
The CPU
When a computer is performing the tasks that a program tells it to do, we say that the
computer is running or executing the program. The central processing unit, or CPU, is the
part of a computer that actually runs programs. The CPU is the most important component
in a computer because without it, the computer could not run software.
Main Memory
You can think of main memory as the computer’s work area. This is where the computer
stores a program while the program is running, as well as the data that the program is
working with. Main memory is commonly known as random-access memory, or RAM.
8
device, which formats and presents it. Common output devices are video displays and
printers.
SOFTWARE
If a computer is to function, software is not optional. There are two general categories
of software: system software and application software.
System Software
The programs that control and manage the basic operations of a computer are
generally referred to as system software. System software typically includes the
following types of programs:
Operating Systems, an operating system is the most fundamental set of programs
on a computer. The operating system controls the internal operations of the
computer’s hardware, manages all of the devices connected to the computer.
Application Software
This program makes a computer useful for everyday tasks are known as application
software. These are the programs that people normally spend most of their time
running on their computers.
9
Assembly Language
Assembly language programs cannot be executed by the CPU, however. The CPU only
understands machine language, so a special program known as an assembler is used
to translate an assembly language program to a machine language program.
The .Net framework consists of an enormous library of codes used by the client
languages like VB.Net. These languages use object-oriented methodology.
Following are some of the components of the .Net framework:
10
Using these tools, you can write all kinds of VB.Net programs from simple command-
line applications to more complex applications. With .NET, the way that operating
system services are invoked is uniform across all languages (including code
embedded in ASP.NET pages).
This portion of .NET is commonly referred to as the .NET Framework class library.
A new infrastructure for managing application execution. To provide a number of
sophisticated new operating-system services—including code-level security, cross-
language class inheritance, cross-language type compatibility, and hardware and
operating-system independence, among others—Microsoft developed a new runtime
environment known as the Common Language Runtime (CLR).
A new web server paradigm. To support high-capacity web sites, Microsoft has
replaced its Active Server Pages (ASP) technology with ASP.NET. While developers
who are used to classic ASP will find ASP.NET familiar on the surface, the underlying
engine is different, and far more features are supported.
A new focus on distributed-application architecture. Visual Studio .NET provides top-
notch tools for creating and consuming web services -- vendor-independent software
services that can be invoked over the Internet. The .NET Framework is designed top
to bottom with the Internet in mind.
11
4
2
5
3
1
DESCRIPTIONS
1. Error List Window
It shows all error messages, warnings and suggestions in a program after
compiling.
2. Windows Form Application
This is where all the controls are placed. It shows the GUI form of the
program when executed.
3. Toolbox
It contains many useful controls that allows a programmer to develop
Visual Basic programs.
4. Solution Explorer
This window provides easy access to all forms associated with the project.
5. Properties Window
This is used to view and set the properties of object. This can be seen on
the right side of the environment.
Procedures of Programming
Procedural Programming
The earliest programming languages were procedural. Procedural programming
means that a program is made of one or more procedures. A procedure is a set of
programming language statements that are executed by the computer.
Object-Oriented Programming
Object-oriented programming or OOP is an industry standard model for designing
and coding programs. When designing applications, designers use real-world objects
12
to express patterns, called classes in softwareThe program we write would create
objects, or instances of these classes.
While creating a Visual Basic application, you will spend much of our time doing
three things:
1. Creating the GUI elements that make up the application’s user interface,
2. Setting the properties of the GUI elements, and
3. Writing programming language statements that respond to events and
perform other operations. In this section, we take a closer look at these
aspects of Visual Basic programming.
Event-Driven Programming
Programs that operate in a GUI environment must be event-driven. An event is an
action that takes place within a program, such as the clicking of a control. All Visual
Basic controls are capable of detecting various events
BASIC SYNTAX
When we consider a VB.Net program, it can be defined as a collection of objects that
communicate via invoking each other's methods. Let us now briefly look into what
do class, object, methods, and instant variables mean.
Object
13
Objects have states and behaviors. Example: A dog has states - color, name, breed
as well as behaviors - wagging, barking, eating, etc. An object is an instance of a
class.
Class
A class can be defined as a template/blueprint that describes the behaviors/states
that object of its type support.
A RECTANGLE CLASS IN VB.NET
Depending upon the design, it may need ways for accepting the values of these
attributes, calculating area and displaying details.
Methods
A method is basically a behavior. A class can contain many methods. It is in methods
where the logics are written, data is manipulated and all the actions are executed.
Instant Variables
Each object has its unique set of instant variables. An object's state is created by the
values assigned to these instant variables.
Identifiers
An identifier is a name used to identify a class, variable, function, or any other user-
defined item. The basic rules for naming classes in VB.Net are as follows:
A name must begin with a letter that could be followed by a sequence of letters,
digits (0 - 9) or underscore. The first character in an identifier cannot be a
digit.
It must not contain any embedded space or symbol like ? - +! @ # % ^ & * ( )
[ ] { } . ; : " ' / and \. However, an underscore ( _ ) can be used.
It should not be a reserved keyword.
14
Writing Elementary Program
As Procedural Programming
This program will print simple string value: Welcome to Visual Basic!
Sub Main ()
End Sub
End Module
As Object-Oriented Programming
This program will print simple string value: Welcome to Visual Basic!
1. Creating the GUI…
15
Changing
Let’s Dig In
16
Let’s Remember
Directions: Read and analyze the questions below. Write your understanding on every
competency learned. To be answered on separate sheet of papers for modular and use
Google docs for blended. Submit it on the Google drive when finished.
1) What is the importance of understanding the human languages and machine
language?
2) Why should a programmer devote time in exploring the full features of VB.Net and
not just wait for the trainer to explain?
3) If you were to create a program for our school, what would it be and why?
CRITERIA 5 3 1
Relevance The answer is complete in The answer is somehow The answer has little
contents and insights good in contents and content and insights
insights
Grammar The answer is The answer has some The answer have many
grammatically correct incorrect grammar incorrect grammar
Let’s Apply
CRITERIA 5 3 1
Accuracy All controls are correct Some controls are Few controls are correct
correct
Creativity The same with the given Some of the features are Not the same with the
guide the same with the guide guide
Timeliness Submitted on time/ before Not able to pass on time Super late in submission
time
17
Let’s Evaluate
_____2. These are the programs that people normally spend most of their
time running on their computers.
A. Operating System C. Application Software
B. Microsoft Word D. Windows
18
_____9. This system design is a description of the functional requirements
of the system.
A. Logical Design C. System Design
B. Physical Design D. System Analysis
Let’s Extend
ASSIGNMENT:
19
1. Create a simple flowchart containing basic transaction that produced a
receipt.
2. Create an interface solution on VB.Net, or on MS Word using shapes or
simply done on paper to signify understanding of the lessons on this
module.
REFERENCES
BOOKS
Concepts in Computer Programming Language
John C. Mitchel
Types and Programming Languages
B. Pierce
Semantics with Applications
Flemming Nielson and Hanne Riis Nielson
PDF RESOURCES:
http://www.cs.tau.ac.il/~msagiv/courses/pl17/overview.pdf
https://homepages.dcc.ufmg.br/~camarao/lp/concepts.pdf
http://www.unhas.ac.id/~rhiza/arsip/kuliah/Komputasi-dan-Pemrograman/history-prog-lang.pdf
http://www2.cs.uregina.ca/~beattieb/CS350/notes/Chapter%202.pdf
YOUTUBE RESOURCES:
https://www.youtube.com/watch?v=SWRDqTx8d4k
https://www.youtube.com/watch?v=2De4hO3lu14
https://www.youtube.com/watch?v=6F8cTBbh_TI&list=PLMQ4k-hUWGNl-_4tGH-2Gq-06yZbzl5az
https://www.youtube.com/watch?v=ypUCTHskxCg
https://www.youtube.com/watch?v=7qclxWFkIAk
20
Language Editor : Jasper T. Aguilar
Reviewer : DR.ANGELA K. ALAMAN, Head Teacher IV-SVNHS
Illustrator : Jasper T. Aguilar
Schools Division of Taguig city and Pateros Upper Bicutan Taguig City
Telefax: 8384251
21