answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Why is it beneficial and often necessary to have a structured design approach to computer program development?

Structured designing is clean. It is hard to imagine computer programming without thinking of it as being structured. Structure or a structured approach is built into the very concept of programming. By adding your own structure, you can, as a programmer, add order, power and usefulness to your program.

Modern programs are complex. The computers that manipulate them are very fast. A small mistake can go far in destroying value ( or maybe the entire human race! ). So be clear, be organised and be simple. Even the most complex tasks and algorithms can be implemented with utmost simplicity if you keep on breaking them down to logical levels.

Good Luck!

What is text-based programming?

Object Oriented Programing allows the user to interact with the program via user interface, (buttons, checkboxes, ect.) Console programs are just a black screen with white letters. Sometimes, this is efficient though. Not all programs need to look nice.

What are the advantages and disadvantages of logic programming?

Logic programming has a number of advantages and disadvantages, and here are some of them:

Advantages:

• Logic programming can be used to express knowledge in a way that does not depend on the

implementation, making programs more flexible, compressed and understandable.

• It enables knowledge to be separated from use, ie the machine architecture can be changed

without changing programs or their underlying code.

• It can be altered and extended in natural ways to support special forms of knowledge, such

as meta-level or higher-order knowledge.

• It can be used in non-computational disciplines relying on reasoning and precise means of

expression.

Disadvantages:

• Initially, due to insufficient investment in complimentary technologies, users were poorly

served.

• In the beginning, poor facilities for supporting arithmetic, types, etc. had a discouraging

effect on the programming community.

• There is no adequate way of representing computational concepts found in built-in

mechanisms of state variables (as is usually found in conventional languages).

• Some programmers always have, and always will prefer the overtly operational nature of

machine operated programs, since they prefer the active control over the 'moving parts'.

Under DOS a file name can contain up to characters?

8 characters a decimal the 3 letters for extension. 8.3

How does the assembly language can be executed by CPU?

Assembly language programs are the Low level programs. We write Assembly Language program in basically 8085 and 8086 microprocessors.

We can have several registers to do opreations with. Accumulator is one most important Register in a assembly program.

We use several instructions like..

Arithmetic:

INR - Increment Accumulator

ADD B - Add Content of Reg. B with Accumulator

SUB, etc.

Logical:

AND - Bitwise AND

Jump Instriction:

JZ label - Jump to label if ZERO flagged

JC Label - Jump on Carry

Etc..

Example:

MVI B, 06 //Load Register B with the Hex value 06

MOV A, B //Move the value in B to the Accumulator or register A

MVI C, 07 //Load the Register C with the second number 07

ADD C //Add the content of the Accumulator to the Register C

STA 8200 //Store the output at a memory location e.g. 8200

HLT //Stop the program execution

What is the disadvantage of high level languages?

Strongly typed languages may require explicit casting operations or type-translation services, possibly even involving runtime operations, to translate one type from another. This can sometimes be seen as undesirable code clutter, especially in context with rapidly prototyped scripts and similar tasks.

A strong typing system is paramount to solid quality programming, and is generally considered an advantage.

Could please list the different programming languages?

COBOL, Fortran

C, C#, C++, Java

Object C

JavaScript

Smalltalk

Ada

APL

Lisp

F#

X++

Icon

SPSS

RPG

Unix Shell script

Perl

...

Mater carmeli school?

It's a Catholic School owned by the Carmelite Missionaries. They are located in the following areas:

=) Sacred Heart Village, Novaliches, Quezon City - Kinder to High School

=) D. Tuazon Ave., Quezon City - Kinder to Grade VI

=) Dingle, Iloilo - Nursery, Kinder, Prep and High School

Examples of embedded system development?

embedded system is an electronic device which is made for an specific task.when we are taking about the embedded system development.it include the embedded life cycle,in which we have to specify the product ect,up to maintanence

What are the drawbacks of assembly level language?

The assembly language does not support object oriented program

so they change to c and c++ the c++ will support object oriented program

this are the demerits of assembly language.

What are the three triangles?

A tetrahedron is a 3 dimensional shape bounded by 4 triangular faces. It has 4 vertices and six edges. Three faces meet at each vertex so that the shape is self-dual.

How can you increase the size of a statically allocated array?

/* Allocate space for an array with ten elements of type int. */

int *ptr = malloc(10 * sizeof (int));

if (ptr == NULL) { /* Memory could not be allocated, the program should handle the error here as appropriate. */ realloc It is often useful to be able to grow or shrink a block of memory. This can be done using realloc which returns a pointer to a memory region of the specified size, which contains the same data as the old region pointed to by ptr (truncated to the minimum of the old and new sizes). If realloc is unable to resize the memory region in-place, it allocates new storage, copies the required data, and frees the old pointer. If this allocation fails, realloc maintains the original pointer unaltered, and returns the null pointer value. The newly allocated region of memory is uninitialized (its contents are not predictable). The function prototype is void *realloc(void *pointer, size_t size);

Write a program to add two integers using c plus plus?

#include<iostream>

int main()

{

int a=40;

int b=2;

std::cout<<a<<'+'<<b<<'='<<a+b<<std::endl;

}

Output:

40+2=42

What is the most basic loop in c?

Answer

the answer to this question would vary from programmer to programmer... Basically for the embedded system programmer the while loop is more important and would be considered as basic. However for the application programmer the for loop is always a better option.

Answer

These are: LABEL-goto, while, for, do-while, and recursion, of course.

Write a program to find the square root of the quadratic equation using flow chart?

You don't need a flow chart for that; just use the quadratic formula directly; most programming languages have a square root function or method. You would only need to do this in many small steps if you use Assembly programming. The formulae would be something like this:

x1 = (-b + sqrt(b^2 - 4*a*c)) / (2 * a)

and

x2 = (-b - sqrt(b^2 - 4*a*c)) / (2 * a)

where a, b, and c are the coefficients of the quadratic equation in standard form, and x1 and x2 are the solutions you want.

What is the difference between object linking and object embedding?

hai guy, you see the word art in ms word application?? the typed word art text is the object. when you double click on it it will display the wordart text editor . so the object links the editor. that y called ole. regards s.s.senthil kumar Tamilnadu, India hai guy, you see the word art in ms word application?? the typed word art text is the object. when you double click on it it will display the wordart text editor . so the object links the editor. that y called ole. regards s.s.senthil kumar Tamilnadu, India ssmailid@yahoo.com

How much money does a computer programmer earn per week?

Depends on what they're doing and who they work for. Look at a site such as Monster or go through the classifieds in your newspaper to get an idea. Very roughly, it could range from as low as $30K a year (very low) to over $100K a year.

== ==

How do you use qsort function to sort an array of structures?

It depends what language you are using and how the function is implemented. However, generally, you need to pass 4 arguments to the function:

1. A reference to the array.

2. The lower bound of the sub-array to be sorted (usually 0).

3. The upper bound of the sub-array to be sorted (usually n-1 for an array of n elements).

4. A binary predicate to perform comparisons between the elements (usually a less-than predicate).

How do you you delete a node in singly linked list only pointer to that node is given in C?

Firstly, thanks for trying solve this algorithm.

I will rewrite the wrong way and debug it in the next line, and the causes in th last line , O right?


wrong:void delete(int n).
debug:void delete_node(node* list, int n).
causes:
-You have to include the name of the list from which you want to delete a node. -you used delete as a name of the function, and that is impossible because delete is a predefined function, use delete_node for example.




wrong:you didn't affect the address of the list to the temporary pointer named here P.
debug:p=list.
causes:
-one of the disadvantages of the chained list -unlike contiguous list-is: to arrive to the the required node, we have to traverse all previous nodes to get the required one, therefor we use that temporary pointer, and this latter mast have to start from the first node names here list.


the rest is right, try this code, I think it works::


void delete_node(node *list, int n)
{
node *p;
p=list;
int i=1;
while(i
{
p=p->next;
++i;
}
node *q;
q=p->next;
p->next=q->next;
free(q);
}



Best regards of InfoMan.






How do you find base of an unknown number in number system?

You first determine the algebraic numerical equilibrium ( algorythm ) and divide it by the sum of the true algebraic expression (X)-(X=?>y^Zy<~=X)Answer. Basic Pythagoras Theorem co-tangent w/equilibrium.

What are the 2 high level programming language?

BASIC , FORTRAN ,COBOL , PASCAL are high level lanhuages which are simply understood by us used in the computers.