0% found this document useful (0 votes)
88 views8 pages

Bachelor of Business Administration: (Information Technology)

The document is an assignment from Mittal School of Business for the course "Object Oriented Analysis and Design". It contains questions and answers submitted by a student named Shivam Tripathi for the assignment. The questions are about the differences between top-down and bottom-up programming, the differences between computer programs and computer software, the relationship between classes and interfaces in UML, and the differences between include and extend relationships with examples.

Uploaded by

Shivam Tripathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views8 pages

Bachelor of Business Administration: (Information Technology)

The document is an assignment from Mittal School of Business for the course "Object Oriented Analysis and Design". It contains questions and answers submitted by a student named Shivam Tripathi for the assignment. The questions are about the differences between top-down and bottom-up programming, the differences between computer programs and computer software, the relationship between classes and interfaces in UML, and the differences between include and extend relationships with examples.

Uploaded by

Shivam Tripathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

LOVELY PROFESSIONAL UNIVERSITY

ACADEMIC TASK - 1
ASSIGNMENT

Mittal School of Business (MSOB). Faculty: Rohit Sethi


Course Code: CAP315 Section: Q1915

Course Title: OBJECT ORIENTED ANALYSIS AND DESIGN

Question and answers

Online Assignment 1

Bachelor of Business Administration

(Information Technology)

LOVELY PROFESSIONAL UNIVERSITY

PHAGWARA, PUNJAB

Submitted By :

Name of student: Shivam Tripathi

Registration Number: 11900954


Q1. What is the difference between top down and bottom up programming?

Ans.

Top down programming - In the top-down approach, a complex algorithm is broken


down into smaller fragments, better known as ‘modules.’ These modules are then
further broken down into more smaller fragments until they can no longer be
fragmented. This process is called ‘modularization.’ However, during the
modularization process, you must always maintain the integrity and originality of the
algorithm.

By breaking a bigger problem into smaller fragments, the top-down approach


minimizes the complications usually incurred while designing algorithms. Furthermore,
in this approach, each function in a code is unique and works independently of other
functions. The top-down approach is heavily used in the C programming language.

Bottom Up programming - Contrary to the top-down approach, the bottom-up


approach focuses on designing an algorithm by beginning at the very basic level and
building up as it goes. In this approach, the modules are designed individually and are
then integrated together to form a complete algorithmic design.

So, in this method, each and every module is built and tested at an individual level (unit
testing) prior to integrating them to build a concrete solution. The unit testing is
performed by leveraging specific low-level functions.

o While the top-down approach focuses on breaking down a big problem into
smaller and understandable chunks, the bottom-up approach first focuses on
solving the smaller problems at the fundamental level and then integrating them
into a whole and complete solution.
o The top-down approach is primarily used by structured programming languages
such as C, COBOL, Fortran. On the contrary, the bottom-up approach is preferred
by OOP languages such as C++, C#, Python, Java, and Perl.
o In the top-down approach, each module and submodule are processed
separately, and hence, they might contain redundant information. However, the
bottom-up approach relies on data encapsulation and data-hiding, thereby,
minimizing redundancy.
o The top-down approach doesn’t require the modules to have a well-established
line of communication among them, whereas, in the bottom-up approach, the
modules must have a certain degree of interaction and communication among
them.
o While the top-down approach can be used in module documentation, debugging,
and code implementation, the bottom-up approach is primarily used in testing.

Thus, in conclusion, we can say that the top-down approach is rather the conventional
method that seeks to decompose a complex problem into smaller fragments (from high-
level specification to low-level specification), the bottom-up approach works is just the
opposite – it first concentrates on designing the fundamental components of an
algorithm and then moves up to a higher level to achieve a complete result.

Q2 . Differentiate between computer program and computer software?

Ans.

Computer program - A computer program is a collection of instructions that performs a


specific task when executed by a computer. Most computer devices require programs to
function properly. A computer program is usually written by a computer programmer in a
programming language. Once it is written, the programmer uses a compiler to turn it into a
language that the computer can understand.

A computer program is stored as a file on the computer’s hard drive. When the user runs the
program, the file is read by the computer, and the processor reads the data in the file as a list
of instructions. Then the computer does what the program tells it to do.

• A program is set of instructions which perform only a specific type of task.

• A program consists of a set of instructions which are coded in a programming


language like C, C++, PHP, Java etc.

• A program cannot be classified into various categories.

• Source code in a program is written for small jobs.

• Program showing whether a given number is even or odd, program to find factorial of
a number, program to find greatest of all given numbers, program to check whether a
given number is palindrome or not; are few examples of the program.

Computer software - Computer software popularly referred to as software, is a set of


instructions, data or programs used to operate computers and execute specific tasks. It
includes all programs on a computer such as applications and the operating system. Software
is often divided into three categories:

Application software. This is intended to perform certain tasks. Examples of application


software include office suites, gaming applications, database systems and educational
software.

Programming Software. Programming software is a set of tools to aid developers in writing


programs. The various tools available are compilers, linkers, debuggers, interpreters and text
editors.
System Software. System software act as a base for application software. Examples include
device drivers, operating systems, compilers, disk formatters, text editors and utilities helping
the computer to operate more efficiently. System software is usually written in C
programming language.

• The software is a broad term which is designed to perform some specific set of
operations.

• A software consists of bundles of programs and data files. Programs in a specific


software use these data files to perform a dedicated type of tasks.

• A software can be classified into two categories: application software and system
software.
• An application software comes in wide range of varieties like a text editor, media
player, web browser, video player, video editor, image editor. Different types of
application software provide a different type of services.

• A system software acts as an interface between hardware and an application


software. Whenever a user wants to do a specific job, he gives commands to
application software. These commands are delivered to application software via
system software. All of the system software provide same kind of services. An
operating system is a type of system software.

• Examples of “application software” are: Microsoft Word, Microsoft Excel, Google


Chrome, VLC media player, Firefox, Adobe Reader etc.
Examples of “system software” are: Windows, Linux, Unix, Mac etc.

Q3. How classes and interface in UML are related?

Ans.

We can use interfaces in class diagrams and component diagrams to specify a


contract between the interface and the classifier that realizes the interface. Each
interface specifies a well-defined set of operations that have public visibility.
The operation signatures tell the implementing classifiers what kind of behavior
to invoke, but not how they should invoke that behavior. Many classifiers can
implement a single interface, each one providing a unique implementation.
Interfaces support the hiding of information and protect client code by publicly
declaring certain behavior or services. Classes or components that realize the
interfaces by implementing this behavior simplify the development of
applications because developers who write client code need to know only about
the interfaces, not about the details of the implementation. If we replace classes,
or components that implement interfaces, in our model, we do not need to
redesign our application if the new model elements implement the same
interfaces.
We can specify the following types of interfaces:
• Provided interface
• Required interface

Provided interface -They are these interfaces describe the services that
instances of a classifier (supplier) offer to their clients.

• Characterize services that the component offers to its environment.


• Is modeled using a ball (lollipop) symbol, labelled with the name, attached
by a solid line to the component.

Required interface -They are these interfaces specify the services that a
classifier needs to perform its functions and to fulfill its own obligations to its
clients.

• Characterize services that the component expects from its environment.


• Is modeled using a socket symbol, labelled with the name, attached by a
solid line to the component.

Q4. Differentiate between include and extend with the example ?

Ans.

Extend is used when a use case conditionally adds steps to another first class use case. For
example, imagine "Withdraw Cash" is a use case of an ATM machine. "Assess Fee" would
extend Withdraw Cash and describe the conditional "extension point" that is instantiated
when the ATM user doesn't bank at the ATM's owning institution. Notice that the basic
"Withdraw Cash" use case stands on its own, without the extension.

• Extending use case typically defines optional behaviour. It


is independent of the extending use case.

• Extend, one can live without the other only some instances
the use case will extend to another use case to do some
stuff. For example, you can create an order but if the
order is for a new customer you possible have to do
additional check which you do not have to do for existing
customers. In that case you can have an extend use case.

Include is used to extract use case fragments that are duplicated in multiple use cases. The
included use case cannot stand alone and the original use case is not complete without the
included one. This should be used sparingly an only in cases where the duplication is
significant and exists by design (rather than by coincidence). For example, the flow of events
that occurs at the beginning of every ATM use case (when the user puts in their ATM card,
enters their PIN, and is shown the main menu) would be a good candidate for an include.
• Include used to extract common parts of the behaviours of
two or more use cases.

• Include, one cannot live without the other. The use case
must include another use case. For example when you create
an order you always must verify name etc.

• When a use case is depicted as using functionality of another


functionality of another use case, this relationship between the use
cases is named as an include or uses relationship.
• A use case includes the functionality described in another use case as a
part of its business process flow.
• A uses relationship from base use case to child use case indicates that
an instance of the base use case will include the behavior as specified in
the child use case.
• An include relationship is depicted with a directed arrow having a
dotted line. The tip of arrowhead points to the child use case and the
parent use case connected at base of the arrow.
• The stereotype "<<include>>" identifies the relationship as an include
relationship.

eg:-
Use case I am going to city.

Includes -> drive the car


Extends -> fill the petrol

Fill the petrol may not be required at all times but may
optionally be required based on the amount of petrol left
in the car.
Drive is a prerequisite hence I am including.

Q5. Discuss in detail the different type of “Things” that are used in UML diagram
With the help of example ?

Ans.
As UML describes the real-time systems, it is very important to make a
conceptual model and then proceed gradually. The conceptual model of
UML can be mastered by learning the following three major elements −

• UML building blocks


• Rules to connect the building blocks
• Common mechanisms of UML
This chapter describes all the UML building blocks. The building blocks
of UML can be defined as −
• Things
• Relationships
• Diagrams

Things
Things are the most important building blocks of UML. Things can be −
• Structural
• Behavioral
• Grouping
• Annotational
• Structural Things
Structural things define the static part of the model. They represent the
physical and conceptual elements. Following are the brief descriptions of the
structural things.
Class − Class represents a set of objects having similar responsibilities.

Interface − Interface defines a set of operations, which specify the


responsibility of a class.

Collaboration −Collaboration defines an interaction between elements.

Use case −Use case represents a set of actions performed by a system for a
specific goal.

Component −Component describes the physical part of a system.

Node − A node can be defined as a physical element that exists at run time.
Behavioral Things
A behavioral thing consists of the dynamic parts of UML models. Following
are the behavioral things −
Interaction − Interaction is defined as a behavior that consists of a group of
messages exchanged among elements to accomplish a specific task.

State machine − State machine is useful when the state of an object in its life
cycle is important. It defines the sequence of states an object goes through in
response to events. Events are external factors responsible for state change

Grouping Things
Grouping things can be defined as a mechanism to group elements of a UML
model together. There is only one grouping thing available −
Package − Package is the only one grouping thing available for gathering
structural and behavioral things.

Annotational Things
Annotational things can be defined as a mechanism to capture remarks,
descriptions, and comments of UML model elements. Note - It is the only one
Annotational thing available. A note is used to render comments, constraints,
etc. of an UML element.

You might also like