<< < 1 2 3 4 5 6 7 8 > >>   Sort: Date

Explain the ISA and HASA class relationships. How would you implement each in a class design?
Explain the ISA and HASA class relationships. How would you implement each in a class design? A specialized class "is" a specialization of another class and, therefore, has the ISA relationship with the other class. An Employee ISA Person. This relationship is best implemented with inheritance. Empl...
2012-03-19, 3032👍, 0💬

Define precondition and post-condition to a member function. C++
Define precondition and post-condition to a member function. C++ Precondition: A precondition is a condition that must be true on entry to a member function. A class is used correctly if preconditions are never false. An operation is not responsible for doing anything sensible if its precondition fa...
2012-01-11, 3029👍, 0💬

Write the psuedo code for the Depth first Search.
Write the psuedo code for the Depth first Search. dfs(G, v) //OUTLINE Mark v as "discovered" For each vertex w such that edge vw is in G: If w is undiscovered: dfs(G, w); that is, explore vw, visit w, explore from there as much as possible, and backtrack from w to v. Otherwise: "Check" vw without vi...
2012-04-16, 3020👍, 0💬

What is the difference between Stack and Queue?
What is the difference between Stack and Queue? Stack is a Last In First Out (LIFO) data structure. Queue is a First In First Out (FIFO) data structure
2012-04-11, 3008👍, 0💬

Does c++ support multilevel and multiple inheritance?
Does c++ support multilevel and multiple inheritance? Yes.
2012-02-02, 2993👍, 0💬

Will it execute or not? C++
Will it execute or not? C++ void main() { char *cptr = 0?2000; long *lptr = 0?2000; cptr++; lptr++; printf(” %x %x”, cptr, lptr); }Will it execute or not? Answer1 For Q2: As above, won’t compile because main must return int. Also, 0×2000 cannot be implicitly converted to a pointer (I assume you mea...
2012-03-26, 2991👍, 0💬

What is the use of ‘using’ declaration. C++
What is the use of ‘using’ declaration. C++ A using declaration makes it possible to use a name from a namespace without the scope operator.
2012-01-05, 2982👍, 0💬

When does a name clash occur? C++
When does a name clash occur? C++ A name clash occurs when a name is defined in more than one place. For example., two different class libraries could give two different classes the same name. If you try to use many class libraries at the same time, there is a fair chance that you will be unable to ...
2012-01-04, 2974👍, 0💬

What is C++?
What is C++? Released in 1985, C++ is an object-oriented programming language created by Bjarne Stroustrup. C++ maintains almost all aspects of the C language, while simplifying memory management and adding several features - including a new datatype known as a class (you will learn more about these...
2011-12-30, 2972👍, 0💬

How do you decide which integer type to use?
How do you decide which integer type to use? It depends on our requirement. When we are required an integer to be stored in 1 byte (means less than or equal to 255) we use short int, for 2 bytes we use int, for 8 bytes we use long int. A char is for 1-byte integers, a short is for 2-byte integers, a...
2012-03-05, 2950👍, 0💬

What is the difference between char a[] = “string”; and char *p = “string”; ?
What is the difference between char a[] = “string”; and char *p = “string”; ? Answer1 a[] = “string”; char *p = “string”; The difference is this: p is pointing to a constant string, you can never safely say p[3]=’x'; however you can always say a[3]=’x'; char a[]=”string”; - character array init...
2012-03-08, 2948👍, 0💬

Give 4 examples which belongs application layer in TCP/IP architecture?
Give 4 examples which belongs application layer in TCP/IP architecture? FTP, TELNET, HTTP and TFTP
2012-04-05, 2947👍, 0💬

How can you tell what shell you are running on UNIX system?
How can you tell what shell you are running on UNIX system? You can do the Echo $RANDOM. It will return a undefined variable if you are from the C-Shell, just a return prompt if you are from the Bourne shell, and a 5 digit random numbers if you are from the Korn shell. You could also do a ps -l and ...
2012-01-18, 2945👍, 0💬

Referring to the sample code above, what is the displayed , output if the input string given were: "5 10 Sample Word 15 20"?
int I, j; string s; cin &gt;&gt; I &gt;&gt; j &gt;&gt; s &gt;&gt; s &gt;&gt; I; cout &lt;&lt; I &lt;&lt; " " &lt;&lt; j &lt;&lt; " "&lt;&lt; s &lt;&lt; " "&lt;&lt; I; Referring to the sample code above, w...
2012-04-23, 2929👍, 0💬

What is encapsulation? C++
What is encapsulation? C++ Packaging an object’s variables within its methods is called encapsulation.
2012-02-07, 2928👍, 0💬

What can I safely assume about the initial values of variables which are not explicitly initialized?
What can I safely assume about the initial values of variables which are not explicitly initialized? It depends on complier which may assign any garbage value to a variable if it is not initialized.
2012-03-07, 2925👍, 0💬

What is an accessor? C++
What is an accessor? C++ An accessor is a class operation that does not modify the state of an object. The accessor functions need to be declared as const operations
2012-01-03, 2919👍, 0💬

What is a modifier? C++
What is a modifier? C++ A modifier, also called a modifying function is a member function that changes the value of at least one data member. In other words, an operation that modifies the state of an object. Modifiers are also known as ‘mutators’. Example: The function mod is a modifier in the foll...
2011-12-30, 2914👍, 0💬

What’s the meaning of ARP in TCP/IP?
What’s the meaning of ARP in TCP/IP? The "ARP" stands for Address Resolution Protocol. The ARP standard defines two basic message types: a request and a response. a request message contains an IP address and requests the corresponding hardware address; a replay contains both the IP address, sent in ...
2012-04-06, 2913👍, 0💬

What is public, protected, private? C++
What is public, protected, private? C++ Public, protected and private are three access specifiers in C++. Public data members and member functions are accessible outside the class. Protected data members and member functions are only available to derived classes. Private data members and member func...
2012-01-30, 2902👍, 0💬

How does throwing and catching exceptions differ from using setjmp and longjmp?
How does throwing and catching exceptions differ from using setjmp and longjmp? The throw operation calls the destructors for automatic objects instantiated since entry to the try block.
2012-03-15, 2898👍, 0💬

Write a function that swaps the values of two integers, using int* as the argument type.
Write a function that swaps the values of two integers, using int* as the argument type. void swap(int* a, int*b) { int t; t = *a; *a = *b; *b = t; }
2012-01-31, 2898👍, 0💬

Explain term POLIMORPHISM and give an example using eg. SHAPE object: If I have a base class SHAPE, how would I define DRAW meth
Explain term POLIMORPHISM and give an example using eg. SHAPE object: If I have a base class SHAPE, how would I define DRAW methods for two objects CIRCLE and SQUARE Answer1 POLYMORPHISM : A phenomenon which enables an object to react differently to the same function call. in C++ it is attained by u...
2012-02-08, 2893👍, 0💬

What is a Null object? C++
What is a Null object? C++ It is an object of some class whose purpose is to indicate that a real object of that class does not exist. One common use for a null object is a return value from a member function that is supposed to return an object with some specified properties but cannot find such an...
2012-01-10, 2879👍, 0💬

<< < 1 2 3 4 5 6 7 8 > >>   Sort: Date