answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Is programming or software development easy?

It just depends on who you are and how you think. To do programming easily, you need a logical mind and you need to know how to think in a step-by-step manner. Ideally, you should have memorized the common commands of the language, but if you don't, that's fine, because you will learn them soon enough with practice.

Happy programming!

What gain is achieved by double buffering as opposed a single buffering?

Buffer is like bucket of data you write to at your own pace so that some other process can read from it at its own pace when it is needed. If you use a single buffer, you may end up overwriting what the other process did not read yet, or the other process may "catch up" with you before you finish writing your current set of data. Basically, you still need to carefully synchronize the two processes. With two buffers, you can write to one buffer while the other process is still reading the other buffer.

How to write printf statement for read characters into array str until the letter p is encountered?

In pseudo-code:

while ( not(end of string) and letter(string at position X) is not 'P' ){

add(array, newposition) = letter(string at position X);

}

What are the characteristics of gray code?

Due to grey code it is less chance to clamp Wrong....

if something is wrong then due to color code it is identified,,

Presuming the question is about Gray Codes, aka reflected binary code, the primary benefit is that it requires only a single binary digit to change when incrementing or decrementing a binary number.

That is, the Grey Code representation of X (base 10) has N binary digits in it. The Grey Code representation of either X-1 or X+1 requires only a single binary digit to change, out of the N digits which make up the number. Normal binary code can require up to all N digits to change when adding or subtracting a single increment.

The advantage here is cleanliness, in particular for mechanical and electrical circuits. Since it is impossible to absolutely synchronize change of digits, in a normal binary representation of a number, incrementing or decrementing it can leave the number in a variety of intermediary states, of which an outside observer cannot tell which is correct. This can cause all sorts of problems when constructing working devices, that otherwise appear to be perfectly designed in the abstract.

For a better explanation of the mechanics and usefulness of Gray Code, look at the Wikipedia article below.

How do computers translate human language to binary code?

first there are ascci codes for every key word & character. when you press any key it means you have press specific ascci code for that character.

example: if you press 1 its ascci code is 48. so the no 48 will get converted to binary by using of universal gates and encoder, and it will get stored in the ram. then by using decoder and logic gates it again get converted in to human language.

harsheet147@gmail.com

An ellipsis following a menu item tells you what?

The convention is that ellipses following a menu item usually means that the menu item will open a dialog box with further choices, rather than immediately carrying out an action.

What are difference between A and AO algorithm?

# Initialise the graph to start node # Traverse the graph following the current path accumulating nodes that have not yet been expanded or solved # Pick any of these nodes and expand it and if it has no successors call this value FUTILITY otherwise calculate only f' for each of the successors. # If f' is 0 then mark the node as SOLVED # Change the value of f' for the newly created node to reflect its successors by back propagation. # Wherever possible use the most promising routes and if a node is marked as SOLVED then mark the parent node as SOLVED. # If starting node is SOLVED or value greater than FUTILITY, stop, else repeat from 2.

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.

What is an arabesque design?

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.

What is node in c language?

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.

Who invented data structures?

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.