ARRAYS
IPTG
ARRAYS
ARRAY
IS A COLLECTION OF VARIABLES
OF THE SAME TYPE.
ARRAY IS REFERRED TO THROUGH A
COMMON NAME.
ARRAY OCCUPIES CONTIGUOUS MEMORY
LOCATIONS.
2
SINGLE DIMENSION ARRAYS
GENERAL
FORM : type var_name[size];
e.g. int a[3];
A SPECIFIC E
Tutorial Sheet on Vacuum Science & Technology
Describe the various types of gas flow in a vacuum system in terms of
mean free path and viscosity. Explain the physical significance of the curve
pressure versus dimension of the system (inches) related to fl
Math October 14, 2008
Tutorial 3: Matrices Part-II
Consistency and Inconsistency
The system of equations is said to be consistent if it has atleast one solution and incosistent
if it has no solution.
The nature of solutions of the system AX = B with respe
Math October 21, 2008
Tutorial 4: Matrices Part-III
Caley - Hamilton Theorem:
Every square matrix satises its own characteristic equation. i.e. The theorem states that,
for a square matrix A of order n; if
jA
I j = ( 1)n n + a1 n 1 + a2 n 2 +
+an = 0 be t
Pandit Deendayal Petroleum University
School of Petroleum Technology
Tutorial Sheet- I
Mathematics II
1. Find a series of sines and cosines of multiples of , which will represent in the interval .
Find also the sum of series for
2. Find a series of sines
Pandit Deendayal Petroleum University
School of Petroleum Technology
Tutorial Sheet- II
Mathematics II
1. If find
(i)
, when t=0,
(ii)
when t=1.
(iii) , when
and (iv) when .
2. If , find where
3. A particles moves along the curve , , where t is the time.
Pandit Deendayal Petroleum University
School of Petroleum Technology
Tutorial Sheet- IV for semester II
Mathematics II
1. Solve the following equations:
(i)
(ii)
(iii)
(iv)
(v)
(vi)
(vii)
(viii)
2. Determine the general solution of the following equations
Tutorial Sheet Thermodynamics
1. Write down notes on zeroth and first law of thermodynamics.
2. Distinguish between isothermal and adiabatic expansion.
3. Deduce the relation between pressure and volume of a gas undergoing adiabatic change.
4. Deduce the
CLASSES & OBJECTS
IPTG
1
REVISITING STRUCTURES
2
struct book
cfw_
char TITLE [20];
char AUTHOR [20];
int EDITION;
char ISBN[14];
char PUBLISHER[20];
float PRICE;
;
struct book b1, b2, b3;
b1, b2 or b3 are
objects.
TITLE, AUTHOR ,
PRICE are elements of
th
COMPILING A PROGRAM
IPTG
WRITING & SAVING
A PROGRAM
USE
NOTEPAD OR WORDPAD TO WRITE A
PROGRAM.
SAVE THE PROGRAM IN THE DIRECTORY
CALLED C:\BORLAND\CPP DIRECTORY.
WHEN YOU SAVE THE PROGRAM, WRITE
FILE NAME IN FOLLOWING MANNER.
SUPPOSE ROLL NO. 07001, W
CONSTRUCTORS
&
DESTRUCTORS
IPTG
INTRODUCTION
WE
2
WRITE
int i = 0; / valid statement
but
WE CAN NOT INITIALIZE VARIABLES
DIRECTLY WHEN WE DEFINE ANY CLASS.
why?
THE MEMORY ALLOCATION WOULD BE
DONE ONLY WHEN WE CREATE OBJECTS
FROM THIS CLASS.
INTRODUCT
EXCEPTIONS
IPTG
INTRODUCTION
WHEN
2
WE WRITE ANY PROGRAM, THERE
MAY BE ERRORS OR BUGS IN IT.
TWO TYPES OF BUGS/ ERRORS:
SYNTAX ERRORS.
LOGICAL ERRORS.
SYNTAX ERRORS: DUE TO POOR
UNDERSTANDING OF THE PROGRAMMING
LANGUAGE.
LOGICAL ERRORS: DUE TO POOR
FLOATING POINT
REPRESENTATION
NUMBERS HAVING AN INTEGER
PART AND A FRACTIONAL PART, IS
CALLED A REAL NUMBER OR
FLOATING-POINT NUMBER.
IT CAN BE EITHER +VE OR VE.
EVERY NO. CAN BE REPRESENTED
IN SCIENTIFIC FORM i.e. n = m re
n=no, m=mantissa, r=radix, e=ex
FUNCTION OVERLOADING
IPTG
FUNCTION OVERLOADING
KNOWN
AS FUNCTION POLYMORPHISM
ALSO.
OVERLOADING MEANS USING SAME THING
FOR DIFFERENT PURPOSES.
FEATURE OF C+ AND NOT C.
USING THE CONCEPT, WE CAN DESIGN A
FAMILY OF FUNCTIONS WITH ONE
FUNCTION NAME BUT
INHERITANCE
IPTG
INHERITANCE
INHERITANCE
IS THE PROCESS BY WHICH
OBJECTS OF ONE CLASS ACQUIRE THE
PROPERTIES OF OBJECTS OF ANOTHER
CLASS.
IT SUPPORTS THE CONCE PT OF
HIERARCHICAL CLASSIFICATION.
E.G. THE BIRD SPARROW IS A PART OF
THE CLASS FLYING BIRD
Write following programs using
SWITCH -CASE-DEFAULT.
1. Display the following menu and work
accordingly.
MAIN MENU
1. ADD TWO NUMBERS
2. SUBTRACT TWO NUMBERS
3. MULTIPLY TWO NUMBERS
4. DIVIDE TWO NUMBERS
ENTER YOUR CHOICE.[1.4]
display proper message in c
Exercise 1.
A heat engine working between 150C
and 50C.
What is the minimum heat withdrawal
from the heat source to yield 1.3 kJ of
work?.
Exercise 2.
A Carnot engine working between 100C
and 300C absorbs 750 J heat from the
high-temperature source.
Calcu
Tryst with Destiny
14-15 August, 1947
-Jawaharlal Nehru
With the clock striking the midnight hour on 14-15th August, 1947, India was 'to
awake to freedom'. The Constituent Assembly to whom power was to be transferred
began its sitting at 11 pm with Smt Su
SWITCH
IPTG
SWITCH
WE
KNOW THAT WE CAN WRITE
EXPRESSION WITHIN SWITCH.
WE ALSO KNOW THAT THE RESULT OF
EXPRESSION SHOULD BE EITHER INTEGER
OR CHAR.
WRITE
A PROGRAM TO FIND LARGEST OUT
OF TWO NUMBERS USING SWITCH ONLY
(WITHOUT IF STATEMENTS).
FINDING LA
STRUCTURES
IPTG
WHAT IS A STRUCTURE?
A
STRUCTURE GATHERS TOGETHER,
DIFFERENT ATOMS OF INFORMATION
THAT COMPRISE A GIVEN ENTITY.
WHY USE STRUCTURES?
WE
WANT TO STORE INFORMATION
ABOUT ANY OBJECT OR ENTITY.
GENERALLY OBJECT CONSISTS OF
ATTRIBUTES & BEHAVI
C/C+
Institute of Petroleum
Technologies, Gandhinagar
PLEASE
SWITCH OFF
YOUR
MOBILE.
BOOKS
C+ Program Design
by Cohoon & Davidson
Tata McGraw Hill
3rd Edition
A first Book of C+
by Gary Bronson, Brookes/Cole
Thomson Learning
3rd Edition
BOOKS
Ind
The fundamental equations
Five state functions in the First and Second Laws:
The internal energy: U
The entropy: S
The enthalpy: H
The Helmholtz energy: A
The Gibbs energy: G
H=U+pV
A=U-TS
G= H-TS = U+pV-TS =A+pV
H
pV
U
A
pV
G
TS
TS
The fundamental equati
THERMODYNAMICS OF PURE
AND REAL SUBSTANCES
CHEMICAL POTENTIAL OF PURE SUBSTANCE
Partial molar quantities
V, U, H, S, and G (general X) are extensive properties. X
depends on not only T and p, but also n.
For a single phase system of a pure substance, Xm i
Math September 30, 2008
Tutorial 1: Matrices Part-I
1. Find the inverse of a given matrix using Gauss-Jordan method and verify the answer
by any other method.
2
3
12
1
12
(a)
; (b) 4 2 4 4 5
37
37 4
2. Find the rank of a given matrix by (1) Method of mino
Math October 07, 2008
Tutorial 2: Matrices Part-II
Row-reduced Echelon Form: It is a matrix such that
1. Each row that consists entirely of zeros is below each row which contains a non-zero
entry.
2. The rst non-zero entry in each row is a 1.
3. The rst n
NUMBER SYSTEMS
BY
DARSHIT SHAH
INATITUTE OF PETROLEUM
TECHNOLOGY, GANDHINAGAR
DIFFERENT NUMBER SYSTEMS
DECIMAL
BINARY
OCTAL
HEXADECIMAL
ASCII
UNICODE
DIFFERENT NUMBER SYSTEMS
BCD
EBCDIC
DECIMAL NUMBER SYSTEM
RADIX OR BASE
DIGITS
10
09
(153.25)10 = (1
OBJECT ORIENTED SYSTEMS
DEVELOPMENT
IPTG
INTRODUCTION
SOFTWARE
ENGINEERS USE DIFFERENT
TOOLS, METHODS AND PROCEDURES TO
CONTROL THE PROCESS OF SOFTWARE
DEVELOPMENT.
THE PURPOSE:BUILD HIGH-QUALITY
SOFTWARE WITH IMPROVED
PRODUCTIVITY.
INTRODUCTION
SUCCES
OPERATOR OVERLOADING
IPTG
INTRODUCTION
WE
USE DIFFERENT OPERATORS LIKE +, -, *
ON BASIC DATA TYPES LIKE INT, FLOAT OR
DOUBLE.
CAN
WE USE THEM FOR USER DEFINED
DATA TYPES LIKE ARRAY,STRUCTURE OR
CLASS?
2
INTRODUCTION
EXAMPLE
char name1[30] = Pandit Dind
PARTIALDIFFERENTIAL
EQUATIONS:
v PartialDifferentialEquations(PDE)arethose
equationswhichcontainpartialdifferential
coefficients,independentvariablesanddependent
variables.
v Theindependentvariableswillbedenotedbyx
andyandthedependentvariablebyz.
v Thepar
CHARPITS METHOD: Self
study topic
HIGHER ORDER PDE
LINEAR PDE WITH CONSTANT
COEFFICIENTS:
A
PDE in which the dependent variable and its
derivatives appear only in the first degree and are not
multiplied together, their coefficients being constants or
func