Lect. No. |
Date - Time - Batch - Venue |
Theme and Topics |
Slides and Programs |
1 |
Jan 4 02:00-3:30 D4 FCK Jan 5 11:35-1:00 D2 PCS |
Background and
Introduction What is programming, Machines and Knowledge about problem solving, What are programs, Some known real life examples of programming, Computing based applications of programming, How to program, Steps followed in Program Development, Importance of Discipline in Programming, Good Programs and Bad Programs, Information about the course. |
lecture1.pdf |
No
class
on
Friday
Jan
7th
due
to
TechFest,
as
announced
in
the
institute
academic
calendar.
The
loss
of
one
day
has
already
been
adjusted
in
the
institute
timetable by
adjusting #working days. |
|||
2 |
Jan 11, 12 |
Basic Elements of a Program A program that does nothing main, identifiers, keywords, procedures, procedure body, statements, operators, return statement, exit status, syntax, meaning, grammar program execution environment using existing libraries Demos |
lecture2.pdf programs |
3 |
Jan 14 11:00-12:30 and 2:00-3:30 |
Variables, Values, Types,
Assignment Variables, Values, variable declarations, initialization, Assignment statement, rvalue and lvalue, variables in expressions, assignment and reassignment, Different kinds of values needed in programming, Types, Why do we need types, Errors associated with variable declarations, type mismatch, Storage requirements of variables Sizes of some standard types |
lecture3.pdf programs |
4 |
Wed Jan 19 11:05-12:30 and Fri Jan 21 2:00-3:25 |
Expressions and Control Flow revision: Decimal vs. binary numbers, storage sizes different types of expressions, operators, assignment vs. equality check all expressions return a value semicolon, expressions vs. statements sequential control.. sequential composition of statements conditional control: if else statement |
lecture4.pdf programs |
5 |
Jan 21 Friday 11:05-12:30 Jan 25 Tue 2:00-3:25 |
Control Flow: Iteration and
Loop Design what is iteration, iteration body, termination condition, initialization, iteration step while do statement do while statement Suitability of each of the two flavors aspects of loop design- avoiding exits from within loop body, avoiding redundant code, avoiding extra assignments and checks.. comparing performance of two loops in terms of number of assignments and checks |
lecture5.pdf programs |
6 |
Jan 28 Friday 11:05-12:30 2:00-3:25 |
Iteration continued.. Arrays and the
For loop loop/iteration index, counters, flags collections of values arrays can make programs shorter- array storage, initialization, array index array values as lvalues and rvalues iterating over arrays the for loop-initialization, termination and step.. all at once place write equivalent while do and do while loops for a given for loop |
lect6.pdf programs |
7 |
Tue Feb 1 2pm Thu Feb 3 11am |
Arrays and loops flow charts of while, do while, for Array storage and indexing array index out of bound error array elements as lvalues and rvalues Flat for loop for iteration over arrays nesting of loops (one inside the other) Elimination of some nestings which aren't necessary (with examples) Nested for loops some example solution strategies |
lect7.pdf programs |
Quiz 1 Feb 2 |
|||
8 |
Fri Feb 4, 11am 2pm |
Functions naming: gives power advantages of naming code develop once and use by calling procedures and functions functions as mathematical functions functions mapping values from one or more input sets to an output set fully defined or partially defined functions function declaration, definition, calls/invocations building expressions with functions reducing function invocations to values |
lect8.pdf programs |
9 |
Tue Feb 8 2pm |
Separate compilation, and a program
development technique how the control transfers parameters passed by copy Separate development of function definition Separate compilation and linking Making Decision trees |
lect9.pdf programs |
10 |
Fri Feb 11 11am, 2pm |
More on Parameters, Arrays as
parameters Formal parameters, actual parameters call by value (pass by value) passing arrays as input parameters improving genericity of function definitions by making them handle arrays of any size.. pass the size as another input parameter |
lect10.pdf programs |
11 |
Tue Feb 15 |
Arrays as parameters, Recursion pointers for dynamic allocation of arrays pointer variables as array names passing an array into parameter-- what exactly is passed in? call by value and passing of arrays Recursion - capturing recurrence, a function calling itself, eliminate iteration, termination, counting no. of invocations |
lect11.pdf programs |
12 |
Fri Feb 18 11am, 2pm |
Recursion how is recursion executed- remembering intermediate state trace of fib and fact- invocation trees Problem solving: tower of hanoi and gcd |
lect12.pdf programs |
Midsemester Feb 26th |
|||
13 |
Tue March 1st, Wed March 2nd |
Classes sharing between functions problems with globals design of a vending machine object state functions accesses construction activity (initialization) public and private members public members accessible from outside an object private members are visible from inside the object instantiation of classes-- many instances of the same class the states of instances can be different |
lect13.pdf programs |
14 |
Fri March 4th 11am, 2pm |
Differences and similarities between
Functions, Procedures, Classes, Objects, Types, Values + Libraries Classes for File Handling objects are instances of classes, more than just data values, can accept member function invocations each objects has a separate copy of state (variables) member functions invoked on objects return results can be used in the caller objects respond to incoming messages they change their state, and the next response can be based on parameters and also the state (history) libraries for reusing classes file libraries: fstream, ofstream, ifstream member function alls on file streams reading, writing on file streams sensing end of file sensing non-existent files |
lect14.pdf programs |
15 |
Tue/Wed March 8/9 |
Revisiting values, parameter passing
and pointers constants pass by constant value pass by reference, pass by constant reference two uses of pointers, dereferencing, obtaining a reference arguments to main |
lect15.pdf programs |
16 |
Friday Mar 11, 11am, 2pm |
Typecasting, char pointers, arguments
to main, strings Converting values of one type into values of another character pointers as primitive strings pointer arithmetic on character pointers cout "<<" behaves differently for char* and int* arguments to main: program name and other arguments difference between cin and command line parameters cstdlib library: atoi, atof "ls -l", "g++ -o",.. string library: string class for strings which are objects dynamically growing/shrinking strings size vs. capacity string member functions: find, replace, insert, size, capacity, compare,.. |
lect16.pdf programs |
17 |
Tue/Wed Mar 15/16 |
2D arrays 2d arrays, dynamic arrays, ways of passing 2d arrays as parameters address arithmetic packing a 2d array into a 1d array a 2d array as pointer to a pointer |
lect17.pdf programs |
18 |
Friday March 18th, 11am, 2pm |
QA session pointers, dynamic allocation, arrays, 2d arrays |
|
19 |
Tue March 22 |
Searching and Sorting |
lect19.pdf programs |
20 |
Fri March 25 11am, 2pm |
Midsem Solutions and marking
scheme |
|
21 |
Tue Mar 29, Wed Mar 30 |
n-way branching, structures vs.
classes, linking Switch statement and n-way branching Structures: composite types, structures vs. classes Linking structures- linked list, inserting from front, append at end, delete, find Procedural style programming in C vs. Object oriented programming with classes |
lect20.pdf programs |
22 |
Fri April 1, 11am, 2pm |
random numbers, monte carlo, shell commands applications of random numbers generating random numbers, range and uniformity, psudo-randomness rand, seed: srand monte carlo method for computing Pi using random numbers shell commands, environment variable PATH, piping commands, redirecting output of a command to a file, executable permissions, find phrases in a file, copy directories |
lect21.pdf programs |
23 |
Tue April 5, Wed April 6 |
Operator Overloading defining operators on our own classes how to cascade operators discussions on projects i.e. problems of your choice |
lect22.pdf programs more programs |
24 |
Friday April 8 |
Reuse through inheritance 1. reusing some member functions 'as it is' in the new class (subclass) 2. redefining some member functions in the new class 3. extending a class by adding new member functions 4. virtual vs. actual member functions and changing roles of objects by using different types |
lect23.pdf programs |
25 |
Tue April 12 |
some fltk demos, Quiz II answers
and marking scheme, quiz II answerbooks |
fltk demos |
26 |
Fri April 15 |
Project Demos |
|
27 |
Mon April 18 |