answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

What are the Examples of data processing systems?

Commercial data processing "involves a large volume of input data, relatively few computational operations, and a large volume of output." Accounting programs are the prototypical examples of data processing applications. Information systems (IS) is the field that studies such organizational computer systems.

What programming language revolutionized the software industry because begi9nning students could learn it easy?

According to the scenario of bangladesh, php and .Net is now the king and java is the grand pa

Advantages of DDA algorithms?

Advantages & disadvantages of DDA:-

  • Faster than the direct use of the line equation and it does not do any floating point multiplication.
  • Floating point Addition is still needed.
  • Precision loss because of rounding off.
  • Pixels drift farther apart if line is relatively larger.

What is the difference between procedural and nonprocedural dml language?

rocedural languages are used in the traditional programming that is based on algorithms or a logical step-by-step process for solving a problem.A procedural programming language provides a programmer a means to define precisely each step in the performance of a task Non-procedural programming languages allow users and professional programmers to specify the results they want without specifying how to solve the problem. examples are FORTRAN,C++,COBOL,ALGOL etc

OR we can put it this way:

Procedural language determines WHAT & HOW a process should be done, Non-procedural language is concerned with the WHAT not the HOW. Non-proc languages are those languages where you specify what conditions the answer should satisfy, but not how to obtain it.

What is object based programming language?

Object-based programming language is a language that supports all the features of object oriented programming features like classes,object,encapsulation ,abstraction,polymorphism etc except inheritence.

Difference between programming language and query language?

In a programming language (such as Basic, C, COBOL, FORTRAN, and so on), you write lines of code that perform one operation after another until the program completes its tasks. The program may execute its lines of code in a linear sequence or loop to repeat some steps or branch to skip others. In any case, when writing a program in a procedural language, the programmer specifies what is to be done and how to do it.

SQL, on the other hand, is a query language in that you tell SQL what you want to do without specifying exactly how to accomplish the task. The DBMS decides the best way to perform the job.

Suppose, for example, that you have a CUSTOMER table, and you want a list of customers that owe you more than $1,000.00. You could tell the DBMS to generate the report with this SQL statement:

SELECT

NAME, ADDRESS, CITY, STATE, ZIP, PHONE_NUMBER,

BALANCE_DUE

FROM

CUSTOMER

WHERE

BALANCE_DUE > 1000.00

If writing a procedural program, you would have to write the control loop that reads each row (record) in the table, decides whether to print the values in the columns (fields), and moves on to the next row until it reaches the end of the table. In SQL, you specify only the data you want to see. The DBMS then examines the database and decides how best to fulfill your request.

What are the attributes of an Object?

In general, an attribute is a property or characteristic. Color, for example, is an attribute of your hair. In using or programming computers, an attribute is a changeable property or characteristic of some component of a program that can be set to different values.

Give the IEEE definition of software engineering?

1. The application of a systematic, disciplined, quantifiable approach to the development, operation and maintenance of software, that is, the application of engineering to software.

2. The study of the approaches as in (1).

What is the logical abstrect base class for a class called CricketPlayer?

A logical abstract base class for a class called CricketPlayer could be Batsman class or Bowlerclass.

What is role of compiler?

It coverts your source code into machine code so the computer can execute it.

What is a assembly plant?

A machine that assembles parts into a product.

Determine the number of clock cycle that it take to process 200 task in a 6 segment pipeline?

Assuming that the pipeline is empty before these 200 instructions and that no branches or other events that necessitate a pipeline flush happen during these 200 instructions, 6 clock cycles to fill the pipeline then 200 clock cycles (total 206 clock cycles). For any branches or other events that necessitate a pipeline flush add another 6 clock cycles to refill the pipeline (if only part of the pipeline flushed this will take fewer clock cycles).

How do you add comments in batch files?

Anytime you wish to create any type of remark in a batch file rem must be added in front of the line. Remarks are often used to skip a line in the batch file or make comments.

What are the advantages and disadvantages of searching in C programming?

If the data is sorted and every element is directly accessible, then you can perform binary search (see built-in function bsearch), otherwise you have to do linear search (which is slower).

What is a macro enabled document?

http://office.microsoft.com/en-us/help/HA100310711033.aspx Macros automate frequently-used tasks; many are created with VBA (Visual Basic for Applications (VBA): A macro-language version of Microsoft Visual Basic that is used to program Microsoft Windows-based applications and is included with several Microsoft programs.) and are written by software developers. However, some macros pose a potential security risk. A person with malicious intent can introduce a destructive macro, in a document or file, which can spread a virus (virus: A computer program or macro that "infects" computer files by inserting copies of itself into those files. When the infected file is loaded into memory, the virus can infect other files. Viruses often have harmful side effects.) on your computer.

How do you declare a stack in c?

# #include

# #include

#

# const int TPILA=5; // TPILA es el valor maximo de elementos

# // que puede tener nuestra pila

#

# class PILA{

# public:

# int mipila[TPILA]; // Crea mi PILA de tamano TPILA

# int apilados; // Numero de objetos en LA PILA

# void reset(); // Vacia LA PILA

# void push(int v); // Agrega Valores en el tope de la PILA

# int pop(); // Retorna y elimina el tope de la PILA

# };

#

# void PILA::reset() // Vacia la PILA

# {

# apilados=0;

# }

#

# //Se Agrega(PUSH) un valor en el tope de la pila

# void PILA::push(int v)

# {

# // Comprueba que haya espacio dentro de la pila

# // para poder agregar el nuevo valor

# if(apilados

# {

# mipila[apilados++]=v;

# }

# }

#

# // Se Elimina (POP) el ultimo valor de la pila

# // y retorna el nuevo tope

# int PILA::pop()

# {

# if(apilados>0)

# {

# cout<<"El valor del tope eliminado era: ";

# // Retorna el valor del tope que fue eliminado

# return(mipila[--apilados]);

# }

# else

# cout<<"No existen datos para eliminar. ERROR ";

# return (0);

# }

#

# main()

# {

# PILA stack;

# stack.reset();

# int opc, i, dato;

# char out;

# do

# {

# do

# {

# clrscr();

# cout<<"El siguiente programa simula el funcionamiento de"<

# cout<<"una pila y es capaz de apilar un max. de 5 Valores"<

# cout<<"numericos enteros, para fines practicos\n\n";

# cout<<"Que operacion desea Realizar\n\n";

# cout<<"1.- Insertar un dato\n";

# cout<<"2.- Borrar un dato\n";

# cout<<"3.- Mostrar pila\n";

# cout<<"4.- Resetear Pila\n";

# cout<<"5.- Salir";

# cout<<"\n\n\nOpcion(1-5): ";

# cin>>opc;

# }

# while(opc>5);

#

# switch(opc)

# {

# case(1):

# if(stack.apilados

# {

# cout<<"dato?: ";

# cin>>dato;

# stack.push(dato);

# }

# else

# cout<<"ERROR! PILA LLENA!";

# cout<<"\n\nSalir?? (S/N): "; cin>>out;

# break;

# case(2):

# cout<

# cout<<"\n\nSalir?? (S/N): "; cin>>out;

# break;

# case(3):

# if(stack.apilados!=0)

# {

# cout<<"Los datos en la pila actualmente son: "<

# for(i=0;i

# { cout<

# }

# else

# cout<<"No existen datos en la pila"<

# cout<<"\n\nSalir?? (S/N): "; cin>>out;

# break;

# case(4):

# stack.reset();

# cout<<"\n\nSalir?? (S/N): "; cin>>out;

# break;

# case(5):

# out='s'; break;

# default:

# out='s'; break;

# }

# }

# while(out=='n' out=='N');

# }

Who is the creator of number zero?

Actually the concept of zero and several other mathematical "discoveries" are already in the Vedas which are scriptures that date back to thousands and thousands of years ago.

What are the disadvantages of function in C?

In comparison to Strawberry Cheesecake, the main disadvantage of a function in C is that you can't eat it.

In comparison to a mature Brandy, the main disadvantage of a function in C is that you can neither smell nor drink it.

In comparison to functions in some, but not many, other programming languages, one limitation of functions in C is that they may not be nested: In C, a function definition cannot contain another function definition.

In comparison to some modern interpreted language, e.g. Python, one limitation of functions in C is that a function cannot generate another function.

What are the disadvantages of an ordinary queue?

A situation will arise when few elements are inserted & then deleting first few items.

Now, if we try to insert an item we get the message "Queue overflow".

i.e., even if memory is available, we can not access these memory locations

How do you use pow function in c?

Either you can use the pre defined function "pow" in the <math.h> header file OR you can make a user defined function to do the same operation.

1.Using the pre defined function in <math.h> :

The function is a of datatype double and accepts only values in double. So, prototype declaration is:

double pow(double x,double y);

Pass the values to the function and it'll return the value of xy. In the calling function it can be declared as:

double power=pow(x,y);

2.USER DEFINED FUNCTION:

double power(double x,int y);

int main()

{

double x,result;

int y;

cout<<"\nEnter the base: "<<;

cin>>x;

cout<<"\nEnter the exponential power: ";

cin>>y;

result=power(x,y);

cout<<"The result of x to the power y is: "<<result;

return 0;

}

double power(double x,int y)

{

for(int i=0;i<=y;i++)

{

x*=x;

}

return x;

}

Why do we overload a constructor?

We overload constructors to give options on how to initialize an object.

Public Person()

{

name=""

age=""

gender=""

}

...if you override

Public Person(String name, int age, String gender)

{

this.name=name

this.age=age

this.gender=gender

}

Now upon coding time, if you need to initialize it with parameters you have two choices:

  1. When an object will be initialized and you don't have to pass values to the parameter, use the constructor without parameters,
  2. and if you need to pass parameters, then use the one with parameters.

Now if you ask me what's the use?

well, since you are creating a class, you are encapsulating. you want as much to limit the use of your internal properties.

e.g.

private name

private birthyear

public Person(String name, Int age)

{

this.name=name

this.birthyear= yearNow-age

}

public Person(String name, Int birthdate)

{

this.name=name

this.birthdate=birthdate

}

You make sure that everytime a Person() is initialized, birthday property has a value either from age or birthdate.

I know the example is absurd but there are lots of complex example for this, I do overloading of constructors most of the time. from creating connection objects, to creating business process objects, since they differ in their needs.

Problem that often occur is code duplication. It's up to you to make a way to minimize/avoid duplication of code. usually I do this

public Person(String name, Int age)

{

Person(name, yearNow-age)

}

public Person(String name, Int birthyear)

{

this.name=name

this.birthyear=birthyear

Person();

}

Hope this gives an idea.

What is the Advantages of bresenham's circle drawing algorithm?

Let (xc,yc) be the centre of the circle

Let r be the radius of the circle

Let d be 3-2*r (d for decision)

Let x be 0

Let y be r

Repeat while x is less than y:

Increment x

If d is less than zero

Let d be d + ( 4 * x ) + 6

Else

Decrement y

Let d be d + (( x - y ) * 4 ) + 10

End if

Plot 8 points:

( xc+x, yc+y )

( xc-x, yc+y )

( xc+x, yc-y )

( xc-x, yc-y )

( xc+y, yc+x )

( xc-y, yc+x )

( xc+y, yc-x )

( xc-y, yc-x )

End repeat

Which programming language should you use?

Depends on what you are trying to program! Games, web applications, mobile phone apps may use different languages. I'm not sure which ones use which as of 11-2009 but you need to determine that first!