answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

What is a FIFO array?

It means that elements are fetched from the array in the same order they arrive - first in, first out (FIFO). Also called a queue.

It means that elements are fetched from the array in the same order they arrive - first in, first out (FIFO). Also called a queue.

It means that elements are fetched from the array in the same order they arrive - first in, first out (FIFO). Also called a queue.

It means that elements are fetched from the array in the same order they arrive - first in, first out (FIFO). Also called a queue.

What is pacing program?

A company initiated project that focuses on a few products and technologies that might lead to rapid marketplace winners.

Who is Nicolas wirth?

Niklaus Emil Wirth is a Swisscomputer scientist, best known for designing several programming languages, including Pascal, and for pioneering several classic topics in software engineering.

How do you make a batch file that talks to you?

1. Click on the Start Menu

2. Click on the Run command

3. Type in: cmd

4. Type in: help

This should help you a lot with commands.

Use: help <command> for details on a certain command.

Example: help echo

Use the echo command to make the batch file talk.

Example is:

@echo

echo "This is what they will see"

Make sure to include the ""s.

Why header file called so?

Because it's always first at the head of all c files.

Every high-level computer programming language contains a while statement?

Due to the rather large number of high-level programming languages, it's difficult to say with absolute certainty that they all include a while statement. However, as loopingconstructs are fundamentally made up of goto's and labels, I would be pretty amazed to find one that doesn't at least provide an equivalent, particularly as looping is so common.

It's interesting to note that there are some languages such as Scheme that are focused on purely functional programming. So even though looping can be done, it would most likely accomplish the same task using recursive functions instead.

How do you vertical the taskbar?

Drag it to whichever side of the screen you want it. If it is locked, you have to unlock it before you can move it.

How does unicode relate to ascii?

UNICODE and ASCII are related in that they are both used to exchange information, primarily in the form of text (plain-text as opposed to typography). That is, when we want exchange the character 'A' between systems we do not transmit the entire bitmap for the glyph we simply transmit a character code. Both systems must know what each character code represents and this is achieved through a "code page" which maps individual character codes to their respective glyphs. In this way we minimise the amount of information that needs to be transmitted.

The problem is that different languages use different symbols. The letter 'A' is a Latin symbol which is fairly common to many European languages, however not all languages use the Latin alphabet. In order to cater for every language worldwide we'd need to encode more than 110,000 symbols which would require at least 17 bits per character.

Prior to multi-language support, most information was transmitted in English. To cater for this we needed to encode 26 symbols for the upper case alphabet, 26 for the lower case alphabet, 10 digits, a handful of common punctuation marks such as periods, commas, parenthesis, and so on, plus some common symbols such as %, & and @. Transmitting information to a printer, screen or some other device also required some non-printing control characters, such as carriage return, line feed whitespace, transmission begin/end and so on. Thus the American Standard Code for Information Interchange (ASCII) decided that 128 characters was sufficient to encode the entire Latin alphabet plus control codes using just 7 bits and all systems were standardised to accommodate this encoding. Although most systems today use an 8 bit byte, many older printers and other transmission protocols used just 7 bits to maintain the highest possible rate of throughput. Some even used specialised encodings with fewer bits (and fewer symbols) to speed up transfers even further. Each encoding therefore required its own standard, many of which were defined by ASCII.

To cater for more specialised symbols and to provide support for some foreign languages, an 8 bit extended character set was used, yielding an additional 128 symbols. The first 127 characters in every ASCII code page are always the same, but the extended character set could be switched simply by changing the code page. However, only one code page can be in effect at any one time, so systems were not only limited to 256 characters total, they had to use the same code page to ensure extended character information was correctly decoded.

Today, when we speak of ASCII, we are generally speaking about the ISO/IEC 8859 standard (or code page 8859). The majority of programming languages utilise this standard to define the language's symbols, thus making it possible to transmit the same source code between machines.

UNICODE addresses the limitations of 8-bit ASCII by using more bits per character. A key aspect of UNICODE is that the first 128 characters must always match the 7 bit standard ASCII encodings, regardless of how many bits are employed in the actual encoding. While it would be relatively simple to encode every symbol used by every language using just 17 bits, this limits the ability to expand the number of characters beyond 131,072. More importantly, it is helpful to space the symbols out such that the most-significant bits in the encoding can be used to more easily identify a particular set of symbols. Thus UNICODE uses 32-bits per character, with individual character sets (or code pages) spread throughout the range.

This immediately puts an overhead upon English-based text transmissions because we'd have to transmit four times as many bits as we would with the ASCII equivalent. To get around this, UNICODE introduced variable-width encodings, such that the first 128 characters were encoded using 8 bits, exactly mirroring ASCII when the most significant bit is 0. If the most significant bit were 1, however, this would indicate that the symbol was encoded using anything from 2 to 6 bytes, depending on the state of other high-order bits. Each of these multi-byte encodings is then mapped to a 32-bit UNICODE character.

UTF8 is the most common form of UNICODE in use today because it has no overhead compared to 8 bit standard ASCII and, for most transmissions, has less overhead than 32-bit UNICODE (also known as UTF32). UTF16 uses 16 bits throughout but doesn't cover the complete range of UNICODE encodings.

How can GIGO be avoided?

There are 2 pieces of GIGO:

1. The garbage

2. The process will produce the garbage (regardless if the input is garbage or not!)

Take any one of them out of the equation, you don't have GIGO any more.

What if your company sells twenty five different products you've been ask to write a pseudo code that will display the no of products whose sales are above the average sales value?

First you need to work out the average sales value. For that you need to know the sale price of each of the 25 products and the total number of each product sold. Multiply the sale value by the number sold, then add all 25 totals together. Divide the total value of the sales by the total number of sales to get the average sales value.

From that you can determine which of the 25 product lines have a selling price greater than the average selling price. Then simply add the total number of sales from each of those product lines.

For a simplified example, consider the following five products:

Product #1 #2 #3 #4 #5

Selling price $1.00 $2.00 $1.50 $3.00 $2.50

Quantity sold 50 40 10 1 4

Total $50.00 $80.00 $15.00 $3.00 $10.00

From this we can see the total sales value was $50 + $80 + $15 + $3 + $10 which is £158.00. The quantity total is 50 + 40 + 10 + 1 + 4 which is 105. So the average sales value is $158 / 105 = $1.50

The products with a sales value greater than $1.50 are #2, #4 and #5, with sales of 40, 1 and 4 respectively. Therefore there were 40 + 1 + 4 = 45 sales above the average sales value.

You made a distinction between remote objects and distributed objects What is the difference?

Remote objects are any objects existing on a device on the LAN (WAN if you want to describe all posibile topographies). They may exist on a single node and do a single job (tightly cohesive). Servers can touch these objects, instantiate new objects and use them to preform sub tasks prior to creating and delivering the answer/web page back to the requesting client. They are activated, sent data, and data are retrieved from them as part of their use by devices and process that know about them. Distributed objects may or may not be remote. they may live on client machines. It's less about how other processes interact with them, or where they (the objects) live, than it is about how the objects are deployed. If a firm has a 1000 sales people who go on the road and sell units to customers, a set of new objects may be created by IT or a vendor and then DISTRIBUTED to client machines for disconnected use. (Doing a deal at lunch with a laptop and a sandwhich.)

Flowchart for linear search?

PROGRAM:

//LINEAR SEARCH USING FUNCTIONS

#include

void linear(int [],int,int);

main()

{

int n,i,x,a[10];

printf("\nEnter the limit:");

scanf("%d",&n);

printf("\nEnter the elements:");

for(i=0;i

{

scanf("%d",&a[i]);

}

printf("\nEnter the element to be searched:");

scanf("%d",&x);

linear(a,n,x);

}

void linear(int a[],int n,int x)

{

int i,flag=0;

for(i=0;i

{

if(x==a[i])

{

flag=1;

break;

}

}

if(flag==1)

printf("\nElement %d is in the position %d",a[i],i+1);

else

printf("\nElement is not in the list");

}

How you can validate tha current date in vc?

The current date does not need validation; it can be read directly from the system clock. However, validating a date against the system clock does not guarantee that date is current; it is only current when the system clock is set correctly.

If you input names of students from the user terminated by ZZZ and create a data file GRADES with records of the form test1 test2 test3 will all the test scores show in the file?

This is a tricky one. The tripple 'ZZZ' indicates a location for source data. Start a file named 'Grade' (spead sheet). There are 3 sets of test scores to be logged. In this file all scores should be logged from highest to lowest.

What is the difference between copying a program into the system and installing a program into a system?

In some (not many) cases there is no difference. Installing the program is nothing more than creating a folder in "Program Files", copying the software into that folder and creating a shortcut to the .exe either on your start menu or on the desktop.

For most programs though if you did that it simply wouldn't work.

Most programs that have installation software (usually called setup.exe) go though a more complex process. This involves creating various entries in the windows registry, placing .dlls that are needed somewhere in the windows folder, perhaps creating various drivers in windows folders where they will be needed, creating file associations as well as doing the straightforward copying and shortcut creation mentioned above. If the software requires a license or serial number then there will be a user prompt for that and the result will be encrypted and hidden away somewhere. Furthermore, since exactly how this all works will depend on which operating system you have installed and what your system configfuration is like there will be some code that scans your system and performs the install according to what it finds.

Unfortuantely this means that once something is installed you cannot move it (to a different drive or different computer) with a simple copy and paste. It has to be reinstalled and the whole process repeated.

What is the difference between context switch and process switch?

when ever an interrupt occurs, it saves the context of the program being executed & sets the PC to the starting address of the interrupt handling program. now after servicing the interrupt if the same process is resumed which was being interrupted then we will say a context switch has occurred.

But imagine after servicing the interrupt if a new process is to be executed then some more work is required, that is it has to save some more information from the PCB to keep reference to resume its execution and we say process switch has occurred..!!

How do you explain the Tags BR and HR?

br is a line break, hr is a horizontal rule.


br adds vertical spacing between elements on a page, much like the spacing between to paragraphs of text.


hr adds a horizontal line.


example:

before hr

after hr

What is logical shift?

A logical shift moves bits left or right. After a left shift, the high-order bit is lost while a zero is inserted in the low-order bit. After a right-shift, the low-order bit is lost and a zero inserted in the high-order bit. The left (<<) and right (>>) shift operators are binary operators; the first operand is the value being shifted, the second operand is the number of bit positions to shift. Thus x << y will left shifts all the bits of x by y bit positions.