answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

What are the common features of computer programs?

Accuracy, maintenance, efficiency, reliability, portability, readable, performance, storage savings.

Application of linked list?

what are the main applications of double linked list?

1. Applications that have an MRU list (a linked list of file names)

2. The cache in your browser that allows you to hit the BACK button (a linked list of URLs)

3. Undo functionality in Photoshop or Word (a linked list of state)

4. A stack, hash table, and binary tree can be implemented using a doubly linked list.

5. A great way to represent a deck of cards in a game.

What is the difference between stack and queues?

A queue is a first-in-first-out (FIFO) data structure, while a stack is a first-in-last-out (FILO) data structure.

Think of a queue as a line to get on a ride at a theme park, you get on the ride in the order than you joined the line.

Think of a stack as a pile of heavy objects stacked on top of each other, new objects get put on top of the pile, and when you take objects off of the pile you must take off the one that is currently on top, which is also the one you most recently added. The first object placed on the stack is at the bottom and will be the last one removed.

How do you work out binary codes?

In binary code there are only two possible characters: 1 and 0. These two characters are basically yes and no. 1 means true, and 0 means false.

Every letter or number is represented by 8 digits, also known as 8 bits. For example, the number 23 in binary code would be 00010111, 8 digits/bits. Each digit is a bit.

Once you understand that, you can move on to reading binary code.

Each of the 8 bits have a value. The rightmost number always represents 1. The next number on the left represents 2. The next number is 4. Next number is 8. In case you didn't notice, the value keeps multiplying by 2. Here is what each number represents:

0128 064 132 016 18 04 12 01

Where there is a 0 it means to ignore that value. However, wherever there is a 1, you must add that value to the total.

So, for the binary number above, you find where the 1s are, and then you add them together.

There is a 1 at 32, 8, and 2. This means you add 32, 8, and 2 together, and get 42.

Thus, 00011010 represents 26. 26 is a decimalcharacter.

The more commonly used text format is ASCII, which is just normal text and symbols like "$#@%(".

Decimal characters are numbers. To convert binary code to ASCII, you must first convert it to decimal, like we did above. Now that we have 42, we must find out what it is in ASCII.

The decimal numbers 65-90 represent upper-case, where "A" is 65, "B" is 66, so on.

The decimal numbers 97-120 represent lower-case a-z, where "a" is 97, "b" is 98, etc.

42 is not 65-90 or 97-120. This means it is a symbol/special character. To find what a certain symbol is in decimal, then you need to to search the web. 42 is a *.

An easier way to do this, is that if the binary number starts with 011, then you know that this is a lower-case letter. If t it starts with 010, that means it is an upper-case letter. After reading these first three digits, you just determine the other 5 digits separately, and whatever number you get for the 5 digits, is the place in the alphabet that the letter is. For example, if the 5 digits added up to 4, the letter would be d.

Try decoding the message below. The 00100000 is a space.

01001110 01101001 01100011 01100101

00100000

01001010 01101111 01100010

Hopefully, now you understand reading binary code. Finally, this is how to write binary code.

If you are writing a number, then do the following:______________________________________

We'll use 57 as an example here. Starting at the leftmost digit in the binary number, check if your number is equal to or greater than the value that this digit represents. If this is the 8th digit from the right, it represents 128. If your number is greater or equal to it, then you put a 1 and subtract the value from your number. Otherwise you put a 0. Then you go to the next number and do the same. Keep repeating until your number is subtracted to 0.

57 is not greater than 128, so we put a 0 here and go to the next digit, which would represent 64.

57 is not greater than 64, so we put a 0 again and go to the the next digit, representing 32.

57 is greater than 32, so we put a 1 here and subtract 32 from 57 which is 25. Next digit, 16.

25 is greater than 16, so we put a 1. Then 25 - 16 = 9. Next digit is 8.

9 is greater than 8, so we put a 1. 9 - 8 = 1. Next digit is 4.

1 is not greater than 4. Put 0. Next digit, 2.

1 is not greater than 2. Put 0. Next digit, 1.

1 is equal to 1 so we subtract one and now we have 0. Put a 1.

In the end, we get 00111001.______________________________________

For a letter it's almost the same thing:

If it is an upper-case letter, then you start with 010. If it is lowercase, then start with 011.

Then you just determine the other 5 digits based on the position of the letter in the alphabet. These 5 digits would represent 16, 8, 4, 2, and 1.

There is no 128, 64, and 32 because those 3 values were in the first 3 digits, which we eliminated.

If the letter was "a", which is the 1st letter in the alphabet and a vowel, then we would start with 011. Then we would keep comparing 1 with values and putting 0s, until we got to the last digit, and finally put a 1. The result would be 01100001.

______________________________________

I hope I helped. Good luck.

What is language translation in programming language?

This is usually the first stage in compilation. The source code is read and checked for syntax and usability then passed to the compile stage to be converted to object (or machine) code that the computer can understand.

Translator translates program written in one programming language into (equivalent) program written in another language. For example, Java to C# translator would translate Java program into (equivalent) C# program. This is similar to as if you would translate some text in English into Spanish or vice versa.

If target language is lower level language like assembly language, machine language, or pseudocode, translator is called compiler. For example, some C++ compiler could compile (translate) program in C++ into machine code.

What part of the computer is responsible for executing instructions tp process information?

The central processing unit (CPU). The CPU is typically composed of one or more processors with one or more processing cores. For example, a quad core CPU typically has two independent processors with two cores each.

What is the computer language for business and scientific purposes?

Scientists use a variety of languages, depending on what they need their computer program to do. Each individual programming language has its own benefits and drawbacks, and scientists who need to write a program will choose the language most suited to their needs.

Which device is used to convert analog signals to digital signals?

In datacommunications this is a modulator/demodulator, commonly known as a modem.

In electronics a digital to analog converter (DAC) chip is used to convert digital signals to analog and an analog to digital converter (ADC) chip to convert analog signals to digital. Some chips are available which include both ADC and DAC functionality.

There are thousands of different types of DAC and ADC sytems and which one to use largely depends on how fast you want to do the conversion.

What are the use of socket API?

The socket API is an Interprocess Communications (IPC) programming interface;Originally provided as part of the Berkeley UNIX operating system (1980);It is a de facto standard for programming IPC;Adopted by many modern operating systems, e.g. Sun Solaris and Windows systems;Underlying service for sophisticated IPC, e.g. RPC, RMI, CORBA, Web Services, etc.

A socket API provides a programming construct termed a socket;A process wishing to communicate with another process must create an instance, or instantiate, such a construct;The two processes then issues operations provided by the API to send and receive data Also in case of Java, Datagram sockets can support both connectionless and connection-oriented communication at the application layer. This is so because even though datagrams are sent or received without the notion of connections at the transport layer, the runtime support of the socket API can create and maintain logical connections for datagrams exchanged between two processes, as you will see in the next section.

How many different combinations are available with an 8 bit system?

One bit is either a zero - 0, or a one - 1. Eight bits equal one byte. And one character is exactly one BYTE. So the letter A must be converted to a specific, universally recognized number (called ASCII) and then translated to binary code - 0s and 1s. So one 8-bit code equals one character.

What is the difference of modular programming and modular programming?

The strength of modular programming lies in the modular approach. Each module holds logically grouped code (functions, procedures, variables, constant data), typically grouped by functionality.

For instance, one module might provide tools to retrieve application-specific data from and store such data in a database, another module might provide visualization primitives, a third might provide an application-specific data structure and related management functions, etc.

As each module is developed, it is tested as a single unit. The idea is to perfect this module, and never to touch it again while the remaining modules are being developed and tested in a similar manner, then put together ("integrated") to form the application.

While the goal of never touching a module, once initially tested, is rarely met in real life terms, modular programming provides a structured approach to application design and helps in producing quality software. A modular design also helps when working in a team, as the modules' boundaries often are natural dividing lines along which the work can be divided between different members of the team.

What is meta gaming?

Meta-gaming is a term used in Role Play games. In most role play games there is in character chat (IC) and out of character chat(OOC), Meta-gaming is using Out of Character knowledge, in character chat. Here's an example of meta gaming, In character chat: "your mom" "log on to your alt" "I have to go wash the dishes brb." "How old are you irl"

All of these sentences are Meta-gaming. Even using of the words "lol" "lmao" Etc.... are typically Out of Character Chat, cause you wouldn't typically say "lol" or "lmao" In real life. Make the game fun for everyone else, don't meta game.

What is pass in compiler design?

There are two types of compilers one-pass and multi-pass. Pass means that some of inner operations are repeated several times.

If we have one-pass compiler and this source code:

i++;

i++;

i++;

Inside compiler it would generate:

i = i + 1;

i = i + 1;

i = i + 1;

If compiler would be two-pass:

i = i + 3;

The more passes compiler has, the better optimized code it can generate, but it is slower because it must repeat some steps again.

How do you run applet program?

By Embedding it into a HTML page, create a new file with the extension .html (like app.html) insert following code: No Java 2 SDK, Standard Edition v 1.4.2 support for APPLET!! Adjust the code for your applet file (can't help there i am not a java programmer) or just use : No Java 2 SDK, Standard Edition v 1.4.2 support for APPLET!! but i recommend the first because the applet tag is deprecated and not supported in XHTML

How do you find the time complexity of a given algorithm?

Time complexity gives an indication of the time an algorithm will complete its task. However, it is merely an indication; two algorithms with the same time complexity won't necessarily take the same amount of time to complete. For instance, comparing two primitive values is a constant-time operation. Swapping those values is also a constant-time operation, however a swap requires more individual operations than a comparison does, so a swap will take longer even though the time complexity is exactly the same.

What is the difference between extended binary tree and a binary search tree?

A strictly binary tree is one where every node other than the leaves has exactly 2 child nodes. Such trees are also known as 2-trees or full binary trees.

An extended binary tree is a tree that has been transformed into a full binary tree. This transformation is achieved by inserting special "external" nodes such that every "internal" node has exactly two children.

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.