22 Pages

unit-i

Course: CS 101, Spring 2012
School: Punjab Engineering...
Rating:
 
 
 
 
 

Word Count: 1417

Document Preview

Oriented Object Programming (OOP) ( UnitI ) ObjectOriented thinking OOP Paradigm : Objectoriented programming is frequently referred to as a new programming paradigm. The word "paradigm" means an example, or a model. A model helps you understand how the world works. For example, the Newtonian model of physics explains why apples fall to the ground. In computer science , a paradigm...

Register Now

Unformatted Document Excerpt

Coursehero >> India >> Punjab Engineering College >> CS 101

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Oriented Object Programming (OOP) ( UnitI ) ObjectOriented thinking OOP Paradigm : Objectoriented programming is frequently referred to as a new programming paradigm. The word "paradigm" means an example, or a model. A model helps you understand how the world works. For example, the Newtonian model of physics explains why apples fall to the ground. In computer science , a paradigm explains how the elements that go into making a computer program are organized and how they interact with one another. A Way of Viewing the World " I want to send some flowers to my friend sally who lives in a city many miles away. Because of the distance, I cannot pick up the flowers and carry them to sally's door in person. I go down to Flora, my local florist, tell her the type and quantity of flowers I want together with the address need to be delivered. I can be assured that the flowers will be delivered automatically. " Contd.. Gardeners Sally Grower Me Delivery person Flora Sally's Florist Flower Arranger Wholesaler The community agents helping me Agents and communities The General Principle I find an appropriate agent (Flora) and pass to her a message containing a request. It is the responsibility of Flora to satisfy my request. There is some method a set of operations or algorithm used by Flora to do this. I do not need to know the particular method that Flora will use, this information is hidden from me. An object oriented program is structured as a community of interacting agents called objects. Each object has a role to play. Each object provides a service or performs an action that is used by other members of the community. Messages and Methods Action is initiated in object oriented programming by the transmission of a message to an agent (an object). The message encodes the request for action and is accompanied by additional information (arguments) needed to carry out the request. The receiver is the agent to which the message is sent. If the receiver accepts the message it accepts the responsibility to carry out the indicated action. In response to a message the receiver will perform some method to satisfy the request. In what sense is a message different from a procedure call? In both cases there is a set of welldefined steps that will be initiated following the request. But, there are two important distinctions. The first is that a message has a designated receiver. In a procedure call, there is no designated receiver. The second is that the interpretation of the message ( that is, the method used to respond to the message ) is dependent on the receiver and can vary with different receivers. Contd.. The specific receiver for any given message will not be known until run time. There is a late biding between the message and code fragment( method ) used to respond to the message. In a function or procedure call, binding name to code fragment will be done at compile time only. There is an early binding. Responsibilities Another fundamental concept in objectorienting programming is to describe behavior in terms of responsibilities. By discussing problem in terms of responsibilities, we increases the level of abstraction. This permits greater independence between objects. The entire collection of responsibilities associated with an object is called as a protocol. Classes and Instances Although I do not know Flora very I have a rough idea of the transactions that occur inside Flora's shop. I am able to make certain assumptions based on previous experiences with florists. I expect that Flora, being an instance of the category florist, will match the pattern. All objects are instances of a class. The method invoked by an object to respond to a message is determined by the class of the receiver. All objects of the same class use the same method in response to the same message. Class HierarchiesInheritance The principle that knowledge of more general category is also applicable to a more specific category is called inheritance. Classes can be organized into a hierarchical inheritance structure. A child class (or subclass) will inherit attributes from a parent class higher in the tree. An abstract class is a class for which there are no direct instances; it is used only to create subclass. Fig: Categories surrounding Flora Contd.. Material Object Flora is a florist, but Florist is a specialized form of the category Shopkeeper. Animal Mammal Human Shopkeeper Florist Flora Material Platypus Objects Animal Plant Mammal Flower Carnation Dog Human Shopkeeper Artist Dentist Florist Potter Flash Flora Elizabeth Kenneth Phyl Sally's flowers Fig: A class hierarchy for various material objects Method Binding, Overriding and Exceptions platypus is a mammal. Mammals give life birth to live child but platypus does not, she lays eggs. This is an exception to the general rule. Information contained in a subclass can override information inherited from a parent class. When methods with the same name are available higher in the class hierarchy the method that executes is said to override the inherited behavior The search for a method to invoke in response to a given message starts with the class of the receiver. If no appropriate method is found, the search continues up the parent class chain until either a method is found or the until the parent class chain is exhausted. Summary of oop concepts Everything is an object. Computation is performed by objects communicating with each other. Objects communicate by sending and receiving messages. A message is a request for action bundled with whatever arguments may be necessary to complete the task. Each object has its own memory. Every object is an instance of a class. A class represents a group of similar objects. The class is the repository for behavior associated with an object. That is, all objects that are instances of the same class can perform the same actions. Classes are organized into a single rooted tree structure, called the inheritance hierarchy. Memory and behavior associated with instances of class are automatically available to any class associated with a descendant in that tree structure. coping with complexity Complexity of programming projects is nonlinear Interconnectedness, the dependence of one Two programmers cannot do in one month what one programmer can do in 2 months Adding more men/women to a project often lengthens, not shortens, the schedule. portion of code on another portion, is responsible for this phenomena. Abstraction mechanisms try to cope with this and object oriented techniques offer yet another step forward. Abstraction Abstraction mechanisms are techniques to deal with creating, understanding and managing complex systems Abstraction is the purposeful suppression or hiding of some details of a process in order to bring out more clearly other aspects, details or structures. Through abstraction one builds a model of the actual system. Abstraction layers in ObjectOriented Software Design At the highest level a program is viewed as a community of cooperating objects. At this highest level the important features to stress are the services provided by each object and the lines of communication between them. The next level of abstraction allows a group of objects working together to be grouped in a unit . Ex:packages Contd.. The next two levels of abstraction deal with the interaction between 2 individual objects where one (the client) uses services from the other (the server) The server advertises the services it can provide for the client as an interface, the client uses these services. The server provides a concrete implementation for its interface. The last level of abstraction considers a single task in isolation I.e. which steps implement a single method. Abstraction mechanisms in programming languages. Procedures and Functions (function centered view) Modules and Packages (data centered view) no information hiding for the detail of the data. no encapsulation. + information hiding + encapsulation Abstract Data Types + separates interface and implementation Contd.. Classes are as Abstract Data Types in a servicecentered view. Message Passing and Method Binding bring polymorphism leading to more readable code. Class Hierarchies and Inheritance results in increased functionality and reduction of code size. Programming in the Small versus Programming in the Large Code developed by single programmer or very small set of programmers. Every individual understands all aspects of the project. Major effort is the design and development of algorithms dealing with the problem at hand. Software system developed by a large team. No single individual is responsible for the entire project or understands all aspects of it Major effort is the management of details and the communication of information between different portions of the project.
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Punjab Engineering College - CS - 101
Unit-V1Exception HandlingOverviewBackground Errors Exceptions2Program ErrorsSyntax (compiler) errors Errors in code construction (Syntax errors) Detected during compilation Operations illegal ( ex:- 2 / 0 ) Detected during program execution Tre
Punjab Engineering College - CS - 101
Unit-V1Exception HandlingOverviewBackground Errors Exceptions2Program ErrorsSyntax (compiler) errors Errors in code construction (Syntax errors) Detected during compilation Operations illegal ( ex:- 2 / 0 ) Detected during program execution Tre
Punjab Engineering College - CS - 101
Unit-viIntroduction Graphical user interface (GUI) Presents a user-friendly mechanism for interacting with an application. Built from GUI components. Command Line interface In a command Line interface the commands are entered from the keyboard. It is no
Punjab Engineering College - CS - 101
Unit-viiWhat is an applet? applet: a small Java program that can be insertedinto a web page and run by loading that page in a browser. brings web pages to life with interactive GUI, multimedia, games, and more the feature of Java that is primarily resp
Punjab Engineering College - CS - 101
Computer OrganizationIt describes the function and design of the various units of digital computers that store and process information. It also deals with the units of computer that receive information from external sources and send computed results to e
Punjab Engineering College - CS - 101
UnitII Register transfer language and Micro operationsMicrooperations: The operations executed on data stored in registers are called microoperations. Register transfer language: The symbolic notation used to describe the microoperation transfers among r
Punjab Engineering College - CS - 101
Unit-III Micro-programmed control Hardwired control versus Micro-programmed control There are two types of control organization: hardwired control and micro-programmed control. Hardwired control In the hardwired organization, the control logic is implem
Punjab Engineering College - CS - 101
Unit-IV Computer Arithmetic Addition and subtraction Multiplication algorithms Division algorithms Floating point arithmetic operations Decimal arithmetic unit Decimal arithmetic operationsAddition and subtraction with signed-magnitude dataAddition al
Punjab Engineering College - CS - 101
Unit-IV Computer Arithmetic Addition and subtraction Multiplication algorithms Division algorithms Floating point arithmetic operations Decimal arithmetic unit Decimal arithmetic operationsAddition and subtraction with signed-magnitude dataAddition al
Punjab Engineering College - CS - 101
Chapter 1: Introductions Purpose of Database Systems s View of Data s Data Models s Data Definition Language s Data Manipulation Language s Transaction Management s Storage Management s Database Administrator s Database Users s Overall System StructureD
Punjab Engineering College - CS - 101
Chapter 15: TransactionsDatabase System Concepts, 5th Ed.Silberschatz, Korth and Sudarshan See www.db-book.com for conditions on re-useChapter 15: Transactionss Transaction Concept s Transaction State s Implementation of Atomicity and Durability s Con
Punjab Engineering College - CS - 101
Chapter Syntax - the form or structure of the expressions, 3 statements, and program unitsSemantics - the meaning of the expressions, statements, and program unitsWho must use language definitions?1. Other language designers 2. Implementors 3. Programm
Punjab Engineering College - CS - 101
NamesChapter 4- Design issues: - Maximum length? - Are connector characters allowed? - Are names case sensitive? - Are special words reserved words or keywords?Length- FORTRAN I: maximum 6 - COBOL: maximum 30 - FORTRAN 90 and ANSI C: maximum 31 - Ada:
Punjab Engineering College - CS - 101
Chapter 5 Evolution of Data Types:FORTRAN I (1956) - INTEGER, REAL, arrays . Ada (1983) - User can create a unique type for every category of variables in the problem space and have the system enforce the types Def: A descriptor is the collection of the
Punjab Engineering College - CS - 101
Chapter Arithmetic Expressions 6- Their evaluation was one of the motivations for the development of the first programming languages - Arithmetic expressions consist of operators, operands, parentheses, and function callsDesign issues for arithmetic exp
Punjab Engineering College - CS - 101
Chapter 7 Levels of Control Flow:1. Within expressions 2. Among program units 3. Among program statements Evolution: - FORTRAN I control statements were based directly on IBM 704 hardware - Much research and argument in the1960s about the issue - One imp
Punjab Engineering College - CS - 101
chaI am beginner to the programming languages can I star with `C'? Well. this is a question that is in the minds of so many people and they are misguided by some people about this doubt in their minds. C language is intended for the people with or without
Punjab Engineering College - CS - 101
Chapter 5Names, Bindings, Type Checking, and ScopesISBN 0-321-33025-0Chapter 5 Topics Introduction Names Variables The Concept of Binding Type Checking Strong Typing Type Compatibility Scope and Lifetime Referencing Environments Named Constants Copyri
Punjab Engineering College - CS - 101
Chapter 6Data TypesISBN 0-321-33025-0Chapter 6 Topics Introduction Primitive Data Types Character String Types UserDefined Ordinal Types Array Types Associative Arrays Record Types Union Types Pointer and Reference Types1-2Copyright 2006 AddisonWesl
Punjab Engineering College - CS - 101
Chapter 7Expressions and Assignment StatementsISBN 0-321-33025-0Chapter 7 Topics Introduction Arithmetic Expressions Overloaded Operators Type Conversions Relational and Boolean Expressions ShortCircuit Evaluation Assignment Statements MixedMode Assig
Punjab Engineering College - CS - 101
Chapter 8StatementLevel Control StructuresISBN 0-321-33025-0Chapter 8 Topics Introduction Selection Statements Iterative Statements Unconditional Branching Guarded Commands ConclusionsCopyright 2006 AddisonWesley. All rights reserved.1-2Levels of C
Punjab Engineering College - CS - 101
Chapter 9SubprogramsISBN 0-321-33025-0Chapter 9 Topics Introduction Fundamentals of Subprograms Design Issues for Subprograms Local Referencing Environments ParameterPassing Methods Parameters That Are Subprogram Names Overloaded Subprograms Generic S
Punjab Engineering College - CS - 101
Chapter 11Abstract Data Types and Encapsulation ConceptsISBN 0-321-33025-0Chapter 11 Topics The Concept of Abstraction Introduction to Data Abstraction Design Issues for Abstract Data Types Language Examples Parameterized Abstract Data Types Encapsula
Punjab Engineering College - CS - 101
Unit 1 Preliminary Concepts1Topics Reasons for studying PPL Programming Domains Language Evaluation criteria Influences on Language design Language categories/Programming paradigms Language Implementation Methods Programming environments2Reasons for s
Punjab Engineering College - CS - 101
Unit 2 Syntax and Semantics1Topics General problem of describing syntax Formal methods of describing syntax / Language generation mechanisms Attribute grammars Describing meanings of programs / Dynamic Semantics2Syntax: Syntax of a programming languag
Punjab Engineering College - CS - 101
Chapter 6Data TypesISBN 0-321-33025-0Chapter 6 Topics Introduction Primitive Data Types Character String Types UserDefined Ordinal Types Array Types Associative Arrays Record Types Union Types Pointer and Reference Types1-2Copyright 2006 AddisonWesl
Punjab Engineering College - CS - 101
PROCESS MODELSOverviewPrescriptive process models prescribe a distinct set of activities, actions, tasks, milestones, and work products required to engineer high quality software. Prescriptive software process models are adapted to meet the needs of sof
Punjab Engineering College - CS - 101
Software RequirementsObjectivesTo introduce the concepts of user and system requirements To describe functional and non-functional requirements To explain how software requirements may be organised in a requirements documentWhat is a requirement?It ma
Punjab Engineering College - CS - 101
SOFTWARE ENGINEERINGCHAPTER-1INTRODUCTION TO SOFTWARE ENGINEERINGWHATIS SOFTWARE ? Computer programs and associated documentationSoftware products may be developed for a particular customer or may be developed for a general market Software products m
Punjab Engineering College - CS - 101
CHAPTER-2A GENERIC VIEW OF PROCESSChapter Overview What? A software process a series of predictable steps that leads to a timely, high-quality product. Who? Managers, software engineers, and customers. Why? Provides stability, control, and organization
Punjab Engineering College - CS - 101
Punjab Engineering College - CS - 101
System Model System modelling helps the analyst to understand the functionality of the system and models are used to communicate with customers. Different models present the system from different perspectives External perspective showing the system's con
Punjab Engineering College - CS - 101
UNIT-3Requirements Engineering ProcessesObjectives To describe the principal requirements engineering activities and their relationships To introduce techniques for requirements elicitation and analysis To describe requirements validation and the role
Punjab Engineering College - CS - 101
UNIT-3Requirements Engineering ProcessesRequirements engineering processes The processes used for RE vary widely depending on the application domain, the people involved and the organisation developing the requirements. However, there are a number of g
Punjab Engineering College - CS - 101
Generic Design Task Set 1. 2. 3. 4. Select an architectural pattern appropriate to the software based on the analysis model Partition the analysis model into design subsystems, design interfaces, and allocate analysis functions (classes) to each subsystem
Punjab Engineering College - CS - 101
UNIT-4CHAPTER-9DESIGN ENGINEERING9.4 The Design Model Process dimension - indicates design model evolution as design tasks are executed during software process Architecture elements Interface elements Component-level elements Deployment-level element
Punjab Engineering College - CS - 101
Chapter10Creating An Architectural Design10.1 Software ArchitectureWhat is Architecture ? The architecture is not the operational software. Rather, it is a representation that enables a software engineer to: (1) analyze the effectiveness of the design
Punjab Engineering College - CS - 101
Chapter 12ThreeDimensional Viewing ViewingAnalogous to the photographing process Camera position Camera orientationViewing Pipeline3d transformation pipelineGeneral processing steps for modeling and converting a world coordinate description of
Punjab Engineering College - CS - 101
Chapter 10Three-Dimensional Object RepresentationIntroduction Graphics scenes can contain many different kinds of objects No one method can describe all these objects Accurate models produce realistic displays of scenes Polygon and quadric surfaces Sp
Punjab Engineering College - CS - 101
Computer GraphicsComputer AnimationComputer animationComputer animation generally refers to any time sequence of visual changes in a scene. In addition to changing object position with translations or rotations, a computer generated animation could dis
Punjab Engineering College - CS - 101
8086-Architecture Functional and Internal block schematic of 8086 Features of 8086 Register organization of 8086 Memory organization of 808680861Architecture of an typical microprocessor based systemInterfaceSMemory moduleTimingMemoryMemory Modu
Punjab Engineering College - CS - 101
8086-Architecture Functional and Internal block schematic of 8086 Features of 8086 Register organization of 8086 Memory organization of 808680861Architecture of an typical microprocessor based systemInterfaceSMemory moduleTimingMemoryMemory Modu
Punjab Engineering College - CS - 101
TransmitterOutput Register TxD TxC Transmitter Buffer RegisterTransmitter control logicTxrdy TxEReceiverInput Register RxD RxC Receiver Buffer RegisterReceiver control logicRxrdyProgramming 8251 8251 mode register76543210Mode registerNu
Punjab Engineering College - CS - 101
UNIT-5 I / O structure of a typical microcomputer 8255 PPI (Programmable peripheral interface) Pin diagram of 8255 Block Diagram of 8255 Architectural and programming details of 8255 Traffic light controller interfacing to 8086 through 8255 Stepper motor
Punjab Engineering College - CS - 101
FIGURE 9-4Block diagram and pin definitions for the 8259A Programmable Interrupt Controller (PIC). (Courtesy of Intel Corporation.)John Uffenbeck The 80x86 Family: Design, Programming, and Interfacing, 3eCopyright 2002 by Pearson Education, Inc. Upper
Punjab Engineering College - CS - 101
Serial Data Transfer Asynchronous v.s. Synchronous- Asynchronous transfer does not require clock signal. However, it transfers extra bits(start bits and stop bits) during data communication - Synchronous transfer does not transfer extra bits. However,
Punjab Engineering College - CS - 101
Topics 2102440 Introduction to Microprocessors Chapter 12 Serial CommunicationsSuree Pumrin, Ph.D.12102440 Introduction to MicroprocessorsSync vs Asynchronous RS-232C 8251 USART 8251 Initialization2Serial vs. Parallel Data TransferSerial Transfer S
Punjab Engineering College - CS - 101
Interrupt Interrupt :- Triggers that cause the CPU to perform various tasks on demand Three kinds: Software interrupts - provide a mechanism whereby the programmer can use the INT instruction to access code that already exists (is resident) in machine me
Punjab Engineering College - CS - 101
Comparison of 8051 familyFeature Make On chip ROM type Rom size RAM size Timers I/O Pins Serial Port Interrupt Sources 8031 Intel 8051 Intel RO M 4K 128 2 32 1 6 8052 Intel PROM 8751 Intel UVEPROM 4K 128 2 32 1 6 89C51 Atmel Flash *DS5000 Dallas NVRAM 8K
Punjab Engineering College - CS - 101
Contents:Introduction Block Diagram and Pin Description of the 8051 Registers Memory mapping in 8051 Stack in the 8051 I/O Port Programming Timer InterruptWhy do we need to learn Microprocessors/controllers? The microprocessor is the core of computer s
Punjab Engineering College - CS - 101
Contents:Introduction Block Diagram and Pin Description of the 8051 Registers Memory mapping in 8051 Stack in the 8051 I/O Port Programming Timer InterruptWhy do we need to learn Microprocessors/controllers? The microprocessor is the core of computer s
Punjab Engineering College - CS - 101
Pin Configuration Of 8086VCCAD0 AD15GNDAD16AD19/ CLK MN BHE / S7 INTR NMIS3 S6 / _MX _ _ HOLD RQ / GT0 _ _ RQ / GT1 _ LOCK _ S2_ TEST READY RESET _ RDINTEL 8086HLDA _ WR M /_ IO DT/_ R _ DEN ALE _ INTA_S1 _ S0 QS0 QS1GND1Pin DefinitionsPin(
Punjab Engineering College - CS - 101
Pin Configuration Of 8086VCCAD0 AD15GNDAD16AD19/ CLK MN BHE / S7 INTR NMIS3 S6 / _MX _ _ HOLD RQ / GT0 _ _ RQ / GT1 _ LOCK _ S2_ TEST READY RESET _ RDINTEL 8086HLDA _ WR M /_ IO DT/_ R _ DEN ALE _ INTA_S1 _ S0 QS0 QS1GND1Pin DefinitionsPin(
Punjab Engineering College - CS - 101
A stepper motor is a brushless, synchronous electric motor that can divide a full rotation into a large number of steps, for example, 200 steps. When commutated electronically, the motor's position can be controlled precisely, without any feedback mechani
Punjab Engineering College - CS - 101
Code SEGMENT ASSUME CS: Code START : Mov AX , 0000 H Mov AL , 80 H Mov DX , 0FFE6 H Out DX , AL Mov CX , 100 Mov AL , 77 H GO: Mov DX , 0FFE0 H Out DX , AL Call Delay Ror AL , 01 H Loop GO Int 3 H Delay PROC NEAR Nop Mov BX , 0FFF H GO1 : Dec BX Jnz GO1 R
Punjab Engineering College - CS - 101
DOMAIN TESTINGPrograms input data are classified. Domain testing attempts to determine whether the classification is or is not correct. If domain testing is based on specification it is a functional test technique; if based on implementation it is a stru
Punjab Engineering College - CS - 101
Code No: R05310504Set No. 1III B.Tech I Semester Regular Examinations, November 2008 COMPUTER NETWORKS ( Common to Computer Science & Engineering and Information Technology) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal
Punjab Engineering College - CS - 101
SET-1 Code No: 37031 JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD R05 IV B.Tech. I Semester Supplementary Exams, May/June 2009 COMPUTER NETWOKS (Common to ECE, EIE, BME, MCT, ETM) Time: 3 hours Answer any Five questions All questions carry equal ma
Punjab Engineering College - CS - 101
Code No: R05410401Set No. 1IV B.Tech I Semester Regular Examinations, November 2008 COMPUTER NETWORKS ( Common to Electronics & Communication Engineering, Electronics & Instrumentation Engineering, Bio-Medical Engineering, Mechatronics and Electronics &
Punjab Engineering College - CS - 101
Code No: RR320503Set No. 1III B.Tech II Semester Supplimentary Examinations, Aug/Sep 2008 COMPUTER NETWORKS ( Common to Computer Science & Engineering, Information Technology, Electronics & Control Engineering, Computer Science & Systems Engineering and
Punjab Engineering College - CS - 101
Code No: RR410402Set No. 1IV B.Tech I Semester Supplimentary Examinations, November 2008 COMPUTER NETWORKS ( Common to Electronics & Communication Engineering, Electronics & Instrumentation Engineering, Bio-Medical Engineering and Electronics & Telemati