answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

How can you freeze the screen during POST so that you can read BIOS information?

yttytytyt

I doubt you can stop it, but you can go to the BIOS setup and look at the settings without changing anything. I think holding the F8 key early in the boot process takes you to the BIOS setup.

Or you could try taking a picture or video of it.

What is the purpose of cobol?

COBOL is still used in a number of legacy applications such as finance and manufacturing industries as it is purposely designed to be fit for business application. A number of recent developments have brought web front ends to Cobol which is likely to extend the life of Cobol even further.

What is the stack algorithm to push an item?

Stack Data Structure
1.It is a Linear Data Structure.


2.In which a data item is inserted & deleted at one end.


3.It is a Last In - First Out (LIFO) Data Structure where the data item is inserted last into the stack is the first data item to be deleted from the stack.
NOTE:


Please refer to http://www.cosc.canterbury.ac.nz/mukundan/dsal/StackAppl.html site to understand the concept of stack using java applet.


Just Copy & Paste it in your browser,but you need a Java RunTime Environment(JRE) installed onto your PC.
4.Writting a value to stack is push operation.


5.Reading a value from the stack is pop operation.


6.Once an item is popped from the stack,it is no longer available.
Algorithm
1.push operation:
if top of the stack is greater than equal to maximum number of entries into the stack,
then print "Stack is already full.Cannot add more items."
top of stack = t
increment the top of the stack


2.pop operation:
decrement top of the stack
if top <0,then print "Stack is already empty.Noitems to read."


3.call these push & pop functions declared void in the main function using the switch statement.


4.The variable top & symbolic constant stack maximum items entry number has to be declared.


What does int A mean in c language?

It is easy to tell with function printf:

int unknown_value;

...

printf ("unknown value is %d\n", unknown_value);

Note: the typical value-range for type integer is -32768..32767 (16 bits), or -2147483648..2147483647 (32 bits).

What is the most common computer programming language?

You may want to take a look at the Tiobe index, which tries to track the tendencies in the use of different programming language. The top languages - according to this index - are currently (as of December 2013) C, Java, Objective-C, C++, C#, PHP, (Visual) Basic, Python, Transact-SQL, JavaScript. And lots of others; take a look at the Index for more information.

What is the difference between inlinefunction and function overloading?

The normal way a function works is that whenever your code encounters a call to the function, it jumps to the body of the function code. An inline function tells the compiler that it should actually copy over the code from a function body into all places where that function is called. In some cases this can cause a dramatic reduction in run time, but in others it causes nothing more than increasing the size of the produced executable.

Function overloading refers to the ability to have multiple functions with the same name, but different parameter types.

What programming language is used to develop facebook?

Different languages like Java, Python, PHP, C++ and Ruby building its stack that allows to all languages stated to interoperate.

How do you find in java the sum of the first and last digit of 3 digit number?

String num = Integer.toString(12345); // Insert your Integer here.

int sum = 0;

for(int i = 0; i < num.length(); i++){

sum += Character.digit(num.charAt(i), 10);

}

System.out.println(sum); // Simply prints the sum of the digits to standard out.

///// ALTERNATE SOLUTION:

int num = 12345; // Insert your Integer here.

int sum = 0;

while (num > 0){

sum += num % 10;

num /= 10;

}

System.out.println(sum); // Simply prints the sum of the digits to standard out.

How did bill gates come up with the idea for Microsoft?

Bill Gates actually did create those things. it was created as a way to compete with Apple and Netscape, respectively.

What do you need to start programming using pascal?

Three simple steps: (1) buy or rent a boook about Pascal, (2) read book and follow the exercised provided in book, (3) write program in Pascal. Honestly. A programming language is in many ways as complex as a human language; there is no simple answer to "how does one speak French, or Spanish, or Pascal, or C++" However, in all those cases, an abundance of books is available. Since they all vary not just in quality, but also with regards to the expectation to your background knowledge, its typicaly best to go into a bookstore and compare a few.

Differce between linker and loader?

#)Linker is a program that takes one or more objects generated by a compiler and combines them into a single executable program.

#)Loader is the part of an operating system that is responsible for loading programs from executables (i.e., executable files) into memory, preparing them for execution and then executing them.

What is the need of two pass assembler?

#include<stdio.h>

#include<conio.h>

#include<string.h>

struct symbol

{

char sn[35];

int add;

}s[35];

void main()

{

int symerr=0,oper=0,i=1,j=1,lc,k,sa,p1,f,op,l,q,d,x=1;

char opcode[50],lb[25],operand[25];

char optab[10][10]={"LDA","LDB","STA","ADD","COMP","J","JEQ","SUB","STA"};

char value[10][10]={"00","b8","0c","18","28","3C","30","lc","14","78"};

FILE *fp1,*fp2;

clrscr();

fp1=fopen("input1.txt","r");

fp2=fopen("inter.txt","w");

fscanf(fp1,"%s %s",&lb,&opcode);

if(strcmp(opcode,"START")==0)

{

fscanf(fp1,"%d",&lc);

sa=lc;

fprintf(fp2,"%d\t %s\t %s\t %d\n",lc,lb,opcode,lc);

fscanf(fp1,"%s %s",&lb,&opcode);

}

while(!feof(fp1))

{

d=lc;

if(strcmp(".",lb)!=0)

{

if(strcmp("-",lb)!=0)

{

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

{

if(strcmp(s[i].sn,lb)==0)

symerr=1;

break;

}

if(symerr==0)

{

strcpy(s[j].sn,lb);

s[j].add=lc;

j++;

}

}

for(k=0;k<10;k++)

for(l=0;l<10;l++)

if(optab[k][l]==opcode)

{

fscanf(fp1,"%s",&operand);

lc=lc+3;

x=0;

}

if(strcmp(opcode,"RESW")==0)

{

fscanf(fp1,"%s",&operand);

op=atoi(operand);

lc=lc+(op*3);

}

else if(strcmp(opcode,"RESB")==0)

{

fscanf(fp1,"%s",&operand);

op=atoi(operand);

lc=lc+op;

}

else if(strcmp(opcode,"BYTE")==0)

{

fscanf(fp1,"%s",&operand);

f=strlen(operand);

lc=lc+(f-3);

}

else if(strcmp(opcode,"WORD")==0)

{

fscanf(fp1,"%s",&operand);

lc=lc+3;

}

else

{

if(x==1)

{

fscanf(fp1,"%s",operand);

lc=lc+3;

}

}

}

fprintf(fp2,"\n%d\t%s\t%s\t%s\n",d,lb,opcode,operand);

if(symerr==1)

fprintf(fp2,"\n**DUPLICATE SYMBOL**\n");

if(oper==1)

fprintf(fp2,"\n**INVALID OPERATION CODE**\n");

fscanf(fp1,"%s\t%s",&lb,&opcode);

symerr=0;

oper=0;

}

p1=lc-sa;

fprintf(fp2,"\nThe program length is %d",p1);

printf("\n symbol table\tlabeL address\n");

for(q=1;q<j;q++)

printf("\n%s\t%d",s[q].sn,s[q].add);

fcloseall();

getch();

}

What are the difficulties in writing programs in machine language?

Machine language is error prone simply because it is so difficult to write programs using nothing more than binary notation. Every instruction, every register and every memory address has to be converted to binary. Just one bit out of place would render the code invalid. Trying to find one errant bit amongst many millions is no easy task.

Of course we don't actually use binary (base-2) to write machine code. Any base that is itself a power of 2 will do. Binary is 2^1 while 2^2 is base-4, 2^3 is base-8 (octal) and 2^4 is base-16 (hexadecimal). The advantage of using these higher bases is that instead of entering machine code one bit at a time, we can enter a group of bits using just one symbol. If we divide binary data into groups of 2 bits, then there can be only 4 possible combinations (00, 01, 10 and 11). Base-4 only has 4 possible digits (0, 1, 2 and 3) so it is trivial to map each group of 2 bits to just one base-4 digit. If we divide binary data into groups of 3 bits then there would be 8 possible combinations, each of which can be represented by just one octal digit. And if we divide into groups of 4 bits we get 16 possible combinations each of which can be represented with just one hexadecimal digit. A byte is usually 8 bits long, so if one hexadecimal digit represents half a byte (a nybble) then two hexadecimal digits represent a full byte.

Converting from hexadecimal to binary is so trivial that we can easily write a simple machine code program to perform the conversion for us. This reduces the chances of making errors during input by a factor of 4. However, reducing the chances of error doesn't eliminate errors. Programmer's are only human and if a programmer can make mistakes using a high-level language, then the odds of making a mistake in low-level machine code is greatly multiplied. No matter how much time you spend designing, one mistake is all it takes. And if a mistake is made, finding it is easier said than done.

To reduce the chances of mistake even further, it is best to steer clear of machine code altogether and use assembly language. Assembly language is a symbolic language, so just as binary values can be symbolised through hexadecimal notation, operation codes can be symbolised through easy-to-remember mnemonics. That is, instead of having to remember that code 80 moves a memory address into a register and that 81 moves a register value to that memory address, we need only remember that MOV does both and will translate to the appropriate instruction according to the operands we provide. Assembly language also allows us to use any notion that is most convenient, including decimal, octal, hexadecimal or even binary itself. Every register has a unique identifier and we can also give static, global and constant data user-defined names, so we don't need to keep track of every memory address. We can also insert comments!

Although assembly language is not machine code, the translation from assembly language to machine code is virtually 1:1, there is very little in the way of abstraction. We still won't eliminate programming errors, but at least we have a fighting chance of locating them and ultimately fixing them.

Writing machine code programs in assembly is nonetheless a laborious process. So much so that machine code programmers often prefer to use high-level languages like C and C++ to do the bulk of the work to generate the assembly language which they can then tweak further by hand where necessary. However, C++ in particular produces such good machine code by itself that programmers rarely need to "bang the metal". Indeed, many of the optimisations utilised by the C++ compiler came from the tricks of the trade used by machine code programmers themselves. As a result, C++ can often produce machine code that surpasses anything that can be produced by hand -- but even when it can't, tweaking machine code is so much easier when you don't have to write every single bit from scratch.

What are the difference between greedy algorithm and dynamic programing?

A greedy algorithm is similar to a dynamic programming algorithm, but the difference is that solutions to the subproblems do not have to be known at each stage; instead a "greedy" choice can be made of what looks best for the moment.

Can you declare a variable in different scopes with different data types elaborate with examples?

Yes. Because a variable of the more local scope is what is used instead of any other variables with that name, the data types of the other variables that use that name are irrelevant.

It is, however bad practice to do this because it is confusing and often leads to unintentional function behaviour (particularly in weakly typed languages). If the variable in question is meant to be used in different functions and with a different purpose, there is probably no need to give it the same name as another.

What is the cost of a shopping cart?

Shopping carts are a broad range of technologies that enable visitors to a website to buy goods and services. As can be expected of any general technology the cost varies from vendor to vendor, and from installation to installation.

Open Source Shopping Carts

There are several free, open source shopping carts osCommerce and Zen Cart are two of the most popular, although the Community Edition of Magento has recently increased market share considerably.

These shopping carts cost nothing to download and install.

Commercial Shopping Carts

Interspire Shopping cart is available from $295.00, Cube Cart starter edition is $129.00. X-Cart is available from $115.00

Hosted Shopping CartsBig Commerce, Shopify and Volusion are the three most popular hosted shopping carts and all start there pricing at $24.95 per month. Custom and Enterprise Shopping CartsThere are no set prices for custom and most enterprise shopping carts as the price is a reflection of the features and support required but anything form several thousand to several hundred thousand dollars

How you can delete a column from the table?

Can you be more specific? What kind of table do you mean, and what program are you using? A SQL statement like this will do it: alter table tblName drop column colName tblName is the name of the table colName is the name of the column

When shall you use Multiple Inheritance?

Multiple inheritance is used when a new class to be formed has to inherit characteristics from two or more classes. eg: class scientist class labourer | | | | V V -------------------------------- | class employee | -------------------------------- Multilevel inheritance is used if a derived class inherits characteristics from a base class which is a derived class (intermmediate base class). If the inheritance level is more than two then it is a multilevel inheritance. eg: class Grandfather | | V class Father | | V class son

Distinguish between the Classes and Objects?

A Class is a template from which Objects are created, in much the same way as a plan of a building is a template from which a building is created... just as the building plan is a piece of paper and not a building, so a Class is not an Object.

The code for a Class describes the way in which an Object should behave when particular methods are invoked.

Why do abstract class can not be inherited?

An abstract class is designed to provide function and organization to subclasses without ever existing as an object itself. In other words, it is a glorified template, an abstraction for subclasses, and would be illogical to instantiate.

As an example, imagine that a zoo wanted to make separate classes representing each of its animals, but wanted them to all have some common features like a variable for life expectancy or a method to project feeding costs. To force every class to implement this functionality, the programmer may create an abstract class called Animal that each subclass would extend. However, would it ever make sense to create an Animal? No, because an Animal does not exist anywhere in the zoo - an Alligator however might.

What is after peta byte?

A petabyte is either 1 000 000 000 000 000 bytes
or 1024 x 1024 x 1024 x 1024 x 1024 bytes.

It is the next in the series kilobyte, megabyte, gigabyte, terabyte, petabyte, ...

peta means 1015 but in computing 1000 and 1024 sometimes get interchanged.

What are the applications of gray code?

Gray code is useful because only one bit changes at a time. When used as encoders for a position sensor, for instance, if the sensor were right at the edge of a change boundary, there is uncertainty as to position. Binary code would introduce variable uncertainty in position, because more than one bit can change at a time, but gray code would reduce that uncertainty to being only one bit position in size.

What is full form of 3GL?

GL acronym stands for the 3rd Generation language like C, C++, Java, etc