answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Is COBOL a compiler programming language?

COBOL, the COmmon Business Oriented Language, is considered one of the forerunners of modern programming. Designed in the 1950s, it was considered the most advanced language of its time. It was commonly programmed on punch cards, which were in common use before disk storage as an input medium for stored procedures. It also had constructs considered revolutionary at that time, including self-modifying code.

Explain the Information Processing Cycle of a computer?

= What is information processing cycle? = In: Computer Terminology [Edit categories]

[Edit]

Information processing cycle of computer can be well described by the following points: (1) input, (2) processing, (3) output and (4) storage # Input-entering data into the computer. # Processing-performing operations on the data. # Output-presenting the results. # Storage-saving data, programs, or output for future use.

1. INPUTThe collection of raw data from the outside world so it can be put into an information system. Putting the acquired data into the information system. # Examples: The payroll clerk collects workers' timecards so she knows how many hours each person worked that week and types the hours from the timecards into a spreadsheet # Conducting a survey of customer's opinions and then scanning the survey cards with a card reader. # Collecting jokes for a joke book and typing jokes into a word processor. # Using a form on a website to collect visitors' opinions

Typical input devices: Keyboards, mice, flatbed scanners, bar code readers, joysticks, digital data tablets (for graphic drawing), electronic cash registers

2. PROCESSING CPU Processor - Central ProcessingUnit A central processing unit (CPU), or sometimes simply processor, is the key component in a digital computer capable of executing a program. It interprets computer program instructions and processes data. CPUs provide the fundamental digital computer trait of programmability, and are one of the necessary components found in computers of any era, along with memory and input/output facilities. A CPU that is manufactured as a single integrated circuit is usually known as a microprocessor. Beginning in the mid-1970s, microprocessors of ever-increasing complexity and power gradually supplanted other designs, and today the term "CPU" is usually applied to some type of microprocessor. Microprocessor (CPU)

Integrated circuit, also called a chip. The Brain of the computer

Composed of: ALU: Arithmetic Logic Unit: Processor Controller High speed calculator

Intel is the most popular chip

Categorized by model numbers

Higher model number=newer/faster chip

Speed of CPU is determined by clock speed

Higher the clock speed, faster the computer

Speed is measured in megahertz (MHz) Megahertz: Clock Speed of the processor (100 MHz = 100 million cycles/second). Memory or RAM Next most critical element of a processing hardware is RAM, often referred to as "primary storage" or "main memory". Random Access Memory (RAM) receives and temporarily stores data and program instructions from the CPU This data bank communicates with the CPU, constantly exchanging information and constantly changing as long as the computer is on

RAM is an active, electronic state. When the power is on, RAM retains data. When the computer is turned off, all data in RAM is erased unless you have saved it to some mass storage device. Each time the computer boots, the computer goes through it's startup routine and lastly loads operating system instructions into RAM

Random Access Memory (RAM) is the workhorse behind the performance of your computer. Working as a foot soldier for your processor, RAM temporarily stores information from your operating system, applications, and data in current use. This gives your processor easy access to the critical information that makes your programs run. The amount of RAM you have determines how many programs can be executed at one time and how much data can be readily available to a program. It also determines how quickly your applications perform and how many applications you can easily toggle between at one time. Simply put, the more RAM you have, the more programs you can run smoothly and simultaneously. To determine how much RAM you need, factor in the demands of the applications you want to run simultaneously as well as the operating system (512 MB of RAM is recommended by Microsoft as minimum for operation of Windows) Then keep in mind that you'll inevitably add new applications and create new files, and add accordingly. RAM: (Random Access Memory): (Click here to read "How Stuff Works - RAM") Types of RAM * DRAM (Dynamic RAM) This is the most common type of computer memory. DRAM needs refreshing and is refreshed hundreds of times each second in order to retain data. During recharging it cannot be accessed by the CPS * SRAM (Static RAM) SRAM is approximately 5 times faster (and twice as expensive, as DRAM). It does not have to be constantly refreshed. Because of its lower cost and smaller size, DRAM is preferred for the main memory, while SRAM is used primarily for cache memory. * SDRAM (synchronous dynamic RAM) is the standard memory offering in the PC industry and is faster than DRAM because it's synchronized to the system clock. . It is designed for mainstream home and business applications, email, and basic audio and video streaming. It provides single-channel memory and is available on our mainstream and value desktop system. * DDR SDRAM (double data rate synchronous dynamic RAM) takes all the features of ordinary SDRAM and increases the frequency bandwidth to improve system performance and speed. * RDRAM (Rambus dynamic RAM) is able to load a new stream of data before the previous stream has completed, resulting in faster access speeds. The RDRAM memory features dual-channel processing which doubles data throughput to further enhance performance. This type of memory is optimized for high-end multimedia tasks involving video and audio. Dual Channel RDRAM is shipped on our performance desktop systems powered by Pentium 4 processors * VRAM: Memory designed for storing the image to be displayed. * CACHE RAM is a small block of high-speed memory located between the Processor and main memory and is used to store frequently requested data and instructions. When the processor requests data, it will check in the cache first

Understanding the relationship between CPU and RAM The hierarchical arrangement of memory storage in current computer architectures is called the memory hierarchy. It is designed to take advantage of memory locality in computer programs. Each level of the hierarchy is of higher speed and lower latency, and is of smaller size, than lower levels. The memory hierarchy in most computers is as follows: * Processor registers - fastest possible access (usually 1 CPU cycle), only hundreds of bytes in size * Level 1 (L1) cache - often accessed in just a few cycles, usually tens of kilobytes * Level 2 (L2) cache - higher latency than L1 by 2× to 10×, often 512 KiB or more * Level 3 (L3) cache - higher latency than L2, often several MB * Main memory (DRAM) - may take hundreds of cycles, but can be multiple gigabytes. Access times may not be uniform.

3. Output In information processing, output is the process of transmitting the processing information Essentially, output is the presentation of any data exiting a computer system. This could be in the form of printed paper, audio, video. In the medical industry this might include CT scans or x-rays. Typically in computing, data is entered through various forms (input) into a computer, the data is often manipulated, and then information is presented to a human (output). Typical output devices: Monitors* Pixels: Images are created with dots of lights called picture elements, or pixels. More pixels = higher resolution. Resolution is the maximum number of pixels the monitor can display * Basic VGA is a pixel grid 640 X 480 * Super VGA is 1,024 X 768 * A video card, (also referred to as a graphics accelerator card, display adapter, graphics card, and numerous other terms), is an item of personal computerhardware whose function is to generate and output images to a display. Printers * Laser - laser beams bond toner to paper * Ink jet - fine stream of ink * Dot Matrix - pins & ribbon What else can you think of?

4. Storage Storage, or mass storage refers to various techniques and devices for storing large amounts of data. The earliest storage devices were punched paper cards, which were used as early as 1804 to control silk-weaving looms. Modern mass storage devices include all types of disk drives and tape drives. Mass storage is distinct from memory, which refers to temporary storage areas within the computer. Unlike RAM memory, mass storage devices retain data even when the computer is turned off. The smallest unit of storage is a file that contains such data as a resume, letter, budget, images or any one of the thousands of items that you may have saved for future reference. Additionally, files can be executable program files, or system files reserved for the operating system. Mass storage is measured in kilobytes (1,024 bytes), megabytes (1,024 kilobytes), gigabytes (1,024 megabytes) and terabytes (1,024 gigabytes). Examples of some mass storage devices * Disk storage - hundreds of thousands of cycles latency, but very large ** Floppy Disks: Relatively slow and have a small capacity, but they are portable, inexpensive, and universal ** Hard disks : Very fast and with more capacity than floppy disks, but also more expensive. Some hard disk systems are portable (removable cartridges), but most are not. * Tertiary storage - ** Optical storage: Unlike floppy and hard disks, which use electromagnetism to encode data, optical disk systems use a laser to read and write data. Optical disks have very large storage capacity, but they are not as fast as hard disks. Examples: CD, CD-R, CD-RW, DVD or DVD-R ** Tapes: Relatively inexpensive and can have very large storage capacities, but they do not permit random access of data. * Flash Memory - faster than disk storage, with up to 4GB or more of data, transferring (usually) over universal serial bus (USB) POONAM VALERA GUJRAT JAMNAGAR p_aum_k@yahoo.co.in

Are there any programming language that is non-English?

Yes.And it's free it's called a Text Document,once you write a command you just need to save it as ie:.txt .exe .startup .dll etc.

Time space trade off in data structure?

IN COMPUTER SCIENCE, A SPACE-TIME OR TIME-MEMORY TRADEOFF IS A SITUATION WHERE THE MEMORY USE CAN BE REDUCED AT THE COST OF SLOWER PROGRAM EXECUTION (OR, VICE VERSA, THE COMPUTATION TIME CAN BE REDUCED AT THE COST OF INCREASED MEMORY USE). AS THE RELATIVE COSTS OF CPU CYCLES, RAM SPACE, AND HARD DRIVE SPACE CHANGE HARD DRIVE SPACE HAS FOR SOME TIME BEEN GETTING CHEAPER AT A MUCH FASTER RATE THAN OTHER COMPONENTS OF COMPUTERS. THE APPROPRIATE CHOICES FOR SPACE-TIME TRADEOFFS HAVE CHANGED RADICALLY. OFTEN, BY EXPLOITING A SPACE-TIME TRADEOFF, A PROGRAM CAN BE MADE TO RUN MUCH FASTER.

THE MOST COMMON SITUATION IS AN ALGORITHM INVOLVING A LOOKUP TABLE: AN IMPLEMENTATION CAN INCLUDE THE ENTIRE TABLE, WHICH REDUCES COMPUTING TIME, BUT INCREASES THE AMOUNT OF MEMORY NEEDED, OR IT CAN COMPUTE TABLE ENTRIES AS NEEDED, INCREASING COMPUTING TIME, BUT REDUCING MEMORY REQUIREMENTS. A SPACE-TIME TRADEOFF CAN BE APPLIED TO THE PROBLEM OF DATA STORAGE. IF DATA IS STORED UNCOMPRESSED, IT TAKES MORE SPACE BUT LESS TIME THAN IF THE DATA WERE STORED COMPRESSED (SINCE COMPRESSING THE DATA REDUCES THE AMOUNT OF SPACE IT TAKES, BUT IT TAKES TIME TO RUN THECOMPRESSION ALGORITHM). DEPENDING ON THE PARTICULAR INSTANCE OF THE PROBLEM, EITHER WAY IS PRACTICAL. ANOTHER EXAMPLE IS DISPLAYING MATHEMATICAL FORMULAE ON PRIMARILY TEXT-BASED WEBSITES, SUCH AS WIKIPEDIA.

Storing only the LaTeX source and rendering it as an image every time the page is requested would be trading time for space - more time used, but less space. Rendering the image when the page is changed and storing the rendered images would be trading space for time - more space used, but less time. Note that there are also rare instances where it is possible to directly work with compressed data, such as in the case of compressed bitmap indices, where it is faster to work with compression than without compression. Larger code size can be traded for higher program speed when applying loop unrolling. This technique makes the code longer for each iteration of a loop, but saves the computation time required for jumping back to the beginning of the loop at the end of each iteration. Algorithms that also make use of space-time tradeoffs include:

BABY-STEP GIANT-STEP ALGORITHM FOR CALCULATING DISCRETE LOGARITHMS.

RAINBOW TABLES IN CRYPTOGRAPHY, WHERE THE ADVERSARY IS TRYING TO DO BETTER THAN THE EXPONENTIAL TIME REQUIRED FOR A BRUTE FORCE ATTACK. RAINBOW TABLES USE PARTIALLY PRECOMPUTED VALUES IN THE HASH SPACE OF A CRYPTOGRAPHIC HASH FUNCTION TO CRACK PASSWORDS IN MINUTES INSTEAD OF WEEKS. DECREASING THE SIZE OF THE RAINBOW TABLE INCREASES THE TIME REQUIRED TO ITERATE OVER THE HASH SPACE.

THE MEET-IN-THE-MIDDLE ATTACK USES A SPACE-TIME TRADEOFF TO FIND THE CRYPTOGRAPHIC KEY IN ONLY 2N + 1 ENCRYPTIONS (AND O(2N) SPACE) VERSUS THE EXPECTED 22N ENCRYPTIONS (BUT ONLY O(1) SPACE) OF THE NAIVE ATTACK.

DYNAMIC PROGRAMMING, WHERE THE TIME COMPLEXITY OF A PROBLEM CAN BE REDUCED SIGNIFICANTLY BY USING MORE MEMORY.

Ram is classified as what kind of storage in a computer system?

RAM is volatile storage, short-term storage or working memory. As opposed to a hard-drive which is non-volatile, long term storage or a mass-storage medium.

What is the difference between linked list and Ordinary list?

A list is an abstract data structure, usually defined as an ordered collection of data. A linked list refers to a specific implementation of a list in which each element in the list is connected (linked) to the next element.

Given a linked list of integers sorted in an ascending order and a pointer to a single node containing an integer write a C program that insert the node P in the linked list so that remains sorted?

InsertNode(NODE **q,int num)

{

NODE *r,*temp ;

temp = *q;

r= malloc(sizeof(NODE));

r->data = num;

//if it's fisrt node to be inserted

if ( *q == NULL num < (*q)->data)

{

*q = r ;

(*q)->link=temp;

}

else

{

while(temp)

{

if ( (num > temp->data) && (num < temp->link->data ) )

{

r->link = temp->link;

temp->link = r;

return;

}

temp = temp->link;

}

r->link = NULL;

temp->link = r;

}

}

How do I uninstall your operating system to install a new system?

There is no uninstaller for an operating system. To remove an OS, simply format the partition that holds the operating system. If you use a boot manager to choose between different operating systems the software should automatically detect missing operating systems for you.

Which translator translate low level language 1010111 to machines language?

Only assembly languages are generally considered low-level programming languages, so one could argue that there is only one low-level language.

However, there are as many assembly languages as there are processor models or families, as each processor family implements its own set of machine code instructions. Different manufacturers not only invent different mnemonics for similar machine code operations to suit conventions and hardware architecture (e.g. MOVE vs LOAD/SAVE), but also support different notations.

Therefore, conceptually, the assembly language is the only low level programming language. However, the standpoint of view of learning the language, or from that of tools to support the language, there are numerous assembly languages, thus numerous low-level languages.

Why Two pointers cannot be added in c language?

Because no-one knows what the sum of two pointers should be...
of course you can convert them to integers and then sum them, but why on earth would you do that?

C program to arrange 7 numbers in ascending order?

#include<stdio.h>

#include<conio.h>

void main()

{

int i,j,temp,a[7];

clrscr();

printf("Enter 7 integer numbers: \n");

for(i=0;i<7;i++)

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

for (i=0;i<7;i++)

{

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

{

if(a[i]<a[j])

{

temp=a[i];

a[i]=a[j];

a[j]=temp;

}

}

}

printf("\n\nThe 7 numbers sorted in ascending order are: \n");

for(i=0;i<7;i++)

printf("%d\t",a[i]);

getch();

}

What is inter communication?

Inter-Cloud communication means communication between two cloud environments. The pairs can be Private-Private, Private-Public and Public-Public.


A classic example of inter cloud communication can be monitoring the performance of an application deployed on one cloud from another cloud.

1 Differentiate between Data and Information?

= How do you distinguish between data and information? = I THOUGHT DATA WAS THE OFFSPRING OF IMFORMATION, CONSIDERING DATA WOULD BE THE GATHERING OF INFORMATION. IT COULD SAID BE LIKE THIS: ALL THE INFORMATION YOU REQUESTED DATA ON HAS BEEN STORED IN YOUR HARD DRIVE, THEIR THE TWO TOGETHER IN ONE SETENCE. ON THE OTHER HAND DATA.. INDUCTIVE REASONING: A TREMENDOUS SEA OF INFORMATION.. YOU HAVE TO SEE ENOUGH, TO REMEMBER ENOUGH INFO TO PUT IT TOGETHER. I SAID THAT.... GENA

Flow chart for addition of two matrices?

For the resulting matrix, just add the corresponding elements from each of the matrices you add. Use coordinates, like "i" and "j", to loop through all the elements in the matrices. For example (for Java; code is similar in C):

for (i = 0; i <= height - 1; i++)
for (j = 0; j<= weidht - 1; j++)
matrix_c[i][j] = matrix_a[i][j] + matrix_b[i][j]


Program to check palindrome using recursion?

#include <stdio.h>

#include <conio.h>

void main()

{

int num,rev=0,m,r;

clrscr();

printf("enter any number");

scanf("%d",&num);

m=num;

while(num>0)

{

r=num%10;

rev=rev*10+r;

num=num/10;

}

if(rev==m)

printf("given number is palindrome");

else

printf("given number is not palindrome");

getch();

}

this is the answer.

What is the algorithm to convert miles to kilometers?

Multiply miles by 1.609344 to get kilometres:

double mile2km (double miles) { return miles * 1.609344; }

Multiply kilometres by 0.62137119 to get miles:

double km2mile (double km) { return km * 0.62137119; }

How do you display the contents of the memory address stored in an element of a pointer array?

Remember that a pointer is just a variable containing the memory address of another variable. A pointer to a pointer is no different, other than that the address contains the address of another pointer. You use the * indirection operator to get the value of the variable being pointed at (the address of the other pointer), and the ** indirection operator to get at the value pointed at by the other pointer.

The following example illustrates how to access the values of pointers to int via an array of pointers to those pointers.

The memory address and the value of every variable is displayed for the benefit of clarity.

#include <iostream>

using namespace std;

int main()

{

// Set up an array of pointers to pointers to int variables.

int X = 1, Y=2; // The actual variables.

int* pX = &X; // Pointers to those variables

int* pY = &Y;

int** pp[2]; // Array of pointers to those pointers.

pp[0] = &pX;

pp[1] = &pY;

// Print the address of all variables and their stored values:

cout << "Var\t&Address\tValue" << endl;

cout << "---\t--------\t-----" << endl;

cout << "X\t0x" << &X << "\t" << X << endl;

cout << "Y\t0x" << &Y << "\t" << Y << endl;

cout << "pX\t0x" << &pX << "\t0x" << pX << endl;

cout << "pY\t0x" << &pY << "\t0x" << pY << endl;

cout << "pp\t0x" << &pp << "\t0x" << pp << endl;

cout << endl;

cout << "Note that both &pp and pp return the same value: the address of the array." << endl;

cout << "pp is simply an alias for the memory allocated to the array itself, it is" << endl;

cout << "not a variable that contains a value. You must access the elements of the" << endl;

cout << "array to get at the actual values stored in the array." << endl;

cout << endl;

// Use the array elements to access the pointers and the values they point to:

cout << "Elem\t&Address\tValue\t\t*Value\t\t**Value" << endl;

cout << "----\t--------\t-----\t\t------\t\t-------" << endl;

cout << "pp[0]\t0x" << &pp[0] << "\t0x" << pp[0] << "\t0x" << *pp[0] << "\t" << **pp[0] << endl;

cout << "pp[1]\t0x" << &pp[1] << "\t0x" << pp[1] << "\t0x" << *pp[1] << "\t" << **pp[1] << endl;

cout << endl;

return( 0 );

}

What are the advantages of threads over processes?

Threads in distributed applications have the same benefits as in any other application: they allow you to perform multiple operations at the same time.

Specifically for distributed applications, the server will most definitely be multi-threaded so that it can communicate with all of the clients. The clients will also most likely have at least two threads: one for communication with the server and one for doing actual data processing.

Why might a programmer prefer the top-down approach to programming design?

some programmers think breaking the process into smaller parts allows them to better understand what the procedure being programmed does

How do you declare local and global variables in pseudo code?

Pseudocode is not a programming language (it's specifically intended for human interpretation), so there is no need to declare variables, you simply define them as and when you require them. For instance:

Let x = 42

Let y = x * 2

Who is the inventor of c plus plus language?

C was initially developed by Dennis Ritchie from 1969 to 1973. C++ was initially developed by Bjarn Stroustrup from 1979 (when it was known as C with Classes) to 1983 (when it was renamed C++). Both developers worked at Bell Labs at the time.

The binary number 11 would have a decimel equivelent of?

It depends.

If you are using unsigned numbers, then the following assumption is made:

0b11 = 0b00000011,

in which case the answer is;

2^1 + 2^0 = 2 + 1 = 3

If you are using signed numbers, than a binary number in the form 0b11 would be interpreted as negative because the leading bit is equal to 1. For signed numbers, the '1' in the leading bit is extended, thus:

0b11 = 0b11111111

In order to interpret this number, negate the number by flipping the bits and adding 1:

0b11111111

0b00000000 (bits flipped)

0b00000001 (added one)

The positive representation of 0b11111111 is equal to 0b00000001, which is equal to 1, thus

0b11 = 0b11111111 = -1

Give example of a language which uses more than one pass for compiling a program?

FORTRAN, Assembler, to name two. Effectively, any language that allows you to reference symbols before they are declared.