Anda di halaman 1dari 19

COMPUTER PROGRAMMING & NUMERICAL ANALYSIS

PEN-103
Autumn Semester, 2018-19

Course Instructor
Dr. Gaurav Manik
Department of Polymer and Process Engineering

9/17/2019 Indian Institute of Technology Roorkee 1


Course Contents
Chapter Content Contact
No Hours
1 Basic Orientation: Number representation, Fixed and Floating point 4
numbers, errors and approximations
2 Object Oriented Programming – Introduction to C++, Tokens, Expressions 16
and Control structures, Functions, Classes and Objects, Constructors and
deconstructors, Operator overloading and and type conversions,
Inheritance, extending classes, Pointers, Virtual Functions and
Polymorphism, Managing console I/O operations, Working with files,
manipulating strings
3 Solutions of Linear Equations: Direct methods such as Gaussian 4
Elimination with and without pivoting, LU decomposition, Thomas
Algorithm for tri-diagonal systems and iterative methods such as Jacobi
method, Gauss-Seidel Method
5 Solution of non-linear equations– Single variable using bisection 4
method, secant method, Regula-Falsi, Muller Method and Newton-
Raphson method, Application of Newton-Raphson

9/17/2019 Indian Institute of Technology Roorkee


Course Contents
Chapter Content Contact
No Hours
5. Numerical Interpolation: Difference tables, forward, central and backward 3
difference interpolation, Interpolating Polynomials
6. Numerical Differentiation: Differentiation formulas 2
7. Numerical Integration- Trapezoidal rule, Simpson’srule, Weddle rule, 2
Gaussian Quadrature.
8. Solution of Ordinary Differential Equation: Initial value problems, (IVPs), 4
Euler’s method, Runga-Kutta method
9. Finite Difference Method 3
TOTAL 42

9/17/2019 Indian Institute of Technology Roorkee


Name of Books / Authors
S. No. Name of Books / Authors Year of
Publication
1 Balguruswamy E., Object Oriented Programming with C++, Tata 2011
McGraw Hill Education, 5th Edition

2 Lafore R., Object Oriented programming with C++, Pearson, 5th 2008
Edition.
3. Sastry S.S., Introductory methods of numerical analysis, PHI 2012
learning, 5th Edition
4. Hoffmann J D., Numerical methods for engineers and scientists, 2001
Marcel Dekker Inc., 2nd Edition

5. Chapra S.C., Applied numerical methods with MATLAB for 2012


engineers and scientists, Tata McGraw Hill Education, 3rd Edition
6 Burden, R.L. and Faires, J.D., “Numerical Analysis”, Cenage 2011
Learning, 9th Edition
7. Gupta S.K., Santosh K Gupta, New Age International Publishers, 2015
9/17/2019 IIIrd Edition Indian Institute of Technology Roorkee
Some Computer Programming Samples

1 Objective: To print and understand the size that a


character, integer, float, double occupies in the memory
of a computer
• iostream.h is a file containing definitions for input/output functions
that you use in your program Calling header
files and
• refers to include specified definitions
header file which contains
some code to activate
certain functions in program
for example iostream.h
activates cin and cout.
iostream.h is the header file
name so that compiler
knows about word cout and
cin etc.

9/17/2019 Indian Institute of Technology Roorkee 5


Computer Programming Samples

2 Objective: To make a program to swap value of two


variables

9/17/2019 Indian Institute of Technology Roorkee 6


Computer Programming Samples

3 Objective: To make a program to check whether a


number is even or odd.

9/17/2019 Indian Institute of Technology Roorkee 7


Computer Programming Samples

4 Objective: To determine whether a character is vowel or


consonent

9/17/2019 Indian Institute of Technology Roorkee 8


Computer Programming Samples

5 Objective: To determine
the largest among three
numbers

9/17/2019 Indian Institute of Technology Roorkee 9


Computer Programming Samples

6 Objective: To find the


roots of quadratic
equation

9/17/2019 Indian Institute of Technology Roorkee 10


Computer Programming Samples

7 Objective: To find the sum of natural numbers

9/17/2019 Indian Institute of Technology Roorkee 11


Computer Programming Samples

8 Objective: To check if the year is a leap year or not

9/17/2019 Indian Institute of Technology Roorkee 12


Computer Programming Samples

9 Objective: To find factorial of a number

9/17/2019 Indian Institute of Technology Roorkee 13


Computer Programming Samples

10 Objective: To generate a multiplication table

9/17/2019 Indian Institute of Technology Roorkee 14


Computer Programming Samples

11 Objective: To generate Fibonacci numbers

9/17/2019 Indian Institute of Technology Roorkee 15


Computer Programming Samples

12 Objective: To find HCF of two numbers

9/17/2019 Indian Institute of Technology Roorkee 16


Computer Programming Samples

13 Objective: To find LCM of two numbers

9/17/2019 Indian Institute of Technology Roorkee 17


Computer Programming Samples

14 Objective: To reverse a number

9/17/2019 Indian Institute of Technology Roorkee 18


Computer Programming Samples

15 Objective: To find power of a number

9/17/2019 Indian Institute of Technology Roorkee 19

Anda mungkin juga menyukai