0% found this document useful (0 votes)
65 views72 pages

Diploma in Computer Applications: Mbika Upta

The document discusses various programming techniques including unstructured programming, structured/procedural programming, modular programming, and object-oriented programming. It then provides an overview of SQL Server/SQL, including the components of SQL, integrity constraints, keys, and how to create databases and tables in SQL. The document also provides a brief history of programming languages such as Fortran, COBOL, BASIC, Pascal, C, C++, Java, PHP, and JavaScript.

Uploaded by

dharamvir
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)
65 views72 pages

Diploma in Computer Applications: Mbika Upta

The document discusses various programming techniques including unstructured programming, structured/procedural programming, modular programming, and object-oriented programming. It then provides an overview of SQL Server/SQL, including the components of SQL, integrity constraints, keys, and how to create databases and tables in SQL. The document also provides a brief history of programming languages such as Fortran, COBOL, BASIC, Pascal, C, C++, Java, PHP, and JavaScript.

Uploaded by

dharamvir
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/ 72

DCA

DIPLOMA IN COMPUTER APPLICATIONS

 Introduction to Programming Techniques


 Overview of SQL Server
 Introduction to System Analysis & Design
 Introduction to C
 Introduction to C++ with OOPs
 Visual Basic 6.0
 Communication Skill

mbika upta

1
INTRODUCTION TO PROGRAMMING
TECHNIQUES

 Various Programming Techniques


 Unstructured Programming
 Structured/Procedural Programming
 Modular Programming
 Object-Oriented Programming
 Introduction to Programming History

2
Various Programming Techniques
A Program is a set of instructions written in a particular manner
to achieve a goal. A program is written in a Programming Language
and converted into assembly Language by the computer and then
converted into Machine Language which is understandable by the
computer.

Unstructured Programming: -

In this approach programmer put all code at one place. When lines of
code increases, situation starts getting unmanageable. Problems of
duplicity and redundancy of code may occur. Code becomes
unreadable.

Structured/Procedural Programming: -

In this approach a problem is divided into sub-problems and each


sub-problem is further divided into sub-sub-problems. This process
continues until we reach a stage where each sub-problem can be
easily handled. Thus a complex program is broken up into a series of
steps called a Function.

3
Modular Programming: -

Modular programming (also called "top-down design" and "stepwise


refinement") is a software design technique that emphasizes
separating the functionality of a program into independent,
interchangeable modules.

In this programming technique common functions are grouped into


modules. This approach helps in dividing programs into small parts
called modules.

All modules can have their own data and also they are capable to
maintain their internal state.

4
Object-Oriented Programming: -

OOPs approach is designed around the data being processed. In fact,


data is the soul of any program and OOPs defines the relationship
between the data and its associated operations in such a way that
the access to data is allowed only through its code or functions. Such
combination of data and function is called an Object. Thus the data is
hidden from the general view but visible to functions within the
same Object.

In object-oriented programming, these two concepts (data and


functions) are bundled into objects. This makes it possible to create
more complicated behavior with less code.

5
Introduction to Programming History
 The first Programming is over 175 years old and was written by
a woman, Ada Lovelace in Assembly Language.

 1957 – Fortran (Formula Translation) introduced by IBM. High


Level Language for numeric and scientific computing. An
alternative to Assembly Language.

 1958 – LisP (List Processor) High-level. For mathematical


notation.

 1959 - Cobol (Common Business-Oriented Language) High-level.


Primarily for business computing. First programming language
to be mandated by the US Department of Defense.

 1964 - BASIC (Beginner’s All-purpose Symbolic Instruction


Code) General-purpose, high-level. Designed for simplicity.
Popularity exploded in the mid- ‘70s with home computers;
early computer games were often written in Basic, including
Mike Mayfield’s Star Trek.

 1970 - Pascal (after French mathematician/physicist Blaise


Pascal) High-level Language.

 1972 - C (based on an earlier language called "B") General-


purpose, low-level. Created for Unix systems. Currently the
world’s most popular programming language.

 Many leading languages are derivatives, including C#, Java,


JavaScript, Perl, PHP, and Python.

 1980 - Ada (After Ada Lovelace, inventor of the first


programming language) High-level. Derived from Pascal.

6
Contracted by the US Department of Defense in 1977 for
developing large software systems.

 1983 - C++ (formerly “C with Classes”; ++ is the increment


operator in “C”) Intermediate-level, object-oriented. An
extension of C, with enhancements such as classes, virtual
functions, and templates.

 1995 - Java (for the amount of coffee consumed while


developing the language) General-purpose, high-level. Made
for an interactive TV project. Cross-platform functionality.
Second most popular language (behind C)

 1995 - PHP ("Personal Home Page") Open-source, general-


purpose. For building dynamic web pages. Most widely used
open-source software by enterprises.

 1995 - JavaScript (LiveScript). High-level Language created to


extend web page functionality. Dynamic web pages’ use for
form submission, validation, interactivity, animations, user
activity tracking, etc.

7
OVERVIEW OF SQL SERVER
(Structured Query Language)

 Introduction
 Components of SQL
 SQL Integrity Constraints
 Key Constraints
 Creating Database & Tables
 Data Types
 Querying & Modifying Data
 Subqueries & Joins
 Views & Derived Tables
 Triggers

8
Introduction

Database
A database is a collection of data (Here data is the raw information
which is fed into the database). This data then forms the base for all
further activities like performing mathematical, logical or any other
operations. The databases which support Structured Query Language
are all Relational databases. A Relational database is a collection of
related information. Concept of RDBMS was introduced by E F Codd.

Table (Relation)
a table is a place in database where all data is stored and organized.
a table is made up of rows (tuples) and columns (fields).

Record/Row
a row is a record of data in database. It is an individual entry that
exists in the table.

Column
A column specifies a particular data. It also corresponds to the name
given to it.

Field
A field is designed to maintain specific information about every
record.

9
Data Base Management Systems
A DBMS is the tools that support operations on databases. It enables
users to create and maintain databases. MySQL is a powerful RDBMS
tool that provide access, manipulation, retrieval, updating of data.

SQL
SQL is a language of database. It includes database creation,
modification, retrieval, updating and back-up. It is the standard
language for RDBMS. All RDBMS like MS-Access, Oracle, Sybase, SQFL
Server and Informix use SQL.

Components of SQL

Data Definition Language


Commands used to Create, Modify and Delete database structures.
An ordinary user can’t use DDL. It is used by the database
administrator. Example:
CREATE TABLE, ALTER TABLE, DROP TABLE

Data Manipulation Language


DML syntax allow manipulating data within tables. Example:
INSERT, UPDATE, DELETE

Data Control Language


DCL commands control the access to database and table data. These
commands are used to grant and revoke authorization for database
access. Example:
COMMIT, SAVEPOINT, GRANT/REVOKE,
ROLLBACK, SET TRANSACTION
10
Data Query Language
DQL is essentially SQL syntax that allows the manipulation of
information. SELECT is the DQL command.

What is a Null Value?


Null Value is a field that appears to be blank. Null Value is different
than a zero value or a field that contains spaces.

SQL Integrity Constraints

Constraints are the rules enforced on data columns on table. These


are used to limit the type of data that go into a table. These rules
ensure the accuracy and reliability of data in database. Rules can be
column level or table level. Column level constraints are applied only
to a single column while table level constraints are applied on entire
table. Commonly used constraints are: -

NOT NULL Constraint  Ensures that a column cannot have null


value.
DEFAULT Constraint  Provides a default value for a column where
none is specified.
UNIQUE Constraint  Ensures that all values in a column are
different. Avoid duplicate values.
CHECK Constraint  Ensures that all values in a column satisfy
certain conditions.
INDEX Constraints  Used to create and retrieve data from the
database very quickly. CREATE INDEX command is used to create
indexes in table. syntax: -

11
mysql>CREATE INDEX INDEX_NAME ON TABLE_NAME
(COLUMN_NAME); 

mysql>CREATE UNIQUE INDEX INDEX_NAME ON


TABLE_NAME (COLUMN_NAME); 

Keys Constraints

Keys are the ways of connecting tables. These help in creating


relation between them. There are 4 type of Keys: -

Primary Key
A Primary Key uniquely identifies each row in a table. Oracle tables
must have only one Primary Key.

Candidate Key
Candidate Keys are the attributes that can uniquely identifies the
row.

Alternative/Surrogate Key
It is used in case there is no possibility of naming a Primary Key. then
we can assign another Key as Primary Key.

Foreign Key
A Foreign Key is normally a single field directly references a Primary
Key in another table to enforce referential integrity.

12
Creating Database and Tables

Creating a database:

mysql>CREATE DATABASE STUDENT;


mysql>SHOW DATABASES; 
mysql>USE STUDENT; 
mysql>DROP DATABASE STUDENT; 

Creating a table:

mysql>SHOW DATABASES; 
mysql>USE STUDENT; 
mysql>CREATE TABLE TABLENAME (COL_1 TYPE(MAX_LENGTH),
COL_2 TYPE(MAX_LENGTH), COL_N TYPE(MAX_LENGTH)); 

mysql>CREATE TABLE STUDENTINFO (STUDENT_ID VARCHAR(5),


NAME CHAR(20), ADDRESS VARCHAR, CONTACT INT(10)); 

mysql>INSERT INTO TABLE_NAME (COL_1, COL_2, COL_N) VALUES


(VALUE_1, VALUE_2, VALUE_N);

mysql>INSERT INTO STUDENTINFO (STUDENT_ID, NAME, ADDRESS,


CONTACT) VALUES (N001, ‘ATISH’, NARWANA, 9953612378); 

13
Data Types

A data type defines what type of values a column can contain.


Following table lists the general datatypes in SQL: -

Data Type Value Type Description

INT Numerical Numeric Whole Numbers


CHAR Alphabetical Fixed Length character
String Max size 255
VARCHAR Mix Variable Length
Alphanumeric data, Max size
2000 characters
NUMBER(p, s) Float Values p=precision digit range=1 to
38 and s=decimal points
BOOLEAN True/False
DATE date and time Format=DD-MON-YY

14
Querying and Modifying Data
Query
SELECT * FROM TABLE_NAME; 

WHERE Clause
WHERE Clause is used to extract only the records that fulfill the
specified condition.

SELECT * FROM TABLE_NAME WHERE COL_N= VALUE; 

UPDATE Statement
Update command is used to modify data values within one or more
columns for one or more rows of a table. Syntax:
mysql>UPDATE TABLE_NAME SET COLUMN_NAME = VALUE
EXPRESSION; 

Subqueries
A subquery is a query within another query also known as nested
query. It is used to return data that will be used in the main query as
a condition to further restrict the data to be retrieved.

SELECT * FROM TABLE_NAME WHERE COL_N= VALUE AND


COL_N=VALUE; 

Joins
JOIN is the most powerful feature of SQL. Without JOIN entire
RDBMS concept would not be feasible. It is the capability to select
data from multiple tables. A JOIN combines two or more tables to
retrieve data according to the needs of Query.
15
Views & Derived Tables

A View is a single table that is derived from other tables. These other
tables could be base tables or previously defined views. A view does
not necessarily exist in physical form, means a view does not contain
data. it is considered a virtual table. In fact, a view is a way of
specifying a table.

Programming with transact-SQL


Though SQL is a very powerful tool for handling large databases but
it does not support procedural concepts or iterations. Developers
have launched PL/SQL and transact-SQL. These offer language
constructs with SQL statements.

Triggers

Concept of triggers is a technique for specifying certain type of active


rules. A trigger consists of three components: -

The Event  Events are usually database update operations that are
explicitly applied to the database.
The Condition  It determines whether the rule action should be
executed.
The Action  Usually a sequence of SQL statements, a database
transaction or an external program that will executed automatically
if the condition applied is true.

16
Practical_1
Consider the table Employee(Emp_No, Emp_Name,
Date_Of_Joining, Basic_Salary)
Write query to create above table with proper data type and define
Emp_No as PRIMARY KEY.
Write query to insert data / record of 2 employees to the above
table.
Write query to display records of employees from Employee table
whose Date_Of_Joining is less than 01_01_2013 & Basic_Salary
between 5000 and 6500.

CREATE TABLE EMPLOYEE(EMP_NO INT(5), EMP_NAME


VARCHAR(20), DATE_OF_JOINING DATE, BASIC_SALARY
DECIMAL(8,2), PRIMARY KEY(EMP_NO)); 

INSERT INTO EMPLOYEE(EMP_NO, EMP_NAME, DATE_OF_JOINING,


BASIC_SALARY) VALUES(1, “ROHIT”, “2012-04-01”, 5200); 

INSERT INTO EMPLOYEE(EMP_NO, EMP_NAME, DATE_OF_JOINING,


BASIC_SALARY) VALUES(2, “RAJ”, “2013-04-01”, 5500); 

SELECT * FROM EMPLOYEE WHERE DATE_OF_JOINING < “2013-01-


01” AND BASIC_SALARY BETWEEN 5000 AND 6500; 

EMP_NO EMP_NAME DATE_OF_JOINING BASIC_SALARY

1 ROHIT 2012-04-01 5200.00

1 row in set (0.03 sec)


MYSQL>_

17
Practical_2

Consider the Examination (Course_Code, Course_Name, Semester,


Stud_Appeared)
Write query to create above table with proper type and define
Course_Code as PRIMARY KEY.
Write a query to insert data / record to the above table.
Write query to display record from above table whose Semester is
2 and Course is DCA.

CREATE TABLE EXAMINATION(COURSE_CODE INT(5), COURE_NAME


VARCHAR(20), SEMESTER INT(5), STUD_APPEARED INT(5), PRIMARY
KEY(COURSE_CODE)); 

INSERT INTO EXAMINATION(COURSE_CODE, COURE_NAME,


SEMESTER, STUD_APPEARED) VALUES(1, “DCA”, 1, 400); 

INSERT INTO EXAMINATION(COURSE_CODE, COURE_NAME,


SEMESTER, STUD_APPEARED) VALUES(2, “DCA”, 2, 200); 

INSERT INTO EXAMINATION(COURSE_CODE, COURE_NAME,


SEMESTER, STUD_APPEARED) VALUES(3, “PGDCA”, 5, 400); 

INSERT INTO EXAMINATION(COURSE_CODE, COURE_NAME,


SEMESTER, STUD_APPEARED) VALUES(4, “PGDCA”, 1, 300); 

INSERT INTO EXAMINATION(COURSE_CODE, COURE_NAME,


SEMESTER, STUD_APPEARED) VALUES(5, “DCA”, 2, 300); 

18
SELECT * FROM EXAMINATION WHERE SEMESTER=2 AND
COURSE_NAME=”DCA”; 

COURSE_CODE COURE_NAME SEMESTER STUD_APPEARED


1 DCA 2 400

1 row in set (0.02 sec)

MYSQL>_

19
System Analysis & Design
 Definition
 Types of a System
 Characteristics of a System
 Elements of a System
 Base for planning for System analysis
 Duties and Job Description of system analyst
 System Development Life Cycle and its Phases
 Tools of Structured Analysis – DFD, Data Dictionary

20
Definition
The word “System” has been derived from Greek word “Systema”,
which means an organized relationship among functioning units and
components. A System is designed to achieve an objective.
A metro railway works as a system. Stations, Control room, trains,
employees, all work together to achieve a goal.
Computer System is also a collection of components organized to
accomplish specific functions.

Types of a System

Open & Close

Physical & Abstract TPS


System
Deterministic &
OAS
Probabilistic

Information system MIS

DSS

ES

21
Open & Closed Systems: -
Open systems can interact with outer environment. These can
change as per in environment. On the other hand, closed systems do
not interact with external environment, has a very short survival time
and are very rare.

Physical & Abstract systems: -


Physical systems and their components can be seen with eyes. While
Abstract systems do not exist physically. They are only concepts,
theories and principles.

Deterministic & Probabilistic Systems: -


Deterministic systems are the Systems whose outcomes are certain
and are based on a predetermined set of rules. While systems whose
outcomes are uncertain are called Probabilistic systems.

Information systems: -
An Information System is an arrangement of people, data, processes,
interfaces and geography that are integrated for the purpose of
improving day-to-day operations in a business. Information system
has been categorized into several types based on their processes and
functions. Most common Information systems are:

Transaction Processing System


the most common example of TPS are payroll and inventory. TPS
System deals with a large amount of data and processes it in a
routine business activity. The main objective of a TPS is to increase
the speed and efficiency of transaction processing.

Office automation system


OAS helps in automating daily office activities like word processing,
spreadsheets, communication, desktop publishing, record
arrangements, etc.

Management Information system


22
As the name, MIS Systems are for the management to analyze the
information and take decisions. In MIS data is taken as an input from
TPS or other systems and is processed (converted) into meaningful
information (outputs).

Decision Support system


DSS is a computer based information system that helps a user to take
decisions in semi-structured situations. DSSs provide solutions and
assist users. these systems identify plans and actions for the
problems.

Expert system
ES are special Systems that are designed to manipulate knowledge
rather than information.

Characteristics of a System
Central Objective: -
A System has a core objective which needs be fulfilled.

Organization: -
A System is laid out according to the manner in which the work
flows.

Integration: -
The entire system as a whole is weaved together as one for the
procurement of desired output.

Interaction: -
The change or process in one component of a system affect other
subsystems because all components interact with each other.

Interdependence: -
A system is said successful when it’s all components or subsystems
function properly and provide input and output to each other.
23
Elements of System
Inputs: -
In order to operate and functions a system needs inputs.

Processor: -
a part of the system which processes or manipulate input into output
(data into result).

Outputs: -
This is the element for which the entire system is built. Output is the
result that is desired by the user.

Control: -
For any system to operate efficiently and effectively, control is
required over all inputs, processes, outputs and other activities.
Environment: -
All the components which affect the performance of the system
constitute the environment of the system.

Feedback: -
When the output is obtained, it is compared with the standard result
and the information gathered is called feedback.

Boundaries/Interface: -
each System has certain limitations and it has to work under those
defined limitations.

24
Base for planning for system Analysis
A System is planned to achieve a Top Management
goal. To achieve this goal an
organization set up various Middle Management
strategies. So it is necessary to
have strategic planning for a Operational Management
System.

Life cycle Models

Sequential Models: -
 Classical waterfall Model
 Interactive Waterfall Model
 Rapid Application Developments Model

Prototype Models: -
 Incremental Model
 Spiral Model
 Component Based Development Model

25
Waterfall Model

Duties and job description of a System


Analyst
System analyst is a person who studies the problems and needs of an
organization to determine how people, data, processes,
communication and information technology can best accomplish
improvements for the business. The duty of a System analyst is to
analyze, design and implement systems that suit organizational
requirements. these are:

 Identify the problem.


 Analyze and understand the problem.
 Identify solution requirements according to the organization
expectations.
 Identify alternative solution and decide a course of action.
 Design and implement the best solution.
 Evaluate the results. if the problem is not solved, return to step
1 or 2 as appropriate.

26
System Development Life Cycle and its
phases
SDLC is a process divided into phases from starting point to
implementation of a System. This is a long term process and divided
into several phases.

Phases of SDLC: -

Initial Investigation: -
It is the first phase of SDLC. A System is made to solve the problem.
So process is start with recognition of needs. This step is called
problem definition. This phase involves primary survey, investigation
expectations and objectives.

Feasibility study: -
Feasibility study is an evaluation to determine the difficulty in
carrying out of task. A framework called PIECES is formulated in this
phase for identifying problems.

P Performance
I Information
E Economy
C Control
E Efficiency
S Services

Objectives of this phase are:


 To decide number and designation of person involved in
operating the whole process.
 To estimate the benefits of the system.
 Cost estimation.

27
Feasibility study is evaluated on the basis of economic, operational,
technical and legal aspects. This phase may result in the decision that
System is found to be feasible.

Analysis: -
In this phase System boundaries are determined. The focus in this
phase is to understand the relevant facts and to determine what will
be needed to solve the problem. At the end of this phase a detailed
logical model of required System is available along with pertinent
data.

Design: -
In Design phase “when and what the System is to do?” is converted
to “how the system shall do it?” This phase involves:

 High level design, where the general approach is decided.


 Low level design which is the actual design.
 Inputs and Outputs
 Files and Databases
 Procedures
Specific hardware and software are made at this phase. The output
of detailed design is used to program the System.

Development: -
Development is the stage where the actual system is constructed.
Therefore, this phase is also called Construction phase. This phase
composed of:

 Programming of System.
 Testing at various levels (Units, Systems, User’s acceptance).
 At the end of this phase the System is ready and is tested by
the developers.

Implementation: -

28
This phase involves to install the System, to train the users for using
the System and to provide them the documentation. At the end of
this phase the user start using the System for actual operation.

Maintenance: -
Once the System is implemented, it is to remain in use for as long as
it continues to solve its objectives. Maintenance are the on-going
activities required for the System to operate smoothly. Typically, this
phase is the longest in the SDLC as this phase involves fixing the
bugs, detecting hardware problems, enhance the System, correcting
code and documentation.

29
Tools of Structured Analysis
Algorithms
Step by step Instructions that solve a problem are called Algorithm.

Flow Charts
A Flow Chart is the graphical representation of an operation or a
process.

Data Flow Diagrams


DFDs are used to specify how data flows between the functions of a
System. Larry Constantine first developed DFDs as a way of
expressing System requirements in a geographical form. A DFD is the
starting point of Design Phase.

Basic elements of a DFD

Data Flow

Entity Data Store


Process

30
Data Dictionaries
A Data dictionary is a catalogue of the data elements in the system. It
stores the details and the descriptions of data flows, data stores and
processes. It also specifies values and units for the information in the
data flows and data stores.

Data Name Data Description Number of characters


NAME Name 16
F_NAME Father Name 16
D_O_B Date of Birth 8
ADD Address 50

31
INTRODUCTION TO C

32
1. Historical Development of C .................................................... 34
2. First C Program......................................................................... 35
3. Datatypes and variables ........................................................... 36
4. Constants, Literals and Type Conversion .................................. 37
5. C Keywords, Identifiers and Operators .................................... 38
6. Decision, Control Structure and Loops ..................................... 39
7. Pointers, Arrays & Strings ........................................................ 40
8. Functions.................................................................................. 41
9. Structure and Storage Classes .................................................. 42
10. File Handling ............................................................................ 43
11. Accept 50 numbers in Array ..................................................... 44
12. Two-Dimensional array ............................................................ 46
13. Sort Elements in Array ............................................................. 48
14. Calculate Sum & Average in Array ............................................ 50

33
Historical Development of C
C is a general purpose high level programming language. It was
developed by Dennis M. Ritchie at the Bell Lab to develop Unix
Operating system. C was first implemented on Pop-II computer in
December 1972.

Many leading languages are derivatives, including C++, C#, Java,


JavaScript, Perl, PHP, and Python.

Parts of C Languages: -
 Operating system
 Language Compilers
 Language Interpreters
 Language Assemblers
 Network Drivers
 Print Spoolers
 Text Editors
 Databases
 Utilities

A C Program may carry from three lines to millions of lines and it


should be written into one or more text files with extension .C. It
must be compiled and debug before it run.

34
First C Program
//Print some text on screen

#include<stdio.h>
void main()
{
printf("Hello!");
getch();
}

Alt + F9  Compile the Program


Ctrl + F9  Run the Program

 First line of program is a preprocessor command, which tells a C


compiler to include stdio.h file before going to actual
compilation.
 void main () is the main function where the program execution
begins.
 Next printf () method is used to display on the screen.
 Finally, getch () function is used to get the application result.

Character Set
Alphabet: A . . . . . .Z & a . . . . . .. .z
Digits: 0 . . .. . . . . . .9
Special symbols: All symbols in a standard keyboard

35
Datatypes and variables

Variables: -
A variable is a storage location. Variables are used to hold values that
may vary during the execution of the program.

Rules for constructing variables names: -


 A variable name is any combination of max 31 alphabets, digits
or underscore.
 First character in the variable name must be an alphabet or
underscore.
 No commas, blanks or other symbols are allowed within a
variable name.
 An integer variable is 2 bytes, float variable is 4 bytes wide,
while a double variable is 8 bytes wide.

36
Constants, Literals and Type Conversion
A constant is an entity that never change its value during the
execution of the program.

Range for Constants: -


 Integer Constant -32768 to 32767
 Real Constant -3.4e38 to 3.4e38
 Character Constant A single character within single quotes

Type Conversion: -

Type conversion is the feature of converting a variable from one


form to other. For example, integer to string.

37
C Keywords, Identifiers and Operators

Keywords: -
Keywords are special reserved words which are already explained in
C Language. These keywords cannot be used as variable names.
There are 32 keywords in C.

Identifiers: -
Identifiers are the name of variables, constants, functions, arrays or
classes.

Operators: -
Operators are symbols that are used with variables to perform a
mathematical, comparison or logical operation.

38
Decision, Control Structure and Loops

Decision: -
C provides if, if-else, if-else-if conditions for decision making.

Switch-Case: -
The control statement that allows us to make a decision from the
number of choices is called a switch or switch-case-default.

Difference between Select-Case and If-Else-If: -


If we have multiple cases, we will use select-case only. Though if-else
statement can also perform the same logic, it need condition for
each if and else-if part. Means if condition will start from the first
condition waits for the condition and come to next condition and
then goes on. But in select-case it need not to wait. It will directly go
to the case.

Loops: -
Loops are used to perform repetitive tasks. C provides three type of
loops: for, while and do-while.

39
Pointers, Arrays & Strings

Pointers: -
A Pointer is a variable that holds the location/Address of other
variable.

Arrays: -

An Array is a collection of items of same data types. For example:

int fruit[] = {“Apple”, “Banana”, “Cherry”, “Orange”};


int marks[] = {22, 24, 20, 22, 21, 24};

*Maximum number of elements in array declaration int


a[8][3] is = _____.

Strings: -
A string is a one-dimensional array of characters terminated by a null
(‘\0’). For example: -

char name[] = {‘H’, ‘A’, ‘R’, ‘T’, ‘R’, ‘O’, ‘N’, ‘\0’};
char name[] = “HARTRON”;

40
Functions
A function is a block of statements that perform a task. Functions
fulfill the paradigm of “Write Once Use Anywhere Anytime.” Each C
program is a collection of one or more functions.

//A Simple Function: -


void display()
{
printf(“This is a simple function.”);
}

//Passing Arguments to Functions / Function with Parameters


#include<stdio.h>
int sum(int x, int y);
void main()
{
int a, b, c;
clrscr();

printf(“Enter two nos. “);


scanf(“%d%d”,&a,&b);

c = sum(a, b);
printf(“%d”,c);
getch();
}
int sum(int x, int y)
{
return(x + y);
}

41
Structure and Storage Classes
Structure: -
C provides a special data type called Structure for dealing with
different types of variables. A Structure is a collection of mixed data
types referenced by a single name.

Storage Class: -

A storage class defines the scope (visibility) and life-time of variables


and/or functions within a C program. They precede the type that
they modify. c provides four types of storage classes: -

Auto storage class: -


This is the default storage class for all local variables.

Register storage class: -

Register storage class is used to define local variables that should be


stored in a register instead of RAM.

Static storage class: -


Static storage class instructs the compiler to keep a local variable in
existence during the life-time of the program instead of creating and
destroying it each time it comes into and goes out of scope.

Extern storage class: -


Extern storage class is used to give a reference of a global variable
that is visible to all the program files.

42
File Handling
There are different operations in C that can be carried out on a file.
these are: -

 Create a new file


 Open an existing file
 Read from a file
 Write to a file
 Seeking into a file
 Closing a file

43
Accept 50 numbers in Array

44
Output

45
Two-Dimensional array

46
Output

47
Sort Elements in Array

Output

48
49
Calculate Sum & Average in Array

50
Introduction to C++ with OOPs

 Object Oriented Paradigm


 Characteristics of OOPs
 About C++
 A C++ Program
 Constructors & Destructors

51
Object-Oriented Programming
OOPs approach is designed around the data being processed. In fact,
data is the soul of any program and OOPs defines the relationship
between the data and its associated operations in such a way that the
access to data is allowed only through its code or functions.

In object-oriented programming, these two concepts (data and


functions) are bundled into objects. This makes it possible to create
more complicated behavior with less code.

52
Characteristics of OOPs
Objects: -
An Object can be an item, place, person, entity, activity, concept or a
thing. All objects have identity and have some features such an apple
has a shape, a color, a taste.

Class: -
A class can be defined as a group of objects with similar properties
(attributes) or common operations.

Attributes: -
An attribute is a data value held by the objects in a class. Name, Color
and taste are attributes of Fruit class. All objects in a class share the
same properties.

Operations & Methods: -


An operation is a function that may be applied to or by objects in a
class. Such as close, open and hide are operations in a Window class.

53
Inheritance: -
Inheritance is the feature of sharing similarities among classes while
preserving their differences. A class that share features of other class
is called derived class and other class is called base class.

Association: -
Associations are the means for establishing relationship among
objects and classes.

Aggregation: -
Aggregation is the “part-whole” or “a-part-of” relationship in which
objects representing the components of something are associated
with an object representing the entire assembly.

Abstraction: -
Abstraction means to hide the internal details from users.

Encapsulation
Encapsulation is the way of combining data and functions into an
independent entity called class.

Overriding: -
Overriding is the concept of using features of a base class in a modified
way.

Operator Overloading and Polymorphism

Polymorphism means having multiple forms. It is the feature allow the


same operator or symbol to be bound to two or more different
implementations of the operator depending on the type of objects.

54
About C++
C++ is an Object Oriented Programming Language. It was developed
by Bjarne Stroustrup at AT&T Bell Lab in Murray Hill, New Jersey USA
in early 1980’s.

C++ is a superset of C. Most important facility that C++ adds on C are


classes, Inheritance, Function Overloading, Operator Overloading,
Virtual Functions and templates, etc.

Structure of a C++ Program

First Program

55
Difference between Multilevel and Multiple Inheritance?

In Multilevel Inheritance on derived class is derived form a class that


is derived from other base class.

Multiple Inheritance is the feature when one derived class has more
than one base class.

56
Polymorphism
Is the concept of single interface having multiple forms. It is of two
types: -

Static  Also called Compile time polymorphism.

Function Overloading
More than one function with same name.

Operator Overloading
Provides a way for new implementation of existing operator to work
with user defined data types.

Dynamic Polymorphism 

Virtual Function

Constructors and Destructors


What is a Constructor and Destructor?

A Constructor is a special member function of a class that is executed


whenever we create new objects of that class. A Constructor has the
57
same name of the class and it does not have any return type.
Constructors are useful for setting initial values for certain member
variables.

A Destructor is also a special member function of a class that is


executed whenever an object of a class goes out of scope or whenever
delete expression is applied to a Pointer to the object of that class. A
Destructor also has the same name preceding with tilde (~) symbol
and does not return any value. These are useful for releasing resources
before coming out of the program like closing files, releasing
memories.

What is a Virtual Function?

A Virtual Function is a member function that is declared within a base


class and redefined by a derived class. To create a Virtual Function,
precede the function’s declaration in the base class with keyword
Virtual. When a class containing virtual function is inherited, the
derived class redefines the virtual function to suit its own needs.

58
VISUAL BASIC
(An Integrated Development Environment)

 Introduction to Visual Basic & its Environment


 Intro to VB Controls and their Properties
 Designing User Interface
 Events and Events Driven programming
 Data types in VB
 Variables, Constants and Operators
 Type Conversion, Scope and Lifetime of Variables
 Decisions and Conditions
 Looping Statements, Arrays and Collections
 Sub-Procedures, Sub-Routines and Functions
 Working with Multiple Forms & Menu Designing
 Database
 Exercise

59
Introduction to Visual Basic: -
Visual Basic is a graphic version of old BASIC (Beginner’s & All
Purpose Symbolic Instruction Code) language that was quite popular
among programmers. VB is a GUI (Graphical User Interface) based
platform that is highly interactive. It increases the productivity of
programmer by providing various features to create effective and
robust application with minimum effort and time.

Environment: -
Visual Basic is an Integrated Development Environment (IDE). It is a
composition of various components and tools as well as provides
code editors for each component. It includes the features of auto
completion and error detecting while compilation.

what is IDE in VB? what are its components?

IDE stands for Integrated Development Environment. Visual Basic IDE


consists of user interface and environment that we use to create our
applications. It is called integrated because we can access virtually all
of the development tools that we need from one screen called
interface.

Components of VB Window: -
Menu Bar: -
It has many items along with sub menu options. Each option
performs a particular action to build VB Application. Such as Save,
Open, Run, etc.

Tool Bar: -

60
It consists of various buttons that provide quick access to commonly
used menu items.

Tool Box: -
It includes various components/controls that are used to design the
VB application.

Project Explorer
A VB project may contain multiple forms, modules and controls.
Project Explorer Window provides quick access to these elements.
We can navigate any of all in one click. VB allows to open one project
at a time but we can open form window or code window from other
existing form.

Properties (F4)
Each control in Visual Basic has its own attributes (properties). Some
are quite common while some are unique. Property window explore
these properties associated with selected control.

Code Window
Code is edited in code window only. Code window has two parts.

Object Box
the combination box at the left side of window displays the name of
all objects associated with the application.

Procedure Box
It displays the list of events associated with the form and other
control which are used to perform different actions for selected
control. Such as click event.

Form layout window


Application is previewed in Form Layout Window.

Form Designer
61
Objects are placed and then arranged on Form Designer Window.

Data Type in VB: -


what are data types? Name the data types that are supported in
VB?

Data types refer to an extensive system used for declaring variables


or functions of different types. the type of a variable determines how
much space it occupies in memory and how the bit pattern stored is
interpreted. VB support these data types:

 Boolean  Integer  String


 Byte  Long  UInteger
 Character  Object  ULong
 Date  SByte  User-defined
 Decimal  short  UShort
 Double  Single

What is the difference between Radio Button and Checkbox?

Each Checkbox operates individually, so a user can toggle each


response “ON” and “OFF”. On the other hand, a Radio Button
operates as a group and provide mutually exclusive selection values.
In a Checkbox a user can select more than one item from a group
while in Radio Button a user can select only one option from a group
of choices.

Difference between List box and Combo box?

List box control is used to display a list of items while Combo box is
used to display a drop-Down list of items from which the user can
select one item at one time.
62
Difference between Picture box and Image box?
Image control is a lightweight control that has no device context or
its own. The Picture box has a device context and is a true window.

Picture Box Image Box


It acts as container control It does not act as a container
control
Use memory to store the Does not use memory to store
picture the picture
Edit a picture is possible Editing is not possible
Has auto size property Does not have auto size
property
Does not have stretch property Has stretch property

Difference between Function and Procedure?

A Function is a series of Visual Basic Statements enclosed by Function


and End Function statements. Function performs a task and return
control to the calling code. It also returns a value to the calling code.

On the other hand, a Procedure is a module of code that is enclosed


within Sub and End Sub block. It is a subroutine. that does not return
any value.

Difference between keypress and key down?

A minor difference is that keypress event is a combination of key


down and key up events. Key down event is fired when we press
down a key that display a character (letter, number, etc.). For
example, “y”.

63
Exercise: -
 A variable is used to store the __________.
 IDE stands for _______________________________
 Str () converts ____________ data to _____________.
 Code window consists of a _________ box and procedure list
box.
 Variables of different data types when combined as single value
to hold several related information called as _________ data
types.

Which of the following is not a part of IDE: -?


 Code editor window
 Properties window
 Form layout window
 General window

Controls are _____________


 Code
 Part of menus
 Rules
 Objects

The extension of standard and class module is:


 .bas and .cls
 .cls and .bas
 .bas and .frm
 .frm and .cls

Explain the following:

SDI and MDI: -


SDI stands for single Document Interface and MDI stands for Multiple
Document Interface, are different interface designs that handles
64
documents within a single application. MDI allows an application to
contain child windows per document, While SDI enforces one
document per window.

SDI are often implemented as a single process. But MDI interface can
be implemented as multiple processes. (Google Chrome is an
example of MDI). In an SDI interface we cannot show multiple
documents at the same time in the same window. This can be
achieved in an MDI interface.

For Loop: -

For loop is used to perform repetitive tasks. It repeats a group of


statements a specified number of times. Syntax:
For var_name As datatype = start To End [Step step]
Statement
Continue For
Statements
Exit For
Statements
Next var_name

Explain the following Functions: -


UCase  Converts a String to uppercase. Syntax:
UCase(string)

StrComp  Returns the result of strings’ comparison. Syntax:


StrComp(string1, string2,[,compare])

Len  Returns the length of a string.


Len(string)

65
COMMUNICATION SKILL

 Introduction to Communication Skill


 Listening Skills
 Reading Skills
 Employment Skills

66
Introduction to Communication Skill
Passing of Information from one person to other is called
communication. It is a two-way process.

Importance: -
 Import and Export of thoughts.
 To provide Information for decision making.
 To clarify responsibility for result.

Principal of Effective Communications

Self-Satisfaction: -

Sender of the Information must be absolutely clear of his objective of


message.

Clarity: -

Language of communication should be simple, clear and commonly


understood.

Attention: -

Communication must aim at making the message understood by the


recipients.

Adequacy: -

Message should be adequate and complete for proper


comprehension by the receiver.

Integration: -
67
Communication must aim at strengthening the organization to
achieve its goal.

Feedback: -

In order to ensure that the message is understood by the receiver


correctly, it is desirable to have feedback from the receiver.

Types of Communications
According to Direction: -

Downward Level: -
When an upper level person communicates with lower level person,
it is called downward level. Such as a manager communicates with a
clerk.

Upward Level: -
Opposite to Downward Level, in this type of communication a lower
level person communicates with upper level person.

Horizontal Level: -
When both persons are of same levels in communication, it is called
Horizontal Level. Such as two teachers discuss on a topic.

According to Organizational Structure: -

Formal: -
Communication created for some objective is called formal/official
communication.

Informal: -
A time pass activity like jokes sharing. It is an in vain process that
provide no commercial benefit.
68
According to Expressions: -

Written: -
Communicate through some hard medium like Rules, Regulations,
Instructions, Magazines etc.

Oral: -
Communicate through voice only like Personally, Face-to-face,
Lecture,

Body Language: -

Body Language is a type of non-verbal communication in which


physical behavior is used to express or convey information. Such
behavior includes facial expressions, body poster, eye movements,
etc. It is not a fine language. Body Language exists in both humans
and animals.

69
Listening Skills
Listening is to give attention to one’s sound. It is the ability to
accurately receive the message conveyed by someone.

Importance of Effective Listening: -


 Expand capacity and knowledge.
 Great Listening Skills make an employee more competent and
capable.
 Reduces the risks of misunderstanding and mistakes that could
be very damaging to the business.
 Helps to solve the problem quickly and saves the time and
money.

Difference between Hearing and Listening: -

Hearing is simply the act of receiving sound by the ear. Listening,


however, is something you consciously choose to do. It requires
concentration.

Measures to improve Listening: -


 Face the speaker and make eye contact.
 Be attentive but relaxed.
 Keep an open mind.
 Listen to the words and try to picture what the speaker is
saying.
 Give a feedback to the speaker.

70
Reading Skills
Reading is a mean of communication and of sharing information and
ideas.

Importance of Reading: -
 Increase our knowledge.
 Explore yourself to new things.
 Self-Improvement.
 Tools of communicating.
 Connects you with the world.
 Boost Imaginations and Creativity.

Types/Techniques of Reading: -
Scanning: -
Scanning involves looking only for specific information.

Skimming: -
Skimming involves reading more in less time.

Intensive Reading: -
It is the most time consuming process of all the Reading Techniques.
The main goal here is to retain information for the long term.

Extensive Reading: -
Extensive Reading focuses on reading for pleasure.

71
Employment Skills
Contents of good Resume: -
 Experience
 Academic Qualification
 Professional Qualification
 Courses/Training attended
 Extra-Curricular Activities
 Remuneration
 Personal Information

Guidelines for writing Resume: -


 Resume should be written on a clean and neat paper.
 If typed, then A4 paper should be used.
 Fonts should be Times New Roman of 12” size.
 Size of Headings should be 14”.
 Qualifications, Experiences must be described in descending
order.
 Each point must introduce you perfectly.

Interview Skills: -

 Must collect all documents.


 Dress up well.
 You must remember name and the date of the publication of
vacancy.
 Also remember the date of submission of CV.
 How will you reach the destination place?
 Have a diary, pen/pencil with you.
 You must confirm about company and job.
 Ready to introduce yourself in advance.

72

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy