answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

What is the Programming environment?

All desktop computers are composed of at least two main parts: a monitor or display device, and a case where the computer's internal systems are stored. Most commonly, this case is a separate "tower" that is connected to the monitor, but some desktops have the monitor and other hardware integrated into one unit. An operating system loaded on a hard drive allows the computer to display an interactive environment.

What are some of the databases you interact with?

We interact with many databases in our everyday life like credit car transactions, cell phones, internet and more. Interaction with database has made life easier and simpler.

What is the time complexity for searching an element in an array?

If the array is unsorted, the complexity is O(n) for the worst case. Otherwise O(log n) using binary search.

On which machine was the first programming language developed?

The first programming language was machine code, the native language of the machine. Every machine type has its own version of machine code but we can trace the earliest example of machine code back to the days of the semi-automatic weaving loom invented by Basile Bouchon in 1725.

Strictly-speaking, machine code is not a programming language. Programming languages are human languages, a means of producing machine code through symbolic abstractions that are much easier for humans to interpret than native machine code. It should also be noted that programming languages are never developed on a machine, the language is purely abstract and designed according to a specified proposals. The only thing that is actually developed on the machine is the implementation of the machine code program that physically converts the symbolic instruction code into the machine's own native machine code. Before we had any programming languages, all programs had to be written in the machine's own native machine code. Once we had one programming language, we could use it to create translators for other languages and indeed for other machines besides the one on which it executed.

Note that it's difficult to know precisely when programming languages were first used because there were many language pioneers working simultaneously, often sharing ideas and evolving designs to the point that it is difficult to determine at what point a language is "fit for human consumption", so to speak. To make matters worse, many early programming languages were proposed but never designed, while others were designed but never implemented.

Assembly language is the next step up from machine code. Like machine code, every machine type has its own version of assembly language, and is therefore a low-level language. Unlike machine code, code written in assembly language has to be translated into native machine code before it can be executed because machine code is the one and only language "understood" by the machine. Converting from assembly language to machine code is as tedious and as error prone as writing the machine code itself, however the actual conversion process is trivial enough that we can easily write a small machine code program (known as an assembler) to perform the conversion for us. The earliest known usage of an assembly language dates from 1949 on the EDSAC computer at Cambridge University, where the assembler (known as Initial Orders) was implemented in read-only memory. The inventors were Maurice Wilkes and W. Renwick.

High-level languages are more abstract than assembly languages and are generally more portable (not machine dependent). The first high-level programming language was probably Autocode in 1952 on the Mark I computer at the University of Manchester, or Short Code in the same year on the UNIVAC 1. Short Code was based upon an earlier implementation known as Brief Code in 1949 for the BINAC computer, but it was never tested or debugged. Autocode used a compiler program to convert the high-level symbolic code into machine code whereas Short Code used an interpretation program. The difference between the two is that the native machine code produced by a compiler can be stored and executed without any further translation whereas code written in an interpreted language has to be converted by the interpreter program every time it is executed. As a result, compiled programs perform better than interpreted programs.

Modern-day Java is an example of a programming language that is both compiled and interpreted. Unlike a traditional compiler, the Java compiler produces byte code which can then be interpreted to produce native machine code. The reason for this multi-conversion is that the same byte code can be executed upon any machine with a Java virtual machine implementation. That is, the byte code is the native language of the virtual machine and is much quicker to interpret than the higher-level source code would be. It also ensures that the intellectual property -- the source code itself -- is not revealed to the user.

It is worth noting that Plankalkül was designed from 1943 to 1945 for the Z3 and therefore predates assembly language as well as Autocode and Short Code. However it was not actually implemented until 1998, more than 50 years after it was designed!

What are disadvantages of event driven programming?

  1. This method may not be useful for large, unique or highly complex projects
  2. This method cannot be a success if the team is not sufficiently motivated and nor is unable to work cohesively together.
  3. Success depends on the extremely high technical skills of the developers.
  4. There are times when the team ignores necessary quality parameters such as consistency, reliability and standardization. Hence this can make project quality management hard to implement during the project management life cycle

Can you use visual c plus plus for window programming in c language?

... yes?

The question doesn't really make any sense. Any language can be used to program a computer, so long as you have a compiler for it. There definitely are both C and C++ compilers for Microsoft Windows, therefore you can write device drivers in it if you want.

Heck, you could theoretically write device drivers in LISP or BASIC if you wanted; I personally wouldn't, but it could be done.

How do object oriented design and structure design differ?

Object Oriented programming is a superset of structured programming. Structured programming is as follows:

--Program start

var

var

var

function { ... }

function { ... }

function { ... }

main { ... }

--- Program End

You have units of code, which operate on variables, and are called in reference to those variables, to follow a structure acting on those variables.

Object oriented is as follows:

--- Program Start

object {

var

var

function { ... }

function { ... }

function { ... }

}

var

var

function { ... }

main { ... }

--- Program end

Variables can be objects, which have their own data and functions. Think like C and structures, except structures can have functions "in them" which operate specificly on their own data. Thus, instead of referencing a function (a block of code) and telling it to operate on a variableq you reference an object and tell it to perform an operation, most often on itself, specific to itself, using its own data. Instead of creating units of data to pass to functions which operate on them, you create objects and have them perform operations [on themselves].

Functions attached to objects don't need a specific name; rather than task_struct_sort_children(task) and acl_rules_struct_sort_children(task), you can have task and acl_rules with task->sort_children() and acl_rules->sort_children(), which have completely different specific function but the same logical function, and operate on the specific instance of the object.

structured oriented programming and object oriented programming have some features of similarities, but the distinction between the two is that the former relies to the GOTO statements thus the developer has a tendency to confuse while the latter is subgrouped from objects, classes, methods and hierarchies.

What do you mean by function to pointer?

Answer
  • I take it you are using some version of c,c++,visualC etc etc. One thing that is standard is pointers. A pointer is the address of a memory space that holds information in that specific space. By referencing the pointer in your code, you can print out that specific bit of information that the poiner is actually pointing to. Hope this helps

What does tracert mean?

the network path to a destination

AnswerTraceroute ( or Tracert )is a comp network tool used to determine the route taken by packets across the IP network.

Tracert is a tool which is used on Microsoft window Operating system, while traceroute tool is available on particular Unix-like OS....

Tracert n Traceroute are same in functionality bt having differt names in different Operating sys.

What is the while loop in C programming?

"while" is an entry controlled loop statement i.e the condition is evaluated first and if it is true the body of the loop is evaluated.This process is repeated until the test condition is false;then the control is transfered out of the loop.

The general form of while is as following

syntax:

while (<condition>)

{

<statements>;

}

Why would your laptop run slowly?

Program data must be accessed from the hard drive and copied into memory, which can take a long time for large programs.

Windows tends to become more resource-intensive with every release, so unless you have cutting-edge hardware it may be slow.

What is a example of figurtive language?

the wind tippy toed across the sky to dance with the clouds-personification;giving something nonhuman human qualities my feet were ice cubes that have just been frozen-metaphor;renaming something;comparing something not using like or as my arm was burning as if i had just dumped it into lava-simile;comparing something using like or as her arms were as long as Mt. everest-hyperbole;an extreme exaggeration

What is controlled buffer register?

it is very simple.... there are two parameters clear and load.. when clr is high(1) all the outputs becme zero and when clr is low(0) ff's are ready to work.. now load controls d ckt.. when load is lw and loadbar is high the output of the or gate depends on q0 q1 and q2... nw when the positive edge of clk pulse arise the data is circulated or retained i.e., register conents remain the same.. when load is high and loadbar is low the output of or gate depends on x0 x1 and x2.. nw when positive edge of clk pulse arise x bits reach the ff's and x bits are stored so that q0 q1 q2 = x0 x1 x2.. see the diagram for 3-bit contrlled buffer register and u will understand it.. hope it was useful :)

How do you find the minimum value of an array in c language?

Your best bet would probably be to iterate through the array using a for loop and compare each value to the current low and high values (which you would store in a local variable)

for example:

for each element in array

{

if current is less than lowest_value

lowest_value = current

else if current is greater than highest_value

highest_value = current

}

Write a program to accept any three numbers and find the smallest number by if statement?

#include<stdio.h>

main()

{

char ch;

printf("\n enter any number:");

scanf("%c",&ch);

if(ch>=65&&ch<=90)

printf("\n upper case aphabet");

else if(ch>=97&&ch<=122)

printf("\n lower case alphabet)

else if(h>=48&&ch<=57)

printf("\n numeric char");

else

printf("\n special char");

}

What is function in C plus plus programming language?

Functions are short procedures or subroutines that can be called as and when required. Unlike goto statements, which branch off to a labelled section of code never to return, functions always return back to the caller. Functions may also call other functions. Functions are typically used to reduce the amount of duplicate code, producing more consistent and error-free code and reducing maintenance whenever functions need to be modified. Functions are also used to make code more readable by replacing complex or compound statements with a simpler function call. By using easy to understand function names, code becomes self-documenting, reducing the need to include verbose comments that only serve to interrupt the flow of the code.

Although there is a performance penalty in calling functions as opposed to inline code, the compiler's optimisation routines can inline expand functions whenever there is an advantage in doing so. Typically this applies to short functions with one or two simple statements, but can also apply to functions that are seldom called.

Functions may also return a value back to the caller (a function that does not return a value simply returns void). Functions can modify their behaviour according to arguments supplied to the function. The number and type of arguments is dependant upon the function signature. The signature also differentiates between functions with the same name, thus allowing functions to be overloaded to cater for different arguments types.

If the argument types are references (or pointers), the function can modify the arguments passed to it unless the arguments are declared const. Passing by reference also allows functions to return more than one value to the caller (typically the return value itself is used to provide diagnostics, such as an error code).

If the arguments are passed by value, however, the function creates a local copy of the argument, thus preventing changes to the argument that was actually passed. If the argument being passed is an object, the object's copy constructor is called automatically. Since this can be detrimental to performance, objects should always be passed by reference unless the function actually needs to work on a copy of the object rather than the original object.

In C++, classes make use of functions, known as member methods, to provide the implementation of operations that may be applied to an object's data. Classes may also employ virtual functions that allow derived objects to provide more specialised implementations whilst retaining the existing generic code. This also helps to reduce duplicate code, but also allows objects to behave polymorphically. That is, it is not necessary for a generic class to know any of the implementation details of its derivatives. You simply call the generic method of the base class and the virtual table redirects the call to the most-specialised override of that function, if one exists. If not, the generic method is called instead. Classes can also make use of pure-virtual functions, such that the base class need not provide any generic implementation at all. These classes are abstract classes which cannot be instantiated by themselves. Instead, you are expected to derive new classes from abstract classes, and the derived classes must provide the implementation even if the base class provides a generic implementation. Only classes that provide or inherit a complete implementation of all pure-virtual methods can actually be instantiated.

Are video games hard to make?

They can be. It really depends on the type and complexity of the game. However, the hardest part of writing any game is simply in coming up with an original concept that will engage players. Once you have that, writing the actual code is easy.

What are examples of first generation programming languages?

The only example of a first generation language is machine code, the native language of the machine. Every type of machine has its own variant of machine code specific to that machine's architecture.

What is storage claases in c language?

storage classes is important part of c language.WHENEVER we define any function in c program then we can call that in every definend class.

there are four types of storage class. these are...

1 AUTO OR AUTOMATIC STORAGE CLASS

2 REGISTER STORAGE CLASS

3 STATIC STORAGE CLASS

4 EXTERNALSTORAGE CLASS

1) The features of "AUTOMETIC" storage class are as under some conditions:

storage : storage will be in memory.

value : garbage value.

scope : scope is local to block to the variable.

life : till, controls remain within the block.

2) The featurs of "STATIC" storage class are as under some conditions:

storage : memory.

value : zero.

scope : local to block.

life : Till control remains within the block.

3) The featurs of "REGISTER" storage class are as under some conditions:

storage : register.

value : garbage value.

scope : local to the block.

life : value persists between variable.

4) The feature of "EXTERNAL" storage class are as under some conditions:

storage : memory.

value : zero.

scope : local to block.

life : till controls remains within the block.

What is the use of 'pragma' in C language?

The #pragma directive is a compiler specific instruction. There are many things you can tell the compiler. For instance, the #pragma pack n directive tells the compiler to override the /Zpn command line argument and to use a new default structure packing value. To see all of the possible #pragma directives, go to online help, and index by #pragma directives, C/C++. You probably only need to type in #pra and then click on C/C++ to get this far.

Which computer language uses mnemonics to write computer programs?

In a sense they all do, but you are probably thinking of Assembly languages (where the term "mnemonic" is used explicitly for the identifiers used to stand for instruction opcodes, register numbers, etc.

Note: there is no single Assembly language, every modern computer architecture has at least one Assembly language specific to its unique instruction set.

When troubleshooting a motherboard you discover the network port no longer works what is the best and least expensive solution?

Check BIOS settings, make sure that the adapter is enabled. Check that the cable is not damaged and working properly. If you have burned the port. You can get a PCI extension port with Network Interface Port.

What is Notation in Algorithm?

hi i am ravi kashyap my email id kashyap.ravi77@gmail.com

notations used to define the effiency of

An algorithm?

what means

What is subroutine?

Subroutine is an instruction sequence in a machine or assembly language program that can be prewritten and referred to as often as needed. Subroutine is used for controlling thing e.g. traffic lights burglar alarms they all use subroutine