Professional Documents
Culture Documents
TEXT BOOKS
B. Trivedi, Programming with ANSI C++, Oxford University Press, 2010. Ira Pohl, Object Oriented Programming using C++, Pearson Education, Second Edition Reprint 2004.
REFERENCES
P.J.Deitel, H.M.Deitel, C++ How to Program, 7th edition, PHI, 2010 Balaguruswamy. E, Object Oriented Programming with C++, Fourth Edition, TMH, 2008. S. B. Lippman, Josee Lajoie, Barbara E. Moo, C++ Primer, Fourth Edition, Pearson Education, 2005. B. Stroustrup, The C++ Programming language, Third edition, Pearson Education, 2004.
Unstructured Programming
Usually, people start learning programming by writing small and simple programs consisting only of one main program. Here ``main program'' stands for a sequence of commands or statements which modify data which is global throughout the whole program.
Drawbacks
This programming technique can only be used in a very small program. For example, if the same statement sequence is needed at different locations within the program, the sequence must be copied. If an error needed to be modified, every copy needs to be modified. This has lead to the idea to extract these sequences (procedure), name them and offering a technique to call and return from these procedures.
Procedural Programming
With procedural programming, you are able to combine sequences of calling statements into one single place. A procedure call is used to invoke the procedure. After the sequence is processed, flow of control proceeds right after the position where the call was made .
Procedures
With parameters and sub-procedures (procedures of procedures) , programs can now be written more structured and error free. For example, if a procedure is correct, every time it is used, it produces correct results. Consequently, in cases of errors you can narrow your search to those places which are not proven to be correct.
Limitations of C Problem 1
Does not work when the program goes larger Losing the global view (abstract view) What is Abstraction? Save button in MS word Controls used VB or VC++ Real world examples Applying Brake in car Acceleration used in car
Limitations of C Problem 2
Idea of reuse is? missing Need many blocks in building a large program Large payroll program Management of employee system payroll HR management system personal info Both are not same however need to be consistent
Contd
C++ is extended from C, it is superset of C Is C++ not fully object oriented language? Is Smalltalk purely object oriented language? Most object oriented programming languages slower the execution of the program Advantage of C is its efficiency
Contd
What is encapsulation? Process of defining a class with some attributes hidden and some exposed is called encapsulation. Insulates object from the outside and provide access by only through the public interfaces