What is function overloading in oop?
An overloaded function is a function that has several implementations, the only difference being the number and type of parameters, including usage of the const keyword. Overloads cannot differ by return type alone. The following is a trivial example of function overloading.
const int & max(const int & lhs, const int & rhs){return( lhs>rhs ? lhs : rhs );}
const char & max(const char & lhs, const char & rhs){return( lhs>rhs ? lhs : rhs );}
Since the implementation is exactly the same, regardless of the type of parameters, it would make more sense to enlist the compiler to generate all the possible variants of this overloaded function using a template function. The compiler then generates all the overloads as required, and you only have one function to maintain.
Overloads are better suited to functions that have completely different signatures with a different number of parameters. For instance:
typedef struct rect_tag
{
float width;
float height;
} rect;
const float & Area( const rect & rc ){ return( rc.width * rc.height ); }
const int & Area( const int & width, const int & height ){ return( width * height ); }
const float & Area( const int & width, const float & height ){ return((float) width * height ); } const float & Area( const float & width, const int & height ){ return( width * (float) height ); }
The point of overloading functions is increased flexibility.You don't have to worry about which version of a function you call, nor is there any need to cast parameters to a specific type, since the compiler can work out which version of a function to call simply from the type of parameters you supply. If no suitable overload exists, the compiler will warn you so that you may either provide one, or explicitly cast your variables to a suitable version.
Mixing overloads with default parameter values increases the flexibility further, provided there is no ambiguity regarding which version of the overload is being called.
Can you develop a c plus plus program ATM?
created by: Me.. Jean guindanao
#include<stdio.h>
#include<conio.h>
void main(){
int Deposit;
int Withdraw;
int choice;
int PIN;
int ans,quit;
double Bal=0.00;
printf("Welcome to JV ATM\n");
PIN:
{
printf("Enter your PIN Number:\n");
scanf("%d",&PIN);
if(PIN 1){
goto menu;
}
else{
printf("You choose 2..\n");
printf("Thank you for using JV ATM\n");
printf("Have a Good Day..:)");
}
}
break;
default:
clrscr();
printf("Wrong Choice!!!");
}
}
}
What is the output of the parser from a compiler?
The output of an assembler is a part or all of a product. An assembler can work in a variety of manufacturing operations with the right training.
An Arabesque design is a painted or inlaid design of repeating, sometimes interlocking curlicue patterns. Sometimes the lines resemble abstractly represented stems and leaves.
What are some good articles dealing with computer crime or a security attack?
un lawful corruption of data and antoganising programes and varius security attaks un lawful corruption of data and antoganising programes and varius security attaks
What you call Programs that come into a computer system disguised as something else?
Normally its called a Trojan or malware or spyware, that's if it installs by ti self say for instance while surfing the internet. If its installed by a person withoout your prior knowledge i do not know waht you call it then hope this will help you.
What is faster access the element in an array or in a list?
Array is always faster to read from disk/access any element in the array is quicker since elements in a array are stored in contiguous location in the memory, you need the pointer to the head or 0th element in the array and then it much quick to navigate to the next on index based. But you need to know INDEX of the element for best results
List (say linked list) will be slower since not always elements are stored in contiguous location in the memory as well it involves a function call which is can be assembler/cpu expensive.
However getting an individual object from an array is faster if you know the index of the object. Walking through a linked list is faster than walking through an array, if you use a non-recursive algorithm.
--Vinay Solanki
What is server virtualization?
Virtualization means creation of virtual things like virtual storage device, server or network resources. Storage virtualization is done by pooling of different physical storage from multiple networks to form a single storage device. Server virtualization is done by masking of server resources. Network virtualization is done by combining the available resources in a network and by splitting the available bandwidth in to channels each of which are independent of other and each can be assigned to a particular server. Basically virtualization is done to utilize and manage the available resource properly. Server virtualization gives organizations the flexibility they need to respond the changing business requirement. Virtual servers reduce the physical resources. This gives organizations the ability to extend protection to additional applications and data with the same or fewer resources.
While doing research on virtualization i came across a site which provides virtualization solutions.
(link moved to link section)
What computer programs are you familiar with?
Assuming you were asked the question originally, and are looking for an answer, there is nobody more qualified than yourself to answer that question; it is a question about your personal ability.
I am personally familiar with hundreds, if not thousands, of software applications, commands, operating systems, and so on, ranging from the mundane to the esoteric. My knowledge generally encompasses Microsoft-based and Linux-based Operating Systems, and many of the common multimedia, administration, servers, programming, file sharing, and office suite applications they have to offer. In fact, it would take me several hours just to compose a comprehensive list of software I am familiar with.
No such predefined type, so you can define it as you wish.
What is meaning of the latest open source application software?
An open source application software is a software application which also provides the users the opportunity to take the source code and edit it. Customizing the source code and sharing it to other users for free is a way to make sure that the software is meant to benefit the user and not the programmer.
Design an algorithm to check if a given graph is connected?
As a rough outline, we start with some vertex x, and build a list of the vertices you can get to from x. Each time we find a new vertex to be added to this list, we check its neighbors to see if they should be added as well. Finally, we check whether the list covers the whole graph. In pseudocode: test-connected(G)
{
choose a vertex x
make a list L of vertices reachable from x,
and another list K of vertices to be explored.
initially, L = K = x.
while K is nonempty
find and remove some vertex y in K
for each edge (y,z)
if (z is not in L)
add z to both L and K
if L has fewer than n items
return disconnected
else return connected
}
To analyze the algorithm, first notice that the outer loop happens n times (once per vertex). The time for the inner loop (finding all unreached neighbors) is more complicated, and depends on the graph representation. One key step (testing whether z is in L) seems like it might be slow, but can be done quickly by keeping a bit on each vertex that says whether it's in L or not. * For the object oriented representation, each execution of the inner loop involves scanning through all m edges of the graph. So the total time for the algorithm is O(mn). * For the adjacency matrix representation, each execution of the inner loop involves looking at a single row of the matrix, in time O(n). So the total time for the algorithm is O(n^2). * In the adjacency list (or incidence list) representation, each element on each list is scanned through once. So the total time on all executions of the inner loop is the same as the total length of all adjacency lists, which is 2m. Note that we don't multiply this by n, even though this is a nested loop -- we just add up the number of times each statement is executed in the overall algorithm. The total time for the algorithm is O(m+n) At the end of the algorithm, the list L tells you one connected component of the graph (how much of the graph can be reached from x). With some more care, we can find all components of G rather than just one component. If graph is connected, we can modify the algorithm to find a tree in G covering all vertices (a spanning tree): For each z, let parent(z) be the vertex y corresponding to the time at which we added z to L. This gives a graph in which each vertex except x is connected to some previous vertex, and any such graph must be a tree
Write a program to add two numbers using oop?
#include<iostream.h>
#include<conio.h>
void main()
{
int a, b, c;
clrscr();
cout<<"enter the two numbers";
cin>>a;
cin>b;
c=a+b;
cout<<"Addition of two numbers="<<c;
getch();
}
What are the brief step in programming cycle?
Steps for Programming Cycle # try to understand and analyze the problem. # write the algorithm or draw the flow chart for the problem. # create the source file using editor and the code according to the flow chart or algorithm.
# compile the program using the system software and the object file is created. # step 4 is repeated till the source program contains no compilation errors, then step 6.
# link the necessary library files needed for the compilation of the object file.
# load the file for execution.
Steps 6 and 7 are a part of the execution process.
# execute the program using the run option.
How does constant defined by const differ from the constant defined by the preprocessor statement?
The preprocessor #define directive creates a macro, not a constant. While you can define a literal constant, and call it a constant, this is not the same as an actual constant. Constants (those defined with the const keyword) are really no different to variables; they have a size and type, they can be referenced, pointed at, and they have scope. In fact they only differ from variables in that you cannot alter their value once instantiated (the very definition of a constant). Macros have none of these properties, they are nothing more than text-replacements. And since they are inline expanded before compilation, the compiler never sees them, so you not only lose type-safety and scope, you also lose the help of the debugger. And on top of all that you also cannot point nor refer to a macro, nor can a macro refer to an object. You can only #define literal values, string literals and functions.
Whenever you have the option of using const or #define, go with const every time. It is type-safe, thus you automatically enlist the compiler to help spot any problems that would otherwise be invisible to you via a macro, and therefore difficult to track down. The #define directive should only ever be used when there is no suitable alternative within the C++ language itself, or when a macro helps resolves a complication that would be difficult to accomplish any other way. Keep in mind that macros are not actually part of the language, they are nothing more than simple text-replacements, akin to an automated copy/paste if you like. But when used correctly, such as when assembling top-level constructs from many pieces of boilerplate, they can greatly simplify your code. Just remember that the debugger can't help you debug a macro -- you're completely on your own.
Data structure is a very basic concept.
I don't think it's possible to trace it back to a single person who invented it...
What are different types of binary code?
BCD codes,gray code,error detecting code,ASCII character code,Excess 3 code
Difference between Data Type and Abstract Data Type?
A data type tends to mean a primitive data type. Primitive data are built-in data types, such as integers, characters and Booleans. They are basic constructs of the language (that is, they are built into the language).
Primitive data also tends to be of a strict data type, meaning you can't treat characters like integers or Booleans like integers, etc., although some languages will support implicit casting of primitive data types (for example, will treat Booleans like integers if you use a Boolean in an arithmetic operation).
Abstract data types are generally constructed by the user or by a higher level language. For example, you might create a currency data type, which generally acts like a float but always has a precision of 2 decimal places and implements special rules about how to round off fractions of a cent.
Abstract data types also often contain the ability to either be treated as a specific type of primitive data in certain circumstances (for example, many languages allow you to treat strings as character arrays); or contain certain rules / methods to manipulate their data (such as a programming language allowing you to cast a float as an integer).
A data structure is a gathering together of many different data types. For example, objects and arrays are data structures. Data structures usually can contain information of many different types (such as strings, integers, Booleans) at the same time, and in more complex structures -- namely, classes -- can contain specific methods, properties and events to manipulate that data, change its type, etc.
What is the difference between Scan code and the ASCII code for a keyboard key?
A scancode (or scan code) is the data that most computer keyboards send to a computer to report which keys have been pressed. A number, or sequence of numbers, is assigned to each key on the keyboard.
What advantages does a cloud applications have over installed application?
There are countless advantages of cloud storage. you can save whatever you want in a secure online environment and also can store large amounts of your data safely.
What are the Limitations of algorithms?
it can not explain all the details of the given problem........
it has no standard rule to solve any operation , different users use their own point of views......
A triangle with two equal sides?
A triangle with three equal sides is called an equilateral triangle. Such a triangle has three equal angles that add up to 180 degrees.
What is pseudocode for bucket sort?
input: an array a of length n with array elements numbered 0 to n − 1
inc ← round(n/2)
while inc > 0 do:
for i = inc .. n − 1 do:
temp ← a[i]
j ← i
while j ≥ inc and a[j − inc] > temp do:
a[j] ← a[j − inc]
j ← j − inc
a[j] ← temp
inc ← round(inc / 2.2)
That depends on who you ask and how far back you go. It could be Intel, it could be whoever designed the ENAIC (used for looking up trajectory tables) but I think it was Charles Babbage, inventor of the 'analytical machine.'
More:
http://en.wikipedia.org/wiki/Turing_complete