0% found this document useful (0 votes)
9 views

Module 1 PF201A - Edited

module
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Module 1 PF201A - Edited

module
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 11

NOTRE DAME RVM COLLEGE OF COTABATO

Formerly: Notre Dame of Cotabato for Girls Department (1904)


#74 Sinsuat Avenue, Cotabato City
Academic Year 2020-2021

TERTIARY DEPARTMENT

BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY

PF201A
OBJECT ORIENTED PROGRAMMING 1

COURSE PACKAGE

VISION: A Catholic, Ignacian Marian Institution of diverse culture that empowers


learners for the transformation of the world.

MISSION: ND-RVMCC commits itself to:


Develop Ignacian Marian leaders who are witnesses of Faith, Excellence, and Service;
Intensify instruction by pursuing innovative programs that employ relevant educational
strategies for technological advancement and stewardship of creation;
Enhance linkages and build up resources to facilitate instruction, research, and
community involvement for quality life.

Complete Name of Student

Contact Number: Email Address:


Student’s Home Address:
Current Location if not staying at home:
Contact Persons: mother’s name: contact number:
father's name: contact number:
Other Person’s Name: relationship: contact no:

WELCOME TO ND-RVMCC!
On this Academic Year under the new normal, we start by
thanking GOD for the blessings of good health and the capacity to
continue learning. Using our God-given talents, may we contribute to
desired development and growth. We hope to create life-giving
outputs for a better community and world.
I, Arnold John B. Bastillada, your Subject Teacher, will journey
with you until the completion of this COURSE PACKAGE.

ARNOLD JOHN B. BASTILLADA


SUBJECT TEACHER

PF201A – BSIT – NDRVMCC – Term 1, First Semester AY 2020-2021 Page 1 of 11


PF201A
OBJECT ORIENTED PROGRAMMING 1

COURSE DESCRIPTION

This course on OBJECT ORIENTED PROGRAMMING 1 is offered to the 2nd year college students of
Bachelor of Science in Information Technology (BSIT) for the term on the First Semester of each Academic
Year.

The course basically contains concepts on Object Oriented Programming and C# Language which
includes designing of OOP Solutions, the .NET Framework and Visual Studio, and developing Windows
Store Applications.

COURSE OUTCOMES

At the end of the course, you are enabled to:

CO1: apply the concepts of object-oriented in programming;

CO2: describe the object-oriented programming approach in connection with C#; and

CO3: illustrate the process of data file manipulations using C#.

COURSE OUTLINE

MODULE / TOPIC WEEK TIME ALLOTMENT

1. Overview of Object-Oriented Programming 1 6hrs


2. Designing OOP Solutions: Identifying the 2 6hrs
Class Structure
3. Introducing the .NET Framework and 3 6hrs
Visual Studio
4. Creating Classes 4 6hrs
MIDTERM ASSESSMENT 5
5. Creating Class Hierarchies 6 6hrs
6. Implementing Object Collaboration 7 6hrs
7. Working with Collections 8 6hrs
8. Developing Windows Store Applications 9 6hrs
FINAL ASSESSMENT 10

This course pack will run for ten (10) weeks which is approximately two and a half (2 ½) months
with eight (8) modules designed for home study learning while the fifth and tenth week will be
appropriated for major examinations, output presentations, comprehensive examinations and the like.

The Home Study Learning covers specific 21 st Century Skills to be developed in the students such
as Experiential Learning Skills (learning through experience), Collaboration and Communication Learning
Skills (learning with others) and Critical Thinking and Information Processing Learning Skills (learned and
developed through the structured program itself).

It is expected that submission of modules to professor will be every week according to timeline
until the end of the term. All necessary inputs and references are carefully chosen and made available in
the appendices to facilitate self-paced learning.
PF201A – BSIT – NDRVMCC – Term 1, First Semester AY 2020-2021 Page 2 of 11
COURSE EVALUATION

For the grading system, please take note of the new grading components as follows:

GRADING COMPONENTS
50% - Assessment Output (modules)
20% - Teaching Learning Activities (modules)
30% - Examinations (oral, projects)

SEMESTRAL GRADING (for board courses)


40% - Midterm
60% - Final

PF201A – BSIT – NDRVMCC – Term 1, First Semester AY 2020-2021 Page 3 of 11


BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY

PF201A
OBJECT ORIENTED PROGRAMMING 1

Topic: OVERVIEW OF OBJECT ORIENTED PROGRAMMING


MODULE 1 for WEEK 1
August 24 – 28, 2020

Print COMPLETE NAME

PART 1: PRELIMINARIES

OPENING PRAYER
Lord God, we humbly offer You our Modular Distant Education today, guided by our first module
for the week. As we start this new normal education in the tertiary level, we pray that You bless us with
wisdom. We pray for good health of our teachers and our families, and we continue to pray for healing.
Make us instruments of peace, love, and harmony to share the goodness of our outcome at the end of
this week-1 module. Amen.
Venerable Ignacia del Espiritu Santo, Pray for us.

INTRODUCTION
To set the stage for your study of object-oriented programming (OOP) and C#, this chapter will
look briefly at the history of object-oriented programming and the characteristics of an object-oriented
programming language. You will look at why object-oriented programming has become so important in
the development of industrial strength distributed-software systems. You will also examine how C# has
evolved into one of the leading application programming languages.

PART 2: LEARNING OUTCOMES

At the end of the module, you are expected to:

LO1: discuss object-oriented programming and the history and evolution of C#;
LO2: demonstrate how a programming language becomes object-oriented by enumerating the
characteristics; and
LO3: explain why object-oriented programming has become so important in the development of
industrial strength applications.

PART 3: LEARNING CONTENT

SUB TOPICS:
a. What is OOP?
(see Appendix A)
b. The History of OOP
(see Appendix B)
c. Why Use OOP?
(see Appendix C)
d. The Characteristics of OOP
(see Appendix D)
e. The History of C#
(see Appendix E)

PF201A – BSIT – NDRVMCC – Term 1, First Semester AY 2020-2021 Page 4 of 11


PART 4: TEACHING-LEARNING ACTIVITIES (TLAs)

TLA 1: REFLECTIVE WRITING


INSTRUCTION: Reflection papers are designed to formally consider what you have been learning and to
organize it through writing. The following will help you understand the activity:

• Your output must be encoded.


• Reflective writing should use formal language and correct spelling and punctuation.
• Topics reflected upon may include any information covered in this module.
• Papers to be used should be limited to 1 short bond per problem.

Your answers will be scored based on the given rubric below:


Rubric
Relevance 8
Organization 12
Total 20

1. What was the most important thing you learned during this topic?
2. What questions remained unanswered in your mind today?
3. Summarize the main point of today’s lecture in ten sentences.
4. What was the most useful or meaningful thing you learned from this topic?
5. How do you think you will use what we learned today in your everyday life?

PART 5: LEARNING ASSESSMENT

INSTRUCTION: For the learning assessments of this module, an online quiz will be given using Google
Form. Join the classroom.google.com and input the class code:

hsnvlfj
PART 6: LEARNING INTEGRATION

CORE-RELATED VALUES
Object oriented programming has several advantages to the programmer and user.
Through inheritance, redundant code is eliminated and existing class can be extended according to
requirement. Data hiding can be achieved with the help of the data abstraction and encapsulation. Data
hiding helps the programmers to build secure programs. It is easy to partition the work in a project based
on an object. Object oriented system can be easily upgraded from small to large system. It provides
message passing technique for communication between objects. It is helpful in reducing complexity of the
programs. Object Oriented Programming supports re-usability of the code. Security is the first main
advantage of OOP in which the data and functions are combined together in the form of class.
Since we are talking about security of data, a student of BSIT who is learning this topic should
acquire the core value of excellence supported with the related value of integrity.

PF201A – BSIT – NDRVMCC – Term 1, First Semester AY 2020-2021 Page 5 of 11


PART 7: LEARNING SUMMARY

In this module, you were introduced to OOP and got a brief history of C#. Now that you have an
understanding of what constitutes an OOP language and why OOP languages are so important to
enterprise-level application development, your next step is to become familiar with how OOP applications
are designed. In order to meet the needs of the users, successful applications must be carefully planned
and developed. The next module is the first in a series of three, aimed at introducing you to some of the
techniques used when designing object-oriented applications. You will look at the process of deciding
which objects need to be included in an application and which attributes of these objects are important to
the functionality of that application.

CLOSING PRAYER
Dearest God, thank you so much for all the blessings of our learning this week. Continue to bless,
inspire, and keep us in your loving care and protection. Bless and protect too our families, our NDRVMCC,
teachers, and loved ones with safety. Continue to touch with Your healing power our land and the entire
globe. Amen.
Venerable Ignacia del Espiritu Santo. Pray for us.
Bless us, O Heavenly Father and give us the grace to seek and do Your will in all things.

REFERENCE/S:

1. Dan Clark(2019), Beginning C# Object Oriented Programming, APRESS


2. https://www.tutorialspoint.com/csharp/index.htm

Designed by:

ARNOLD JOHN B. BASTILLADA


Subject Teacher

PF201A – BSIT – NDRVMCC – Term 1, First Semester AY 2020-2021 Page 6 of 11


APPENDICES

APPENDIX A

What is OOP?

Object-oriented programming is an approach to software development in which the structure of


the software is based on objects interacting with each other to accomplish a task. This interaction takes
the form of messages passing back and forth between the objects. In response to a message, an object
can perform an action. If you look at how you accomplish tasks in the world around you, you can see that
you interact in an object oriented world. If you want to go to the store, for example, you interact with a
car object. A car object consists of other objects that interact with each other to accomplish the task of
getting you to the store. You put the key object in the ignition object and turn it. This in turn sends a
message (through an electrical signal) to the starter object, which interacts with the engine object to start
the car. As a driver, you are isolated from the logic of how the objects of the system work together to
start the car. You just initiate the sequence of events by executing the start method of the ignition object
with the key. You then wait for a response (message) of success or failure. Similarly, users of software
programs are isolated from the logic needed to accomplish a task. For example, when you print a page in
your word processor, you initiate the action by clicking a print button. You are isolated from the internal
processing that needs to occur; you just wait for a response telling you if it printed. In the software
program, the button object interacts with a printer object, which interacts with the actual printer to
accomplish the task of printing the page.

APPENDIX B

The History of OOP

OOP concepts started surfacing in the mid-1960s with a programming language called Simula and
further evolved in the 1970s with advent of Smalltalk. Although software developers did not
overwhelmingly embrace these early advances in OOP languages, object-oriented methodologies
continued to evolve. In the mid-1980s there was a resurgence of interest in object-oriented
methodologies. Specifically, OOP languages such as C++ and Eiffel became popular with mainstream
computer programmers. OOP continued to grow in popularity in the 1990s, most notably with the advent
of Java and the huge following it attracted. And in 2002, in conjunction with the release of the .NET
Framework, Microsoft introduced a new OOP language, C# (pronounced C-sharp) and revamped their
widely popular existing language, Visual Basic, so that it is now truly object-oriented. Today OOP
languages continue to flourish and are a mainstay of modern programming.

APPENDIX C

Why Use OOP?

Why has OOP developed into such a widely used paradigm for solving business problems today?
During the 1970s and 1980s, procedure-oriented programming languages such as C, Pascal, and Fortran
were widely used to develop business-oriented software systems. Procedural languages organize the
program in a linear fashion—they run from top to bottom. In other words, the program is a series of steps
that run one after another. This type of programming worked fine for small programs that consisted of a
few hundred code lines, but as programs became larger they became hard to manage and debug. In an
attempt to manage the ever-increasing size of the programs, structured programming was introduced to
break down the code into manageable segments called functions or procedures. This was an

PF201A – BSIT – NDRVMCC – Term 1, First Semester AY 2020-2021 Page 7 of 11


improvement, but as programs performed more complex business functionality and interacted with other
systems, the following shortcomings of structural programming began to surface:
• Programs became harder to maintain.
• Existing functionality was hard to alter without adversely affecting all of the system’s functionality.
• New programs were essentially built from scratch. Consequently, there was little return on the
investment of previous efforts.
• Programming was not conducive to team development. Programmers had to know every aspect of how a
program worked and could not isolate their efforts on one aspect of a system.
• It was hard to translate business models into programming models.
• Structural programming worked well in isolation but did not integrate well with other systems.
In addition to these shortcomings, some evolutions of computing systems caused further strain on the
structural program approach, such as:
• Nonprogrammers demanded and got direct access to programs through the incorporation of
graphical user interfaces and their desktop computers.
• Users demanded a more intuitive, less structured approach to interacting with programs.
• Computer systems evolved into a distributed model where the business logic, user interface, and
backend database were loosely coupled and accessed over the Internet and intranets.
As a result, many business software developers turned to object-oriented methods and programming
languages. The benefits included the following:
• a more intuitive transition from business-analysis models to software-implementation models
• the ability to maintain and implement changes in the programs more efficiently and rapidly
• the ability to create software systems more effectively using a team process, allowing specialists to
work on parts of the system
• the ability to reuse code components in other programs and purchase components written by
third-party developers to increase the functionality of existing programs with little effort
• better integration with loosely coupled distributed-computing systems
• improved integration with modern operating systems
• the ability to create a more intuitive graphical-user interface for the users

APPENDIX D

The Characteristics of OOP

In this section you are going to examine some fundamental concepts and terms common to all
OOP languages. Don’t worry about how these concepts get implemented in any particular programming
language; that will come later. My goal is to familiarize you with the concepts and relate them to your
everyday experiences so that they make more sense later when you look at OOP design and
implementation.

Objects

As I noted earlier, we live in an object-oriented world. You are an object. You interact with other
objects. In fact, you are an object with data such as your height and hair color. You also have methods
that you perform or that are performed on you, such as eating and walking. So what are objects? In OOP
terms, an object is a structure for incorporating data and the procedures for working with that data. For
example, if you were interested in tracking data associated with product inventory, you would create a
product object that is responsible for maintaining and using the data pertaining to the products. If you
wanted to have printing capabilities in your application, you would work with a printer object that is
responsible for the data and methods used to interact with your printers.

PF201A – BSIT – NDRVMCC – Term 1, First Semester AY 2020-2021 Page 8 of 11


Classes

Many objects differ from each other only in the value of the data that they hold. For example, both
a red crayon and a blue crayon are crayons; they differ only in the value of the color attribute, one has a
red color and the other a blue color. Our object-oriented system needs a way to capture the abstraction
of a crayon, independent of the value of its color. That is, we want to express that a set of objects are
abstractly equivalent, differing only in the values of their attributes and perhaps, thus differing in the
behaviors that result from those values. Many objects are similar in many overall, generalized ways,
differing only in smaller, more specific details. In biology and other fields, scientists organize objects into
taxonomies, which are classification hierarchies used to express these similarities. For instance, a buttery
and a lobster are quite different, yet they share the common characteristics of all Arthropods, such as a
jointed exoskeleton. The notion of an Arthropod enables us to understand and deal with butterflies and
lobsters in an abstract, unified manner. So once again we are trying to express abstract equivalence.
Object-oriented systems use classes to express the above notions of abstract equivalence. A class is an
abstract description of a set of objects. A class thus contain the descriptions of all the behaviors of the
objects that it represents. In computer science parlance, we call the individual behaviors of a class its
methods. In addition, a class may, but not always, contain descriptions of the internal data held by the
objects, called its fields, as well as implementation details about its methods and fields. Turning the
description around, we can say that a class is a template or recipe for the creation of a particular type of
object. That is, one can use a class to create ("instantiate") objects of the type described by the class. Be
careful not to make the very beginner's common mistake of equating classes and objects. A class is a
specification of an set of objects, it is not the actual object. In technical terms, a class defines a new type
in the system. Types are identifies used to differentiate different kinds of data. For instance, integers,
characters, strings and arrays are all types of data.

Abstraction

When you interact with objects in the world, you are often only concerned with a subset of their
properties. Without this ability to abstract or filter out the extraneous properties of objects, you would
find it hard to process the plethora of information bombarding you and concentrate on the task at hand.
As a result of abstraction, when two different people interact with the same object, they often deal with a
different subset of attributes. When I drive my car, for example, I need to know the speed of the car and
the direction it is going. Because the car is using an automatic transmission, I do not need to know the
revolutions per minute (RPMs) of the engine, so I filter this information out. On the other hand, this
information would be critical to a racecar driver, who would not filter it out. When constructing objects in
OOP applications, it is important to incorporate this concept of abstraction. The objects include only the
information that is relevant in the context of the application. If you were building a shipping application,
you would construct a product object with attributes such as size and weight. The color of the item would
be extraneous information and would be ignored. On the other hand, when constructing an order-entry
application, the color could be important and would be included as an attribute of the product object.

Encapsulation

Another important feature of OOP is encapsulation. Encapsulation is the process in which no direct
access is granted to the data; instead, it is hidden. If you want to gain access to the data, you have to
interact with the object responsible for the data. In the previous inventory example, if you wanted to view
or update information on the products, you would have to work through the product object. To read the
data, you would send the product object a message. The product object would then read the value and
send back a message telling you what the value is. The product object defines which operations can be
performed on the product data. If you send a message to modify the data and the product object
determines it is a valid request, it will perform the operation for you and send a message back with the
result. You experience encapsulation in your daily life all the time. Think about a human resources
department. They encapsulate (hide) the information about employees. They determine how this data
can be used and manipulated. Any request for the employee data or request to update the data has to be
routed through them. Another example is network security. Any request for security information or a
change to a security policy must be made through a network security administrator. The security data is
PF201A – BSIT – NDRVMCC – Term 1, First Semester AY 2020-2021 Page 9 of 11
encapsulated from the users of the network. By encapsulating data, you make the data of your system
more secure and reliable. You know how the data is being accessed and what operations are being
performed on the data. This makes program maintenance much easier and also greatly simplifies the
debugging process. You can also modify the methods used to work on the data, and, if you do not alter
how the method is requested and the type of response sent back, you do not have to alter the other
objects using the method. Think about when you send a letter in the mail. You make a request to the post
office to deliver the letter. How the post office accomplishes this is not exposed to you. If it changes the
route it uses to mail the letter, it does not affect how you initiate the sending of the letter. You do not
have to know the post office’s internal procedures used to deliver the letter.

Polymorphism

Polymorphism is the ability of two different objects to respond to the same request message in
their own unique way. For example, I could train my dog to respond to the command bark and my bird to
respond to the command chirp. On the other hand, I could train them to both respond to the command
speak. Through polymorphism I know that the dog will respond with a bark and the bird will respond with
a chirp. How does this relate to OOP? You can create objects that respond to the same message in their
own unique implementations. For example, you could send a print message to a printer object that would
print the text on a printer, and you could send the same message to a screen object that would print the
text to a window on your computer screen. Another good example of polymorphism is the use of words in
the English language. Words have many different meanings, but through the context of the sentence you
can deduce which meaning is intended. You know that someone who says “Give me a break!” is not
asking you to break his leg! In OOP you implement this type of polymorphism through a process called
overloading. You can implement different methods of an object that have the same name. The object can
then tell which method to implement depending on the context (in other words, the number and type of
arguments passed) of the message. For example, you could create two methods of an inventory object to
look up the price of a product. Both these methods would be named getPrice. Another object could call
this method and pass either the name of the product or the product ID. The inventory object could tell
which getPrice method to run by whether a string value or an integer value was passed with the request.

Inheritance

Most real-life objects can be classified into hierarchies. For example, you can classify all dogs
together as having certain common characteristics such as having four legs and fur. Their breeds further
classify them into subgroups with common attributes such as size and demeanor. You also classify objects
according to their function. For example, there are commercial vehicles and recreational vehicles. There
are trucks and passenger cars. You classify cars according to their make and model. To make sense of the
world, you need to use object hierarchies and classifications.
You use inheritance in OOP to classify the objects in your programs according to common characteristics
and function. This makes working with the objects easier and more intuitive. It also makes programming
easier because it enables you to combine general characteristics into a parent object and inherit these
characteristics in the child objects. For example, you can define an employee object that defines all the
general characteristics of employees in your company. You can then define a manager object that inherits
the characteristics of the employee object but also adds characteristics unique to managers in your
company. Because of inheritance the manager object will automatically reflect any changes to the
characteristics of the employee object.

Aggregation

Aggregation is when an object consists of a composite of other objects that work together. For
example, your lawn mower object is a composite of the wheel objects, the engine object, the blade
object, and so on. In fact, the engine object is a composite of many other objects. There are many
examples of aggregation in the world around us. The ability to use aggregation in OOP is a powerful
feature that enables you to accurately model and implement business processes in your programs.

PF201A – BSIT – NDRVMCC – Term 1, First Semester AY 2020-2021 Page 10 of 11


APPENDIX E

The History of C#

In the 1980s, most applications written to run on the Windows operating system were written in
C++. Even though C++ is an OOP language, it’s arguably a difficult language to master and the programmer
is responsible for dealing with housekeeping tasks such as memory management and security. These
housekeeping tasks are difficult to implement and often neglected, which results in bug-filled applications
that are difficult to test and maintain. In the 1990s, the Java programming language became popular.
Because it’s a managed-programming language, it runs on top of a unified set of class libraries that take
care of the low-level programming tasks such as type safety checking, memory management, and
destruction of unneeded objects. This allows the programmer to concentrate on the business logic and
frees her from having to worry about the error-prone housekeeping code. As a result, programs are more
compact, reliable, and easier to debug. Seeing the success of Java and the increased popularity of the
Internet, Microsoft developed its own set of managed-programming languages. Microsoft wanted to
make it easier to develop both Windows- and Web-based applications. These managed languages rely on
the .NET Framework to provide much of the functionality to perform the housekeeping code required in
all applications. During the development of the .NET Framework, the class libraries were written in a new
language called C#. The principal designer and lead architect of C# was Anders Hejlsberg. Hejlsberg was
previously involved with the design of Turbo Pascal and Delphi. He leveraged this previous experience to
design an OOP language that built on the successes of these languages and improved upon their
shortcomings. Hejlsberg also incorporated syntax similar to C into the language in order to appeal to the
C++ and Java developers. One of the goals of creating the .NET Framework and the C# language was to
introduce modern concepts such as object orientation, type safety, garbage collection, and structured-
exception handling directly into the platform. Since releasing C#, Microsoft has continually sought to add
additional features and enhancements to the language. For example, version 2.0 added support for
generics (generics are covered in Chapter 9) and version 3.0 LINQ (more about this in Chapter 10) was
added to reduce the impedance mismatch between the programming language and the database
language used to retrieve and work with data. Today C# 5.0 includes support to make parallel and
asynchronous programming easier for developers to implement (see Chapter 8). With Microsoft’s
commitment to the continual improvement and evolution of the C#, it will continue to rank as one of the
most widely used programming languages in the world.

Microsoft is also committed to providing .NET developers with the tools necessary to have a highly
productive and intuitive programming experience. Although you can create C# programs using a text
editor, most professional programmers find an integrated development environment (IDE) invaluable in
terms of ease of use and increased productivity. Microsoft has developed an exceptional IDE in Visual
Studio (VS). Integrated into VS are many features that make programming for the .NET Framework more
intuitive (These features are covered in Chapter 5). With the most recent release of Visual Studio 2012,
Microsoft has continued to enhance the design-time developing experience. VS 2012 includes new
features such as better debugging support for parallel programming and an improved code testing
experience. As you work your way through this book, I think you will come to appreciate the power and
productivity that Visual Studio and the C# language provide.

PF201A – BSIT – NDRVMCC – Term 1, First Semester AY 2020-2021 Page 11 of 11

You might also like