answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Where do you find instances in World of Warcraft?

Instances in WoW are all over the place. Theres one in the Barrens near Thunderbluff, theres one in Westfall, one in Dun Morogh, theres one actually inside a Capital city: Stormwind City. So.... Just look around cause the instances are all over the place.

Why in copy constructor in c you use pass by reference?

Because if it's not by reference, it's by value. To do that you make a copy, and to do that you call the copy constructor. But to do that, we need to make a new value, so we call the copy constructor, and so on...

(You would have infinite recursion because "to make a copy, you need to make a copy".)

How can you use hacking in c program?

That entirely depends on what you want it to do, however it is easy to send commands to the command line using subprocess.Popen(), read files and modify them or back them up using the built in open(), or delete files.

Did this answer your question?

Write an algorithm to find max of 10 numbers?

Someone's coursework?! This function is for an array of integers, the length of the array is Count.

int MaxInt(NumArray as *int, Count as int)

{

int Inst;

int Result;

Result = NumArray[0];

for (Inst=0;Inst

{

if(NumArray[Inst] > Result)

{

Result = NumArray[Inst];

}

}

return Result;

}

Why multithreaded programming is beneficial over single threaded programming?

Not having multithreading is like only having one arm and one gram of brain tissue. Multithreading is essential to computer application operation.

Multithreading allows a computer to:

* Distribute processing power over various applications, allowing multiple programs to run at the same time. * Allow a program to run non-essential processes in the background while the main application continues to run normally without hold-ups. * Manage timing of different events without making the process too complicated. For example, say that you have an application that does text editing and plays music. You would want to run the text editor part and the music playing part on separate threads, because otherwise, when the text editor got to a computation-intensive stage, the music would be slower, and when the text editor was idle, the music would be faster.

This is also what allows the computer to run multiple applications at once. If the computer could not distribute processing power over multiple applications, then you could not run multiple instances of a text editor, or an internet browser, or really anything. Really, nothing would be possible because the system resources would monopolize the processor.

In reality, this is how the processor handles threads: it goes around and devotes some time to each one, then moves on to the next. It "rounds the bases" so fast, like a cathode ray tube TV, that we don't notice the different. Duel (and triple, and quad, etc.) core processors allow one to split the applications and their corresponding threads to operate on different processors, affecting how much processing power they each receive.

Different graphics functions in'C' language?

There are no built in or standard graphics library with the original C language. The BGI library graphics.h has many functions for borland graphics. windows.h is another header file for creating user interfaces in windows.

What is an Program compilation?

That means to convert the original program - the source code, written by a programmer - into machine language, or into an intermediate form, for example, Java bytecode in the case of Java.

That means to convert the original program - the source code, written by a programmer - into machine language, or into an intermediate form, for example, Java bytecode in the case of Java.

That means to convert the original program - the source code, written by a programmer - into machine language, or into an intermediate form, for example, Java bytecode in the case of Java.

That means to convert the original program - the source code, written by a programmer - into machine language, or into an intermediate form, for example, Java bytecode in the case of Java.

What is the Significance of Software Testing?

Software engineering is the discipline of designing, writing, testing, implementing and maintaining software. It forms the basis of operational design and development of virtually all computer systems. The discipline extends to application software on personal computers, connectivity between computers, operating systems and includes software for micro-controllers, small computers embedded in all types of electronic equipment.

Without software engineering, computers would have no functionality. Although hardware is just as important, no software means no computers. It is a fundamental part of today's information systems and engineering and our lives would be very different without it.

Is there a perfect programming language?

High-level of abstraction with low-level efficiency. Such languages already exist, but none are "perfect" in every situation. That's one of the reasons we have so many languages at our disposal. It would be impractical to combine them into a single language, you simply choose the best tool for the job at hand.

What are the disadvantages and advantages of prototyping over system development life cycle?

Basically speaking, there are five advantages that prtotyping could bring about.

1) Provides functionality and interactions. Static high-fidelity mockup and wireframe are unable to convey animation. But a prototyping with interaction can do it pretty well.

2) Make actual communication with your boss, stockholders and users. The communication is necessary, the more they understand your design, the bigger the chance you can buy them in.

3) Detect errors earlier and save time and money. Trust me, any mistakes cost you less in prototyping stage than to be found in the later development stage.

4) Enhance collaboration within your team members internal. It can improve efficiency largely.

5) Involve user feedback and help to do multiple-test. It’s a key factor to iterate and update.

So, it's necessary to make prototypes before you develop actual products or websites. When it comes to prototyping, I would like to share one tool with you: Mockplus Cloud.

Mockplus Cloud - Connect your entire product design workflow.

As a brand-new collaboration tool for designers and developers, it goes far beyond design and workflow—allowing mobile designers to create masterpieces. It allows you to upload your wireframes and visual designs from Photoshop, AdobeXD, and Sketch, and add them to your project folder.

A full set of features about prototyping, commenting, collaborating and design handoff enable you to create a product from the start to finish.

Hopefully, this helps.

Algorithm to find factorial using functions?

factorial using recursion style in c++ is

unsigned int fact(unsigned int a)

{

if (a<=1)

return 1;

else

{

f*=fact(a-1);

return a;

}

}

when using looping structure factorial is

unsigned int fact (unsigned int n)

{

unsigned int i,f=1;

for(i=1;i<=n;i++)

f*=i ;

return f;

}

Advantage and disadvantage of graphical user interface?

A graphical user interface (GUI) provides a more natural way for a user to communicate with a computer, through the use of pictures clickable menus, file folders, icons and many other more natural methods of being able to get your job done. When compared to a Cmmand line interface (CLI) there is a much smaller learning curve to get the job done.

Difference between encapsulation and abstraction?

Encapsulation means hiding something, so you don't know anything about it, not even whether it exists or not.

Abstraction means vague, you may know what it is or expect what it will be and thus behave, but not exactly. And you don't know how it (the object) is implemented in details.

In a more compact context, encapsulation is referring to hiding data members (or attributes) and their types from outsiders, while abstraction means to define the interface or behaviors of an object (the APIs). You know the method signatures (the contracts), but you don't know anything about the implementation.

In a header file whether functions are declared or defined?

Ideally, functions should only be declared in a header and defined in a translation unit (source file) that includes the header. However, trivial functions are often defined in a header as they are usually good candidates for inline expansion, but you must remember to declare the function inline. Often it is better to forward declare inline functions so that maintainers are not distracted by the implementation details which can be placed towards the end of the header, out of the way. However, a definition is also a declaration, so forward declaring an inline function is not a requirement unless there is a cyclic dependency issue where a forward declaration is necessary to break the cycle.

Passing two dimensional arrays into functions in C programming?

The correct way in C++ is to not use arrays, but to use vectors instead. You can then pass vector references to your function just as you would pass references to any other object types.

If you choose to use arrays rather than vectors, then you must pass a reference to the first element in each array, along with the number of elements in each array, just as you would have to if you were writing for C rather than C++.

Advantages of RSA algorithm in encryption and decryption of a plain text?

RSA's biggest advantage is that it uses Public Key encryption. This means that your text will be encrypted with someone's Public Key (which everyone knows about). However, only the person it is intended for can read it, by using their private key (which only they know about). Attempting to use the Public Key to decrypt the message would not work. RSA can also be used to "sign" a message, meaning that the recipient can verify that it was sent by the person they think it was sent by.

Write a program in c to implement the depth first traversal?

#include <iostream.h>

#include <conio.h>

class graph

{

private:int n;

int **a;

int *reach;

int *pos;

public:graph(int k=10);

void create();

void dfs();

void dfs(int v,int label);

int begin(int v);

int nextvert(int v);

};

void graph::graph(int k)

{

n=k;

a=new int *[n+1];

reach=new int[n+1];

pos=new int [n+1];

for(int i=1;i<=n;i++)

pos[i]=0;

for(int j=1;j<=n;j++)

a[j]=new int[n+1];

}

void graph::create()

{

for(int i=1;i<=n;i++)

{

cout<<"Enter the "<<i<<"th row of matrix a:

";

for(int j=1;j<=n;j++)

cin>>a[i][j];

}

for(int k=1;k<=n;k++)

reach[k]=0;

}

void graph::dfs()

{

int label=0;

for(int i=1;i<=n;i++)

if(!reach[i])

{

label++;

dfs(i,label);

}

cout<<"

The contents of the reach array is:

;

for(int j=1;j<=n;j++)

cout<<reach[j]<<" ";

}

void graph::dfs(int v,int label)

{

cout<<v<<" ";

reach[v]=label;

int u=begin(v);

while(u)

{

if(!reach[u])

dfs(u,label);

u=nextvert(v);

}

}

int graph::begin(int v)

{

if((v<1)&&(v>n))

cout<<"Bad input

";

else

for(int i=1;i<=n;i++)

if(a[v][i]==1)

{

pos[v]=i;

return i;

}

return 0;

}

int graph::nextvert(int v)

{

if((v<1)&&(v>n))

cout<<"Bad input

";

else

for(int i=pos[v]+1;i<=n;i++)

if(a[v][i]==1)

{

pos[v]=i;

return i;

}

return 0;

}

void main()

{

clrscr();

int x;

cout<<"Enter the no of vertices:

";

cin>>x;

graph g(x);

g.create();

cout<<"dfs is.....";

g.dfs();

getch();

}

Advantages of CUI and GUI?

CUI and GUI are acronyms that stand for different kinds of user interface systems. These are terms used in reference to computers. CUI stands for Character User Interface while GUI refers to Graphical User Interface. Though both are interfaces and serve the purpose of running the programs, they differ in their features and the control they provide to the user.

How do you write algorithm to print first ten even numbers?

Maybe not the most elegant way but it works.

public class Main {

public static void main(String[] args) {

int count = 0;

int number = 2;

while(count < 10) { int c=0;

for(int i = 2; i < number ; i++)

{

if (number%i == 0)

{

c=1;

break;

}

}

if(c==0)

{

System.out.print(number + " ");

count++;

}

number++;

}//end of while

} //end of main

} //end of class

What skills do you need for an IT job?

The most accessible skill one needs in order to get a career in technical services is the ability to produce products using multiple programming languages. The most common language you would need is Java, well other customers will ask for graduates with C#, NET, and open source knowledge.

What advantages do a wireless network have over a dial-up network?

A wireless network usually refers to a Local Area Network (LAN), for example all of the computers in your home. A dial-up network usually refers to the method in which you connect to the Internet through your Internet Service Provider (ISP).

An example using both would be that you have a wireless router at home that connects to a dial-up modem, which allows all of your home computers to share a single Internet connection.

How HTML language differ from programming language?

While markup is only used to do markup (strangely enough), to mark elements as headings, text, images, anchors or whatever. Programming or scripting languages are used to do calculations or different task that basically can make stuff happen.

What takes care of the interaction between a program and a computer's hardware freeing application programmers from the task of including such functions in their programs?

OS or Operating System.

I feel that this question is too specific to be of help to people.

1. What function does an Operation System have besides hardware abstraction?

2. Is the Graphical User Interface part of the OS or not?

3. Anyone else have more questions or ways to elaberate?