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

Computer Programming AdU

Uploaded by

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

Computer Programming AdU

Uploaded by

Tango Foxtrot
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

ADAMSON UNIVERSITY Computer Programming

COMPUTER PROGRAMMING OOP Languages are built upon 4 principles


• ____________________
What is the purpose of a software? • ____________________
• Perform complex task/calculation • ____________________
• Ease complexity and reduce human error • ____________________
• Reduce human intervention and perform monotonous
work Computer Program
• A computer program is a sequence of instructions
Software complexity written using a Computer Programming Language to
• Problem domain complexity perform a specified task by the computer.
• Communication between user and developers • A computer program is also called a computer
• Volatile nature of requirements software, which can range from two lines to millions of
• Unpredictable behavior of software lines of instructions.

• ____________________________ - means using Programming Language is an artificial language that can be


functions to the best effect for creating clean and used to control the behavior of a machine, particularly a
maintainable software. computer.

• ____________________________- It refers to languages Data type represents a type of data which you can process using
that use objects in programming. The main aim of OOP is your computer program. It can be numeric, alphanumeric,
to bind together the data and the functions that operate on decimal, etc.
them so that no other part of the code can access this data
except that function.

An ____________ represents an individual, identifiable item,


unit or entity, either real or abstract, with well-defined role in the
problem domain.

____________ are user-defined data types that act as the


blueprint for individual objects, attributes and methods.

OBJECT MODEL
Early computer languages were used for mathematical & Different programming languages have different ways of typing
scientific operations, but their growth in size & complexity led to data types inside a program.
the evolution of languages to accommodate new features.
(Automation for business applications). Slowly, languages _______________ is a storage location and an associated
evolved, and even more, they moved closer to the problem symbolic name which contains some known or unknown
domain and further away from machines. The newer languages quantity or information, a value.
used classes & objects instead of subprograms & algorithms as
building blocks. _______________ is a symbol that tells the compiler or
interpreter to perform specific mathematical, relational or logical
The object model is based on three important concepts: operation and produce final result.
• _______________________
• _______________________ _______________________are expressions that ask the
• _______________________ program to determine if a variable is true or false. You may also
call it Boolean values.
____________________________ - It is a standard language
for specifying, visualizing, constructing, and documenting the A _______________allows us to execute a statement or group
artifacts of software systems. of statements multiple times.
• UML is not a programming language but tools can
be used to generate code in various languages using An _______________ is a data structure, which can store a
UML diagrams fixed-size collection of elements of the same data type.
• UML diagrams are not only made for developers but
_______________ are self-contained modules of code that
also for business users, common people, and anybody
accomplish a particular task.
interested to understand the system.
Here are all the parts of a function −
OO Analysis - is a method of analysis that examines the
Return Type − A function may return a value. The return_type
requirements from the perspective of the classes & objects
is the data type of the value the function returns.
found in the problem domain.
Function Name − This is the actual name of the function. The
• This is the first step in developing an object-oriented
function name and the parameter list together constitute the
system, here we examine the real-world environment
function signature.
in which the system will operate.
Parameter List − A parameter is like a placeholder. When a
• Focus on what systems are supposed to do function is invoked, you pass a value as a parameter.
• Created using user stories or use cases. Function Body − The function body contains a collection of
statements that defines what the function does.
OO Design - In this stage, the objects are collaborated
according to their intended association. After the association is List of Programming Languages
complete, the design is also complete. • Python is an advanced programming language that is
• Takes input from OO analysis interpreted, object-oriented and built on flexible and
• High level abstractions (arrangements) from analysis robust semantics.
are mapped onto classes • Java is a general-purpose, object-oriented, high-level
• Association is formed between classes and objects programming language with several features that make
• Uses class diagrams to represent the structure of the it ideal for web-based development.
system • JavaScript is not related to Java. It is a client-side
programming language that runs inside a client
OOP programming - the system is organized as a set of browser and processes commands on a computer
classes & objects rather than a server.

1|P age
Prepared by: Engr. Rex Jason H. Agustin
ADAMSON UNIVERSITY Computer Programming
• C Language is a structure-oriented, middle-level A. The problem domain is complex it requires that non-functional
programming language mostly used to develop low- requirements should be identified.
level applications. B. The user may have a vague idea of what they expect from a
• C++ is a general purpose, object-oriented, middle-level software
programming language and is an extension of C C. Developers expect requirements in a specific format
language, which makes it possible to code C++ in a “C D. all of these choices are correct
style”.
• C# is a multi-paradigm programming language that 2. In software development, requirements must be identified in
features strong typing, imperative, declarative, a clear and concise manner to avoid confusion and any
functional, generic, object-oriented and component- unexpected outputs. What is the nature of a requirements?
oriented disciplines. A. The requirements can be long and lengthy pieces of
• Swift is Apple’s newest open-source, multi-paradigm information
programming language for iOS and OS X apps. B. They define functions and functionality within and from the
• Ruby is an open-sourced, object-oriented scripting software system therefore they are not supposed to be
language that can be used independently or as part of modifiable.
the Ruby on Rails web framework. C. The requirements can be obvious or hidden, known or
• PHP is an open-source scripting language designed for unknown, expected or unexpected from client’s point of view.
creating dynamic web pages that effectively work with D. all of these choices are correct
databases.
• SQL is a database query language (not a development 3. Functional programming means using functions to the best
language) that allows for adding, accessing and effect for creating clean and maintainable software. The ideal in
managing content in a database. functional programming is what is known as
A. pure functions
_____________________is the process of responding to B. anticipated functions
unwanted or unexpected events when a computer program C. paradigm functions
runs. It ensures that the flow of the program doesn’t break when D. structured functions
an exception occurs.
4. OOP focuses on the objects that developers want to
An ____________________is an unwanted event that manipulate rather than the logic required to manipulate them.
interrupts the normal flow of the program. When an exception This approach to programming is well-suited for programs that
occurs program execution gets terminated. are?
A. small, concise, and easily managed
B. large, complex and actively updated or maintained
C. data are modifiable outside the function
D. all of these choices

5. Objects are instances of a class created with specifically


defined data. Objects can correspond to?
A. data and methods that control the data
B. represents only the behavior of a real world entity
C. collaboration of identified identities
D. real-world objects or an abstract entity

6. A class is a user-defined data type. It consists of data


members and member functions, which can be accessed and
used by creating an instance of that class. It represents?
A. basic unit of Object-Oriented Programming and represents
the real-life entities
Graphical User Interface (GUI) B. the set of properties or methods that are common to all
A GUI (graphical user interface) is a system of interactive visual objects of one type
components for computer software. C. only essential information about the data
• A GUI uses windows, icons, and menus to carry out D. wrapping up of data under a single unit, the variables or data
commands, such as opening, deleting, and moving are hidden from any other
files.
• Although a GUI operating system is primarily navigated 7. UML is a standard language for specifying, visualizing,
using a mouse, a keyboard can also be used via constructing, and documenting the artifacts of software systems.
keyboard shortcuts or the arrow keys. UML stands for
A. Undying Model Language
Elements of a GUI B. Unified Methodology Language
Button - A graphical representation of a button that performs an C. United Modification Language.
action in a program when pressed D. Unified Modeling Language
Dialog box - A type of window that displays additional
information, and asks a user for input. 8. What is the main difference between object oriented analysis
Icon - Small graphical representation of a program, feature, or and other forms of analysis in developing a software?
file. A. requirements are organized around objects
Menu - List of commands or choices offered to the user through B. requirements integrate both data and functions
the menu bar. C. they are modelled after real-world objects that the system
Menu bar - Thin, horizontal bar containing the labels of menus. interacts with
Ribbon - Replacement for the file menu and toolbar that groups D. all of these choices
programs activities together.
Tab - Clickable area at the top of a window that shows another 9. It involves implementation of the conceptual model produced
page or area. during object-oriented analysis.
Toolbar - Row of buttons, often near the top of an application A. Object Oriented Design
window, that controls software functions. B. Object Oriented Analysis
Window - Rectangular section of the computer's display that C. Object Oriented Programming
shows the program currently being used. D. all of these choices

Review Questions 10. OOP Languages are built upon 4 principles, what are they?
A. Inheritance, Absolution, Polarization, Encapsulation
1. Reasons for software complexity: B. Abstraction, Inheritance, Encapsulation, Polarization

2|P age
Prepared by: Engr. Rex Jason H. Agustin
ADAMSON UNIVERSITY Computer Programming
C. Abstraction, Inheritance, Polymorphism, Encapsulation programming language may be considered preferable in GUI
D. Polymorphism, Encapsulation, Incorporation, Abstraction programming.
A. PHP & Javascript
11. The capability of a class to derive properties and B. SQL and Rails
characteristics from another class is called _____? C. Python and SQL
A. Abstraction C. Inheritance D. C# and Java
B. Polymorphism D. Encapsulation
24. Kevin has implemented a While loop within his Java
12. It refers to providing only essential information about the program. Assess the code statement below and select which
data to the outside world, hiding the background details or answer best summarizes the output Kevin will experience once
implementation. the while statement is executed. int count = 1; while (count
A. Abstraction C. Inheritance <=25) { System.out.println (count); Count = count –1; }
B. Polymorphism D. Encapsulation System.out.println ("Done");
A. The while loop will execute 25 times and print the numbers 1
13. In Encapsulation, the variables or data of a class are hidden thru 25 and finish with the printing of Done.
from any other class and can be accessed only through any B. The while loop will execute 25 times and print the numbers
member function of their class in which they are declared. As in 25 down to 1 and finish with the printing of Done.
encapsulation, the data in a class is hidden from other classes, C. The while statement will not function correctly due to a
so it is also known as _____? missing semicolon(;) after the statement while (count <=25)
A. data freezing C. data encapsuling D. The while statement will execute by counting down from 1
B. data protecting D. data hiding until infinity and result in an infinite loop.

14. A computer program is also called computer software, which 25. Consider the following code that will assign a letter grade of
can range from two lines to millions of lines of instructions. ‘A’, ‘B’, ‘C’, ‘D’, or ‘F’ depending on a student’s test score.
Computer programming is also called ___________? if(score >= 90) grade = 'A';
A. syntax coding C. relative programming if(score >= 80) grade = 'B';
B. program coding D. software coding if(score >= 70) grade = 'C';
if(score >= 60) grade = 'D';
15. It is a way to store some sort of information for later use, and else grade = ‘F’
we can retrieve this information by referring to a “word” that will A. This code will work correctly only if grade >=60
describe this information. B. This code will work correctly only if grade < 70
A. array C. variable C. This code will work correctly in all cases
B. loop D. syntax D. This code will work correctly only if grade < 60

16. Loops are common types of iterations in which a program


performs certain actions an infinite number of times until a new To God be the glory!
condition is met. Loops also make it possible for programs to do
something else while a given process is running.
A. true C. incomplete information
B. false D. cannot be validated

17. A programming language used for artificial intelligence (AI)


and machine learning.
A. JAVA C. C#
B. PYTHON D. PHP

18. A programming language used in areas such as data


analysis and big data mining.
A. JAVASCRIPT C. RUBY
B. C++ D. SQL

19. It’s a multi-paradigm programming language for iOS.


A.PHP C. RUBY RAILS
B. SWIFT D. C

20. Exception handling ensures that the flow of the program


doesn’t break when an exception occurs. Which of the following
is a reason why exception occurs?
A. invalid user input C. division by zero
B. missing semicolon D. all of these choices

21. Exception handling helps ensure this does not happen when
an exception occurs. Which of the following are the types of
exceptions?
A. checked and unchecked exceptions
B. compile-time and run-time exceptions
C. both a and b
D. none of these choices

22. It is very difficult for a compiler to find out this error because
it cannot point out the exact line at which this particular error
occurs.
A. run-time exceptions
B. compile-time exceptions
C. both a and b
D. none of these choices

23. While there are several different visual programming


languages with their own unique advantages for the
development of a graphical user interface design, this

3|P age
Prepared by: Engr. Rex Jason H. Agustin

You might also like