Você está na página 1de 14

(B) Please choose the most appropriate answer from the given set of answers to fill the blanks.

11. During the program execution, temporary/intermediate values are stored in _____________. a. Registers b. Peripherals c. LAN d. None of these Registers
Quote:

12. The objects can be inherited by _____________. a. A single object only b. Multiple objects c. Both (a) and (b) d. Either (a) or (a) A single object only
Quote:

13. The operating system may perform _____________ operation to manage the memory while running a large program. a. Sorting b. Scheduling c. Paging d. None of these Paging
Quote:

14. When the LAN is arranged in such a way that each computer is connected directly to the HUB the configuration can be termed as _____________ network. a. Bus b. Star c. Ring d. None of these Star
Quote:

15. To communicate with other computers over a telephone line the computer must have _____________ installed. a. Telephone set b. Modem c. LAN Card d. None of these Modem
Quote:

16. When each item of data in a database is directly linked with every other item of data, the database is called _____________.

a. Relational b. Hierarchical c. Network d. None of these Relational


Quote:

17. _____________ is the most efficient method to reduce the duplication of data. a. Duplication c. Normalization c. Empty fields d. None of these Normalization
Quote:

18. The _____________ operation changes the coordinate values of objects being displayed. a. Transformation b. Windowing c. Both (a) and (b) d. None of these c. Both (a) and (b)
Quote:

19. A linear sequential software development model is also referred to as ____________ . a. Prototype Model b. RAD Model c. Spiral Model d. None of these None of these
Quote:

20. State Transition Diagram gives information of ___________. a. Data Flow b. Entry Relationship c. Control Flow d. None of these None of these First what is LAN means Local Area Network? This type of network is mostly used in one building and in which the connected computers are not more than 256. A LAN connects network devices over a relatively short distance. A networked office building, school, or home usually contains a single LAN, though sometimes one building will contain a few small LANs, and occasionally a LAN will span a group of nearby buildings. In IP networking, one can conceive of a LAN as a single IP subnet (though this is not necessarily true in practice). Besides operating in a limited space, LANs include several other distinctive features. LANs are typically owned,

controlled, and managed by a single person or organization. They also use certain specific connectivity technologies, primarily Ethernet and Token Ring. The distinction between a LAN and a WAN involves the physical distance that the network spans. A third category, the MAN, also fit into this scheme as it too is centered on a distance-based concept. What the topology is:- the way in which connections are made and arrangement of computer is referred as topology. Two kinds of Topologies are: Physical and Logical. Physical topologies are bus, star , ring and physical mesh topology. Bus:- in this type of topology the computers are connected by a single cable and we use terminator at the end of the cable that is used to bounce back the signal. In which we have the logical topology Ethernet 10 Base 2. Repeaters are used in the place of Hubs. Star:- the computers are arranged in the form of star and in which we have a central hub . the logical topology that works here is Ethernet 10 Base 5. trouble shooting is easy in s tar just bcoz of Hub. Ring:- when we need high performance network we use ring topology in which computers are arranged in form of ring . it is an expensive one . we use token passing method in this topology . logical topology is FDDI(Fiber Distributed Data Interface).

Physical Mesh Topology: combination of different topologies. Most expensive topology provides

MAN: A Metropolitan Area Network connects an area larger than a LAN but smaller than a WAN, such as a city, with dedicated or high-performance hardware. For example: if we have network b/w Rawalpindi and Islamabad or Karachi and Hyderabad then it is dubbed as MAN. WAN(Wide Area Network): A wide-area network spans a large physical distance. A WAN like the Internet spans most of the world! A WAN is a geographically-dispersed collection of LANs. A network device called a router connects LANs to a WAN. In IP networking, the router maintains both a LAN address and a WAN address. WANs differ from LANs in several important ways. Like the Internet, most WANs are not owned by any one organization but rather exist under collective or distributed ownership and management. WANs use technology like ATM, Frame Relay and X.25 for connectivity. WAN requires special media , which are provided by telephone companies. WAN also requires special hardware. Physical media for WAN: WANs use special purpose telephone wires, fiber optic cables, microwaves or satellites for communication. The simplest WANs use dedicated lines, which are special conditioned telephone lines that directly and permanently connects two computers. Microwaves are radio waves that have a very high frequency .the disadvantage of using them is that they depend on line of sight transmission. No obstruction can get in the way, and they can travel only about 50 miles. Communication satellites are placed in geosynchronous orbit thousands of miles above the earth. In this orbit, the satellite rotates with the earth so that it is always above a given spot. The latest WANs use long distance fiber optic cables. WAN uses some special hardware items and these are multiplexor(combines input signals from several computers and sends the combines signal along the communication channel) routers(they receive packets of data and examine their address, they decide where to send each packet) , front-end processors(handle all the communications tasks for large computers, and also provide security to prevent unauthorized access).

This is what the WAN , I discussed WAN in detail as compare to MAN, bcoz if you have good un derstanding of LAN and WAN , you can easily understand MAN as it is stuck between LAN and WAN.. the only difference is of distance.

Entity Relationship model is a logical representation of data of an organization or a business area.As visible from its name, it's about the relationship between certain entities which are logically related.What is an entity?Entity is about(the description of) a person, an object, place or an event or even concept in the user environment about which an organization may wish to organize data.Where there is a name of "Relationship", it is obvious that this is a term belongs to the RDBMS(Relational Database Management System).And as we know that in this kind of DBMS we develop relations between two similar kind of entitiy instances which may posses (conditionally)different attributes('Charecteristics of an entity type which may be an interest of an organization') but must represent a common objective.Attributes have three primary types;Simple,Multivalued and Derived.Another term used quite fluently in E-R model is Instance or Entity Instance. Instance is the occurance of an entity type.And is necessary to bring into notice before creating any sort of Erelationship is made.That was a brief introduction to Entity and terms linked to it. Now what is a relationship?It is a binding factor which associates two or more (instances of)entity types together to form a smart Database which will be helpful for user(easily modified or updated) as well as for the MIS and DSS (to get information whenever needed in a detailed fashion).What happens when a relationship is created?Relationship acts like a glue to the entities to join them together.Or should I illustrate it more meaningfully as:"Relationship is an association among the instances of one or more than one entity types". Here Part-I "introduction to Entity, Relationship and E-R Model" finishes here.In the next part I will describe how an E-R model is developed and what are different kinds of E-R models. Part-II "Constructs of an E-R model and Types of relationships " While constructing an E-R Model one should have good acquaintance with the cardinal constraints. A constraint which specifies the number of the instances of an entity type for example B which may associate with another called A.It specifies minimum and maximum no of instances of an entity type.Possible constraints are Mandatory one,Mandatory many,optional one ,optional many and a specific no.A minimum cardinality of 0 specifies optional participation while 1 represents mandatory. Relationships are of three types in general.Unary(relationship between the single entity type's instances);Binary(relationship between the instances of two entity types);Ternary(relationship between the instances of three entity types). Degree is the number of entity types which participate in a relationship.(Unary;1,Binary;2 and Ternary;3). In unary type of relationship there may be one-to-one or one-to-many relations. In Binary type there may all the three major kinds involved;one-to-one,one-to-many and many-to-many(instances of entity type). In ternary a simultaneous relationship between three different entity types('s instances)takes place. Another thing which I want to mention here is the two types of entities.1.Strong Entity,2.Weak Entity.The independent entity which posseses its own identifier and doesn't need another entity to work is a strong entity.On contrary, the entity whose function depends upon the other entities and it may only posses a partial identifier is known as weak entity. Part-III is another kind of E-R which is known as E-E-R(Enhanced Entity Relationship).

CGI refers Common Gateway Interface. It is one of the earliest scripting languages .a CGI application runs entirely on server,and can be used to create dynamic web applications. CGI programs are small executables, that the server executes in response to a request from a browser.it is most common application in the forms processing.CGI allows you to create pages for users as individual requests come in , and you can customize pages to match that information. Perl : it is a language with powerfull text-processing capabillities.Perl is undoubtedly the most common language used for scripting CGI. i don't have any practical exposure abt perl that's why i m giving you some theoritical knowledge regarding this.the matter of the fact is that now CGI is loosing its market just because of its extra overhead on server and ISAPI is taking its place; well proceed further.. most of CGI is just standard Perl, with a few changes here and there . CGIs process input differently than old Perl scripting does - and this is the only difference you'll find between the two. Once the CGI scripts process the input, it becomes data, which is treated pretty much the same way by both CGI and Perl scripts. CGI input can be retrieved in two different ways: "get" and "post." Perl has allowed us to provide a very easy to use and enjoyable interface to our database servers. The servers are actually on NT running a proprietary database software package. The database software is very good at performing both full text and exact term searches of the term data. However, the software interface to the database engines is weak and unusable at best. By using Perl to talk to the database server's HTTP interface we were able to extract the desired results data and then use Perl's power to reformat the results into something pleasing and tailored to the user's preferences. we can write Perl script on texteditor.it is possible to write simple programs in Perl with minimum of effort. As we can write CGI programs in c++,c but perl is mostly preffered. Perl is a full fledged programming language.It was desgined with an objective to make dynamic and smart web pages. It has an extensive structure handling feature.Syntaxwise this language is short but its library makes it like C.I mean short but powerful.Here is an exaple: This is a program written in Perl which will take user input for two enteries and will add them, 1 print "Please Enter 1st no to add:\n";'\n is to move to the other line with out printing it, the messages doesn't matter how many times u use the print statement will print on the same line[like C]'

3 $number1=<STDIN>;'causes execution of the program whilw the computer is waiting for user input' 4 chomp $number1;'removes charecter/no from the ending of the line placed as the input[previous input](for new entry)'[I take this to be an ambiguity and should be removed by making its compiler powerful and understanding that a new input is supposed to be made so clear the previous input so that syntax becomes shorter like we do this in C] 6 print "Please enter second no:"; 8 $number2=<STDIN>; 10 chomp $number2; 13 $sum=$number1+$number2; print "The sum is $sum";'no need to express format type as the variable is scaler and is defined wherever need' Now that was a sample program.If I am asked to compare its syntax with some language.It would certainly be the Basic. Now a brief account of Perl's programming approach. Programs may be written in different ways and Perl is a highly portable language.Its code is easy to understand. Perl 3, 4 and 5 and 6 are the versions available in the market but Perl 6 is the latest in use.Perl 6 (2000)is a complete rewrite of internals and externals after complete re-organization of done in its previous version. Computer languages are divided into two major classes. (1).Procedural Programming Languages and (2).Object Oriented programming Languages. Today we got to discuss the second class so let's start with it. To understand Object Oriented Programming(Language) well, one should have good acquanitance with fundamental Programming techniques. The Programming Languages have divided the world into two parts. *Data and *Operations on Data. Data is static and is immutable unless affected by the certain operations which could certainly bring about a mutation in the structure of it(data). The operations which operate Data are called as procedures or functions. A point to understand here is that these functions or procedures which we pronounce as operations on data have no lasting state, they are only useful when they affect data in a desired fashion as that is the purpose of their life. Now being succinct I come straight to the main topic and will depict why to use OOPL? How much distinct it is intrinsically from the PPLs? answering first query; OOPLs provide the programmer with the following advantages which are not provided by the former class as it makes programs: 1. more intuitive to design 2. faster to develop 3. amenable to modifications 4. easier to understand 5. conceiving program tasks in a better way 6. more secure and easy to restrict 7. inherit from classes and to overload methods which could be run recursively and need to be defined once 8. get merged with other programs in such a way that no fear of data loss remains likely Second query is answered as so; Same functions and procedures used in PPLs are extended and re-organized in a novel way. Making it closer to the nature but yet has a drawback of the lack of elucidation which makes it harder to understand. It means that the OOPL(s) have the same state and behavior and a real high level unit called object to make the programming dynamic and faster. Now to define OOP, firstly one should learn what an object stands for? Object is everything and just a black box. This statement means that everything present on the suface of the planet is an object, while taking OOP as an ad hoc it is merely a box which has a function to receive and transmit data

according to the signals or commands. Making it easier to understand I will put it this way. OOP is something which groups Data and Operations into modular units called Object. This object will receive signals in the form of command syntax will operate the data the way, it(code) is directing and then finally to bring the result back to the programmer alongwith the command control. Here we reach a conclusion and in a better postition to define OOP. "The insight of object-oriented programming is to combine state and behavior, data and operations on data, in a high-level unit, an object, and to give it the language support" Now a curt description of the Object Oriented Development Environment Basically this environment is comprised of three parts. 1. A library of objects, software frameworks and kits(for building GUI and other graphical applications). 2. A set of Development tools(Merging and modifying more than one programs etc) 3. An Object-Oriented Programming Language(Enabling a programmer to encode a program into the specified fashion, and making the system understand to work according the user needs and commands) Now some brief notation of the most important and frequently used OOP terms. 1. Object(defined earlier) 2. Message(Software objects communicate with each other via messages) 3. Class(A prototyped that defines the variables and methods common to all objects of the similar kind, thereby making program re-useable and extensible) 4. Inheritance(Provides a natural and powerful mechanism for organizing software programs, usually a class inherits state and behavior from its super-class) 5. Overloading(multiple declaration or assignment of a method) That was a brief introduction to the OOP(L). Any kind of supplementation has got full scope and will surely get a decent response. Two of the more common data objects found in computer algorithms are stacks and queues. Stacks are data structures, which maintain the order of last-in, first-out (LIFO) Queues are data structures, which maintain the order of first-in, first-out (FIFO) ***Stack: A stack is a storage device that stores information in such a way that the item stored last is the first item retrieved. A stack is an ordered list in which all insertions and deletions are made at one end, called the top. Stack Pointer: the register that holds the address for the stack is called a stack pointer (SP)coz its value always points at the top item in the stack. Operations of a Stack The operations of a stack can be matched to the stack of trays. The last tray placed on top of the stack is the first to be taken off. The two operations; performed on a stack are insertion and deletion of items.Insertion and deletion, both acted upon at one end of the list (called the top). Push(X) Insert element with value X at top of stack. Pop() Remove top element of stack These operations are simulated by incrementing or decrementing the stack pointer register. The PUSH operation is implemented with the following sequence of micro operations: SP SP+1 (increment stack pointer)

M [SP]DR (write item on top of the stack) If (SP=0) then (FULL1) (check if stack is full) EMPTY0 (Mark the stack not empty) The POP operation is implemented with the following sequence of micro operations: DR M [SP] (Read item from the top of stack) SPSP-1 (Decrement stack pointer) If (SP=0) then (EMPTY1) (check if stack is empty) FULL0 (Mark the stack is not full) Stack as an Abstract Data Type Here is a more formal definition of the stack ADT: A stack is a data structure containing zero or more elements, on which the following operations can be performed: create Create a new, empty stack object. empty Determine whether the stack is empty; return true if it is and false if it is not. Push and Pop I have defined earlier top Return the element at the top of the stack (without removing it from the stack). (This operation, too, can be performed only if the stack is not empty.) This abstract data type definition says nothing about how we will program the various stack operations; rather, it tells us how stacks can be used. We can infer some limitations on how we can use the data. A stack organization is very effective for evaluating arithmetic expressions. ***Queue: A queue is an ordered list in which all insertions take place at one end, the rear, while all deletions take place at the other end, the front. Like a line of people waiting for some service, a queue acquires new elements at one end (the rear of the queue) and releases old elements at the other (the front). Queues are more difficult to implement than stacks, because action happens at both ends. Queue as an Abstract Data Type Following is the abstract data type definition for queues, with the conventional names for the operations: create Create a new, empty queue object. empty Determine whether the queue is empty; return true if it is and false if it is not. enqueue Add a new element at the rear of a queue. dequeue Remove an element from the front of the queue and return it. (This operation cannot be performed if the queue is empty.) front Return the element at the front of the queue (without removing it from the queue). (Again, this operation cannot be performed if the queue is empty.) Types of Queues : some of them are given below: Circular Queues :Circular queues let us reuse empty space. Double-ended queues - These are data structures which support both push and pop and enqueue/dequeue operations. Priority Queues(heaps) - Supports insertions and ``remove minimum'' operations which useful in simulations to maintain a queue of time events. this is what the brief account in context of stack and queries

"Polish Notation and Stack Evaluation". There are some terminologies could help us a lot while writing down an essay over Stacks and Ques in exams like; infix, Polish or Parenthesis-free notation. Infix is the ordinary notation for writing expressions, where operators separate arguments. for example, 3+7 while in the case of Polish notation which is really useful for stack oriented evaluation operater comes after the arguments. for example, 3, 5, +(Polish notation) => 3+5 (infix notation) and 10 , 6, 9, *, + (Polish notation) => 10+(6*9) (infix notation)etc A polish expression could better be evaluated by such algorithm using two stacks. A polish stack will contain polish expression and the evaluation stack stores the intemediate values during execution. Lets evaluate the polish expressions now. We will use A, B and C to hold data. What will happen when the program will execute. The following actions will be done: 1. If the polish stack is empty, halt with the top e. stack as the answer. 2. If stack is not empty, pop the polish stack into A. 3. If A is a value then push A onto the e. stack. 4. If A is an operator then pop the e. stack twice, first into C and then into B. Then do the computation of B and C and then operate them on by A and push the result into e. stack. Go to step 1. That was a curt introduction to the evaluation of Stacks and what are polish notations

Inheritance
A class that is derived from another class is called a subclass (also a derived class, extended class, or child class). The class from which the subclass is derived is called a superclass (also a base class or a parent class The idea of inheritance is simple but powerful: When you want to create a new class and there is already a class that includes some of the code that you want, you can derive your new class from the existing class. In doing this, you can reuse the fields and methods of the existing class without having to write (and debug!) them yourself. A subclass inherits all the members (fields, methods, and nested classes) from its superclass. Constructors are not members, so they are not inherited by subclasses, but the constructor of the superclass can be invoked from the subclass An Example of Inheritance Here is the sample code for a possible implementation of a Bicycle class that was presented in the Classes and Objects lesson: public class Bicycle { // the Bicycle class has three fields public int cadence; public int gear; public int speed; // the Bicycle class has one constructor public Bicycle(int startCadence, int startSpeed, int startGear) { gear = startGear; cadence = startCadence;

speed = startSpeed; } // the Bicycle class has four methods public void setCadence(int newValue) { cadence = newValue; } public void setGear(int newValue) { gear = newValue; } public void applyBrake(int decrement) { speed -= decrement; } public void speedUp(int increment) { speed += increment; } } A class declaration for a MountainBike class that is a subclass of Bicycle might look like this: public class MountainBike extends Bicycle { // the MountainBike subclass adds one field public int seatHeight; // the MountainBike subclass has one constructor public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) { super(startCadence, startSpeed, startGear); seatHeight = startHeight; } // the MountainBike subclass adds one method public void setHeight(int newValue) { seatHeight = newValue; } } MountainBike inherits all the fields and methods of Bicycle and adds the field seatHeight and a method to set it. What You Can Do in a Subclass A subclass inherits all of the public and protected members of its parent, no matter what package the subclass is in. If the subclass is in the same package as its parent, it also inherits the package-private members of the parent. You can use the inherited members as is, replace them, hide them, or supplement them with new members: The inherited fields can be used directly, just like any other fields. You can declare a field in the subclass with the same name as the one in the superclass, thus hiding it (not recommended). You can declare new fields in the subclass that are not in the superclass.

The inherited methods can be used directly as they are. You can write a new instance method in the subclass that has the same signature as the one in the superclass, thus overriding it. You can write a new static method in the subclass that has the same signature as the one in the superclass, thus hiding it. You can declare new methods in the subclass that are not in the superclass. You can write a subclass constructor that invokes the constructor of the superclass, either implicitly or by using the keyword super.

Array
C++ Arrays are the data structures which can be used to store consecutive values of the same data types. C++ Arrays can be declared for all c++ data types viz., int, float, double, char, struct, char etc., All the values are stored in consecutive memory locations. The values can be accessed by using the position of the stored value Declaring C++ Arrays of int type: The c++ arrays are declared with the data type name and the number of elements inside the square brackets. int var_name[50]; // C++ Array of type int with maximum size = 50. The above declaration means, the var_name is an array of integer type. The values inside this var_name array can be accessed by referring to the position of their elements like var_name[0], var_name[1] etc., All the C++ arrays are based on Zero index values. That means the position reference starts at 0 and counts till the n1th position. So in the above array, 50 elements can be stored starting from 0 to 49. The maximum number of elements that can be stored or the maximum size of the c++ array is 50. The values can be stored and accessed as given in the following code snippet. var_name[0] = 0; var_name[1] = 1; var_name[2] = 30; Declaring C++ arrays of type float: The declaration and use of c++ arrays in float type are the same as int. The declaration is written as follows. float var_float[100]; //A c++ array of float type The above declaration means, the c++ float array contains 100 elements starting from position 0 till 99. The elements can be accessed as var_float[0], var_float[1], var_float[2] .. var_float[99]. var_float[0] = 10.05; var_float[1] = 11.04; var_float[99] = 87.65; Declaring C++ arrays of type char: This is one of the most widely used and problematic type of c++ array. When an array of char is declared, this char array can be used as a string with the maximum size as specified in the array declaration. When this c++ char array is declared with two dimensions, this can be thought as an array of strings. char var_char_array[50]; //Memory reserved for 50 characters. char var_char_init[] = "c++ char array string example"; // initialization without specifying the size Like the above the c++ char array can be declared with or without initializing values.

C++ Array Advantages: Easier to declare and use. Can be used with all data types. C++ Array Disadvantages: Fixed size data. If the number of elements stored are less than the maximum size, then the rest of the memory space goes waste. If the number of elements to be stored are more than the maximum size, the array cannot accommodate those new values. <ENDL;

function overloading
Function Overloading In order to overload a function, a different signature should be used for each overloaded version. A function signature consists of the list of types of its arguments as well as their order. Here's a set of valid overloaded versions of a function named f: void f(char c, int i); void f(int i, char c); void f(string & s); void f(); void f(int i); void f(char c); Function overloading is one of the most powerful features of C++ programming language. It forms the basis of polymorphism (compile-time polymorphism you have to declare functions in such a way that they differ either in terms of the number of parameters or in terms of the type of parameters they take. you just need to declare two or more functions having the same name but either having different number of parameters or having parameters of different types. Example 1: Overloading Functions that differ in terms of NUMBER OF PARAMETERS //Example Program in C++ #include<iostream.h> //FUNTION PROTOTYPES int func(int i); int func(int i, int j); void main(void)

{ cout<<func(10);//func(int i)is called cout<<func(10,10);//func(int i, int j) is called } Overloading Functions that differ in terms of TYPE OF PARAMETERS //Example Program in C++ #include<iostream.h> //FUNTION PROTOTYPES int func(int i); double func(double i); void main(void) { cout<<func(10);//func(int i)is called cout<<func(10.201);//func(double i) is called }

Class and object


Classes and objects are separate but related concepts. Every object belongs to a class and every class contains one or more related objects. A Class is static. All of the attributes of a class are fixed before, during, and after the execution of a program. The attributes of a class don't change. The class to which an object belongs is also (usually) static. If a particular object belongs to a certain class at the time that it is created then it almost certainly will still belong to that class right up until the time that it is destroyed. An Object on the other hand has a limited lifespan. Objects are created and eventually destroyed. Also during that lifetime, the attributes of the object may undergo significant change. Concept of Class and Object Class refers to a blueprint. It defines the variables and methods the objects support Object is an instance of a class. Each object has a class which defines its data and behavior Classes reflect concepts, objects reflect instances that embody those concepts. A class captures the common properties of the objects instantiated from it A class characterizes the common behavior of all the objects that are its instances Class Visible in source code The code is not duplicated Object Own copy of data Active in running program Occupies memory Has the set of operations given in the class

Procedural vs. Object-Oriented Programming


The unit in procedural programming is function, and unit in object-oriented programming is class Procedural programming concentrates on creating functions, while object-oriented programming starts from isolating the classes, and then look for the methods inside them. Procedural programming separates the data of the program from the operations that manipulate the data, while object-oriented programming focus on both of them procedural languages Focus is on procedures All data is shared: no protection More difficult to modify Hard to manage complexity object oriented programming Object-oriented programming is a method of implementation in which programs are organized as cooperative collections of objects, each of which represents an instance of some class, and whose classes are all members of one or more hierarchy of classes united via inheritance relationships

object oriented programming design n represent object determine relationship between object determine attribute each object has determine behavior each object will respond to

procedural language top down approach create function to do small task communicate by parameters and return values

Você também pode gostar