CS101 SHORT NOTES BY TUS
CS101 SHORT NOTES BY TUS
CS101 SHORT NOTES BY TUS
TOPIC 110:
Advantages
4. It is mainly hardware-oriented.
Disadvantages
1. It takes a lot of time and effort to write the code for the same.
architectures.
5. It needs more size or memory of the computer to run the long programs
would be Java. Because of the Java Virtual Machine or JVM it can take
the compiled code for any given Java App and run it on the machine you
the program can only work on the type of computer it was designed
for while Machine independent means the program can work on any
interpreter; anything that converts higher level code into another high-
or machine code.
7. INTERPRETOR: An interpreter is a computer program, which coverts
each high-level program statement into the machine code. This includes
convert the code into machine code (create an exe) before program run.
Interpreters convert code into machine code when the program is run.
Interpreter Compiler
Translates program one statement at a Scans the entire program and translates it
time. as a whole into machine code.
Interpreters usually take less amount of Compilers usually take a large amount of
time to analyze the source code. time to analyze the source code. However,
However, the overall execution time is the overall execution time is
comparatively slower than compilers. comparatively faster than interpreters.
TOPIC 112:
TOPIC 113:
1. DECLARATIVE PARADIGM: Declarative programming is a
programming paradigm in which the programmer defines what needs to be
accomplished by the program without defining how it needs to be
implemented. In other words, the approach focuses on what needs to be
achieved instead of instructing how to achieve it. It is different from an
imperative program which has the command set to resolve a certain set of
problems by describing the steps required to find the solution. Declarative
programming describes a particular class of problems with language
implementation taking care of finding the solution. The declarative
programming approach helps in simplifying the programming behind some
parallel processing applications.
• It has many side effects and • It has no side effects and does
includes mutable variables not include any mutable
as compared to declarative variables as compared to
programming. imperative programming.
TOPIC 114:
1. FUNCTIONAL PARADIGM: Functional programming (often
abbreviated FP) is the process of building software by composing pure
functions, avoiding shared state, mutable data, and side-effects.
Functional programming is declarative rather than imperative, and
application state flows through pure functions, functional
programming means using functions to the best effect for creating
clean and maintainable software. More specifically, functional
programming is a set of approaches to coding, usually described as a
programming paradigm.
TOPIC 115:
1. Object Oriented programming (OOP) is a programming paradigm
that relies on the concept of classes and objects. It is used to structure
a software program into simple, reusable pieces of code blueprints
(usually called classes), which are used to create individual instances
of objects. There are many object-oriented programming languages
including JavaScript, C++, Java, and Python.
2. A class is an abstract blueprint used to create more specific, concrete
objects.
3. Classes can also contain functions, called methods available only to
objects of that type. These functions are defined within the class and
perform some action helpful to that specific type of object.
TOPIC 116:
1. Variables are used to store information to be referenced and manipulated
in a computer program. They also provide a way of labeling data with a
descriptive name, so our programs can be understood more clearly by the
reader and ourselves. It is helpful to think of variables as containers that
hold information. Their sole purpose is to label and store data in memory.
This data can then be used throughout your program.
x = 5;
TOPIC 119:
A control statement alters the execution sequence of the program. Of all the
programming constructs. A control statement is a statement that determines
whether other statements will be executed.
TOPIC 120:
float f=3.5;
if (CGPA>=3.0)
cout<<”Give Scholarship”;
else
cout<<”Sorry you do not qualify for the scholarship”;
HERE :
float= data type
f = variable
= is assignment
3.5 = value
(CGPA>=3.0) = condition
TOPIC 121:
There is another type of control structure known as loop. The loop control structure
iterates a set of instructions based on the provided condition.
LOOP: a loop is a programming structure that repeats a sequence of instructions
until a specific condition is met.
TOPIC 122:
simultaneous execution of multiple activations is called parallel processing or
concurrent processing. True parallel processing requires multiple CPU cores, one
to execute each activation.
+Addition
-Subtraction
*Multiplication
/Division
%Modulus
+, -, and * are the same as used in the mathematics. However, the “/” has a
difference. If one of the operands is decimal number, then it results in the same
way as in mathematics, for example:
5.0/2.0 would result into 2.5.
However, when both operands are integers, then it would truncate the decimal
point and
5/2 would result into 2.
The remaining “1” can be acquired by using the modulus operator (%).
5%2 would give 1.
<Less than
<=Less than or equal to
>Greater than
>=Greater than or equal to
= =Equal to
!=Not Equal to
C++ Relational Operators are used to compare values of two variables. Here in
example we used the operators in if statement.
Now if the result after comparison of two variables is True, then if statement
returns value 1.
And if the result after comparison of two variables is False, then if statement
returns value 0.
Operator Output
AND Output is 1 only when
conditions on both
sides of Operator
become True
• Requirement analysis
• Planning
• Software design such as architectural design
• Software development
• Testing
• Deployment.
SDLC is a systematic process for building software that ensures the quality and
correctness of the software built. SDLC process aims to produce high-quality
software that meets customer expectations. The system development should be
complete in the pre-defined time frame and cost. SDLC consists of a detailed plan
which explains how to plan, build, and maintain specific software. Every phase of
the SDLC life Cycle has its own process and deliverables that feed into the next
phase. SDLC stands for Software Development Life Cycle and is also referred to
as the Application Development life-cycle
TOPIC 128:
• ''Off the shelf'' means the shelf of products in any store, accessible to anyone
who walks into the store. Therefore, Commercial Off-the-Shelf Software
(COTS) is software that is commercially produced and sold in a retail store
or online, ready to use without any form of modification by the user, and
accessible to everyone.
TOPIC 129:
• In the design phase, one or more designs are developed, with which the
project result can apparently be achieved. Depending on the subject of
the project, the products of the design phase can include dioramas,
sketches, flow charts, site trees, HTML screen designs, prototypes, photo
impressions and UML schemas. The project supervisors use these
designs to choose the definitive design that will be produced in the
project.
• In the design phase the architecture is established. This phase starts
with the requirement document delivered by the requirement phase and
maps the requirements into an architecture. The architecture defines the
components, their interfaces and behaviors.
TOPIC 130:
• The implementation phase involves putting the project plan into action. It’s
here that the project manager will coordinate and direct project resources to
meet the objectives of the project plan
• The implementation phase is where you and your project team actually do
the project work to produce the deliverables
• It is during this phase that the project becomes visible to outsiders, to whom
it may appear that the project has just begun. The implementation phase is
the doing phase, and it is important to maintain the momentum.
TOPIC 131:
In general terms, the term coupling is defined as a thing that joins together two
objects. If we talk about software development, then the term coupling is related to
the connection between two modules, i.e. how tight interaction do the two modules
hold with each other is defined by coupling.
Hence, the term coupling is defined as follows: "“The measure of the degree of
the interdependency of two modules on each other is known as coupling."
It should be noted that a module that has high cohesion and low coupling is
functionally independent.
No knowledge of
implementation is needed. Knowledge of implementation is required.
Can be done by trial and error Data domains along with inner or internal
ways and methods. boundaries can be better tested.
• A. Functional
Testing
Types of White Box Testing:
• B. Non-functional
testing
• A. Path Testing
• C. Regression Testing
• B. Loop Testing
• C. Condition testing
Parameter Black Box testing White Box testing
Black Box Testing White Box Testing
It is a testing approach which
It is a testing approach
is used to test the software
in which internal
Definition without the knowledge of the
structure is known to
internal structure of program
the tester.
or application.
It is also called
It also knowns as data- structural testing, clear
Alias driven, box testing, data-, and box testing, code-
functional testing. based testing, or glass
box testing.
Testing is based on external
Internal working is
expectations; internal
Base of Testing known, and the tester
behavior of the application is
can test accordingly.
unknown.
Testing is best suited
This type of testing is ideal
for a lower level of
for higher levels of testing
Usage testing like Unit
like System Testing,
Testing, Integration
Acceptance testing.
testing.
Programming
Programming knowledge is
knowledge is required
Programming knowledge not needed to perform Black
to perform White Box
Box testing.
testing.
Complete
Implementation knowledge is
understanding needs
Implementation knowledge not requiring doing Black
to implement
Box testing.
WhiteBox testing.
Test and programmer are
White Box testing is
Automation dependent on each other, so
easy to automate.
it is tough to automate.
The main objective of this The main objective of
testing is to check what White Box testing is
Objective
functionality of the system done to check the
under test. quality of the code.
Testing can start after Testing can start after
Basis for test cases preparing requirement preparing for Detail
specification document. design document.
Black Box Testing White Box Testing
Performed by the end user, Usually done by tester
Tested by
developer, and tester. and developers.
Granularity Granularity is low. Granularity is high.
Data domain and
It is based on trial and error
Testing method internal boundaries
method.
can be tested.
It is less exhaustive and time- Exhaustive and time-
Time
consuming. consuming method.
Not the best method for Best suited for
Algorithm test
algorithm testing. algorithm testing.
White box testing
requires code access.
Code access is not required
Code Access Thereby, the code
for Black Box Testing.
could be stolen if
testing is outsourced.
It allows removing the
Well suited and efficient for extra lines of code,
Benefit
large code segments. which can bring in
hidden defects.
Low skilled testers can test
the application with no Need an expert tester
knowledge of the with vast experience
Skill level
implementation of to perform white box
programming language or testing.
operating system.
Statement Coverage,
Equivalence partitioning is
Branch coverage, and
Black box testing technique
Path coverage are
is used for Blackbox testing.
White Box testing
Equivalence partitioning technique.
Techniques divides input values into
Statement Coverage
valid and invalid partitions
validates whether
and selecting corresponding
every line of the code
values from each partition of
is executed at least
the test data.
once.
Black Box Testing White Box Testing
Boundary value analysis Branch coverage
validates whether each
checks boundaries for input branch is executed at
values. least once
(ii) The design of the production system which would be compatible to the
achievement of the specified quality.
(iii) Control action to ensure that established quality standards are met.
(iv) Inspection of produced products to see if the overall quality of lots satisfies the
specifications.
Thus, quality control involves inspection of raw materials, parts, gauge, tools and
finished products. It operates when materials and parts are purchased, during
manufacturing process and in case of finished products through performance testing.
Scope of quality control
There are three broad areas where quality control should be applied in manufacturing
industry.
• A stack is a list in which entries are inserted and removed only at the head.
An example is a stack of books where physical restrictions dictate that all
additions and deletions occur at the top (the head of a stack is called the top
of the stack. The tail of a stack is called its bottom or base.
• A queue is a list in which the entries are removed only at the head and new
entries are inserted only at the tail. An example is a line, or queue, of people
waiting to buy tickets at a theater (Figure 104c)—the person at the head of
the queue is served while new arrivals step to the rear (or tail) of the queue.
• Each position in a tree is called a node (Figure 106). The node at the top is
called the root node (if we turned the drawing upside down, this node would
represent the base or root of the tree). The nodes at the other extreme are
called terminal nodes (or sometimes leaf nodes). We often refer to the
number of nodes in the longest path from the root to a leaf as the depth of
the tree. In other words, the depth of a tree is the number of horizontal layers
within it
• A database schema is the skeleton structure that represents the logical view
of the entire database. It defines how the data is organized and how the
relations among them are associated. It formulates all the constraints that are
to be applied on the data.A database schema defines its entities and the
relationship among them. It contains a descriptive detail of the database,
which can be depicted by means of schema diagrams. It’s the database
designers who design the schema to help programmers understand the
database and make it useful.
• A Database Management System (DBMS) is software designed to store,
retrieve, define, and manage data in a database.
• DBMS software primarily functions as an interface between the end user and
the database, simultaneously managing the data, the database engine, and the
database schema in order to facilitate the organization and manipulation of
data.
• SELECT (σ)
The SELECT operation is used for selecting a subset of the tuples according to a
given selection condition. Sigma(σ)Symbol denotes it. It is used as an expression
to choose tuples which meet the selection condition. Select operator selects tuples
that satisfy a given predicate.
• Join Operations
Join operation is essentially a cartesian product followed by a selection criterion.
JOIN operation also allows joining variously related tuples from different relations.
COMMIT ROLLBACK
The Two-Phase Locking protocol allows each transaction to make a lock or unlock
request in two steps:
• Growing Phase: In this phase transaction may obtain locks but may not
release any locks.
• Shrinking Phase: In this phase, a transaction may release locks but not
obtain any new lock
• A sequential file contains records organized by the order in which they were
entered. The order of the records is fixed.Records in sequential files can be
read or written only sequentially.After you place a record into a sequential
file, you cannot shorten, lengthen, or delete the record. However, you can
update (REWRITE) a record if the length does not change. New records are
added at the end of the file.If the order in which you keep records in a file is
not important, sequential organization is a good choice whether there are
many records or only a few. Sequential output is also useful for printing
reports.
• ISAM (an acronym for indexed sequential access method) is a method for
creating, maintaining, and manipulating computer files of data so that
records can be retrieved sequentially or randomly by one or more keys
• Hash data is a numerical representation of data and is not easy for a human
to interpret. A hash file is a file that has been converted into a numerical
string by a mathematical algorithm. This data can only be understood after
it has been unencrypted with a hash key.