answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Who were involved in the bracero program?

the docotors and the facial expert called cynthia rowland

How do you make binary to decimal converter in G W BASIC?

First of all we will talk about how binary number are converted back into decimal representation and later we will have program.

Here is the formula of this transformation:

Binary number: a3a2a1a0

Decimal number a x 23 + a x 22 + a x 21 + a x 20

Example:

Binary: 1101

Decimal: 1 x 23 + 1 x 22 + 0 x 21 + 1 x 20 = 8 + 4 + 0 + 1 = 13

And here we have our program:

#include

#include

#include

int main() {

char str[100];

int ind;

int sum = 0;

printf("Please enter binary number: ");

scanf("%s", str);

for(ind = 0; ind < strlen(str); ind++) {

sum += (str[ind] - 0x30) * pow(2, strlen(str) - ind - 1);

}

printf("Number in decimal would be %d\n", sum);

return 0;

}

Testing:

Please enter binary number: 1101

Number in decimal would be 13

Please enter binary number: 10000001

Number in decimal would be 129

Please enter binary number: 11111111

Number in decimal would be 255

Please enter binary number: 0

Number in decimal would be 0

Differentiation between web based and non web based?

First of all, the terminology is incorrect. There are web based applications and "computer" based applications, the latter of which operate from the computer, not from a browser.

These two are significantly different. The rudimentary difference comes from where the programs are run from. Web-based programs are run through a web browser or an equivalent program. Computer-based applications are run through the OS(Operating System), (Windows, Linux, or Mac OS X).

Each of these programs has their own pro's and con's. Web-based applications are nice because the user does not have to download or install anything before using them. They are able to be used from the browser. This also means that they can be used from many different computers while accessing the same program. For example, Google Docs is a web-based Office suite that a person could access from any computer and work with their files. On the flip side, web-based applications can be slow to load, or if the server goes down the user could be out of luck.

OS based applications can be good. They are run straight from the OS, which generally improves the speed at which they run. However, they can only be accessed from that particular computer, which could be an issue if something happens to the computer.

The arguments in an IF function are?

IF, in C and C++, is not a function - it is a statement. There are two parameters...

if (expression) statement;

The expression is evaluated. If it has logical result true, or arithmentic result not zero, the statement is executed; if not, the statement is not executed. The statement can be a single statement, in which it is terminated with a semi-colon, or it can be a block of statements, in which it is surrounded by braces.

Is shareware software an open source software?

Copyright protection is intended to provide protection against theft of intellectual property. Free and Open Source Software (FOSS) generally specifies that the source code must be distributed with any binary build and that the full original license must remain affixed to the source code. In this case, it means that the author is asking that others do not plagiarize the work or claim it as one's own.

It also generally specifies that the code may only be used for certain purposes, such as non-commercial use. Some projects are dual-licensed with a commerical license for reselling/incorporation into commercial applications. Violations of any of the terms in the license may constitute a violation of copyright protection, and infringements may be prosecuted. This is still relatively new and mostly untried in the area of law, and few courts have had any cases involving FOSS copyright infringements.

A few recent cases have suggested that courts are willing to entertain at least GPLv2-type licenses, and possibly others. Damages have apparently been awarded in at least one case regarding GPLv2 infringements. In other words, FOSS is quickly gaining legal status as a viable copyright protection license. It is therefore important to read the license of any software one intends to modify and/or redistribute to ensure that they are not in violation and risking infringement lawsuits.

What is the advantages of computer application in business?

Computer applications make it easier for employees to carry out the functions of their jobs. With software, the business can input data quicker instead of creating templates each time.

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.