answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

What are watts and kilowatts?

A watt is a unit of power referring to rate of energy conversion. It is equal to one Joule per second. A kilowatt is equal to 1,000 watts - a unit of energy equal to approximately 1.34 Horsepower.

Class data types in c?

The data types indicate the type of values that can be stored. The primary data types in c are:

1. int, short, long, long long - used for integer values

2. float, double - used for storing floating point numbers

3. char - used for storing ASCII characters

What is difference between reference and object?

References are stored in stack while objects are stored in heap.

Reference holds the memory address of an object, that's why they are called reference. If they don't refer to any object in heap, they hold 'null', meaning nothing.

Objects hold the actual data in them. This data is accessed (either read, or written) through reference. An object may be referenced by zero or more references.

For example, consider a class Person, which can hold 'name'.

I create 2 reference variables of Person type.

Person p1;

Person p2;

at this moment both references contain 'null'. An attempt to access 'name' data will throw an error. Now assigning new object to 'p1'.

p1 = new Person();

this causes an object to be created in heap, and its reference(memory address) is stored in p1. Now I can access 'name' data of this object created through p1.

p1.name = "Tom";

Assigning p2 to p1, will make p2 pointing the same object in the heap as p1 is pointing to. Thus if you change 'name' through p2, you are actually changing the same object as p1 is pointing to.

p2 = p1;

p2.name = "Sam";

both p1 and p2 reference variables that are in stack, are pointing to the same object that is in heap.

Hope this helps :)

What is IT architecture and infrastructure?

Basically it's all of your networks and supporting systems and in some cases the entire IT department as well.

What are the characteristics of each generations of programming language?

Programming languages are categorized into generations based on their level of abstraction and ease of use.

  1. First Generation (1GL): These are low-level languages, primarily machine code, which are specific to a computer's architecture and require extensive knowledge of hardware.

  2. Second Generation (2GL): Assembly languages fall into this category, providing a slightly higher abstraction with mnemonic codes representing machine instructions, making it easier for programmers to write code.

  3. Third Generation (3GL): High-level languages like C, Java, and Python focus on human readability and abstraction from hardware, allowing for more complex programming without detailed knowledge of the machine.

  4. Fourth Generation (4GL): These languages are even more abstract, often domain-specific, and designed for specific tasks like database management, enabling rapid application development with less code.

  5. Fifth Generation (5GL): This generation involves languages used for artificial intelligence and incorporates constraints and logic programming, focusing on solving problems rather than writing code.

Write a C function to sort two dimensional integer array in ascending order?

Here's an example using a bubble sort. Note that this is not a very efficient sort, but it works weel enough with small data sets.

#include

#include

int main(void)

{

int item[100];

int a, b, t;

int count;

/* read in numbers */

printf("How many numbers? ");

scanf("%d", &count);

for(a = 0; a < count; a++)

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

/* now, sort them using a bubble sort */

for(a = 1; a < count; ++a)

for(b = count-1; b >= a; --b) {

/* compare adjacent elements */

if(item[ b - 1] > item[ b ]) {

/* exchange elements */

t = item[ b - 1];

item[ b - 1] = item[ b ];

item[ b ] = t;

}

}

/* display sorted list */

for(t=0; t

return 0;

}

How to print ASCII values using c?

Well in C++:

#include <iostream>

int main()

{

char x;

for(int i = 0; i < 255; i++)

{

x = i;

std::cout << i << "\t" << x << std::endl;

}

char wait;

std::cin >> wait;

return 0;

}

How is XHTML used?

Many modern websites use XHTML now; although some are still left in the dark, pondering with HTML. Thus, many corporations, businesses, organizations, freelancers, entertainers, general website developers, and others use XHTML.

What are tokens in c language?

in c program the smallest individual unit is called c-token

Example a program using two dimensional array multiplication table?

#include <stdio.h>

int main() {

int TimesTable[12][12] = { {1,2,3,4,5,6,7,8,9,10,11,12}, {1,2,3,4,5,6,7,8,9,10,11,12} };

int a, b;

for (a = 1; a <= 12; ++a) {

for (b = 1; b <= 12; ++b) {

TimesTable[a][b] = a*b;

printf("%5d", a*b);

}

printf("\n\n");

}

return 0;

}

How do you put a video on power point?

YouTube doesn't accept PowerPoint files. It only accepts the following video formats:

  • Windows Media Video (.WMV)
  • .3GP (cell phones)
  • .AVI (windows)
  • .MOV (mac)
  • .MP4 (iPod/psp)
  • .MPEG
  • .FLV (adobe flash)
  • .MKV (h.264)

If you want to upload PowerPoint to YouTube, you should convert the PowerPoint to video format like WMV, MP4, AVI or FLV.

There are many ways for us to convert PowerPoint to video. Check the details in the following link: ways to convert poweroint to video

To convert PowerPoint to video with timing intact, the recommend one is Wondershare PowerPoint to video Converter.

What is application interface?

An application programming interface (API) is a set of routines, data structures, object classes and/or protocols provided by libraries and/or operating system services in order to support the building of applications.

An API may be: * Language-dependent, that is, only available in a particular programming language, utilizing the particular syntax and elements of the programming language to make the API convenient to use in this particular context. * Language-independent, that is, written in a way that means they can be called from several programming languages (typically an asm/c-level interface). This is a desired feature for a service-style API which is not bound to a particular process or system and is available as a remote procedure call.

What is assembler can do?

It converts machine level language to high level language simultaneously...and vice versa..

Advantages and disadvantages of the programming language FORTRAN?

Up till Fortran 90/95, the language was primarily intended for calculations. It remains one of the best computational languages ever developed, and is still in heavy use in the financial industry.

However, due in large part to disagreements among members of the Fortran development groups, Fortran 77 was deficient in a number of areas. Most or all of these have since been addressed by Fortran 90/95, however, so they do not represent current language deficiencies. These limitations included:

  1. Poor string handling, including weak concatenation and length functions.
  2. Subroutines pass arguments by reference rather than by value, making data protection difficult.
  3. Data scoping is limited. Variables can either be local or in COMMON blocks, but no other scoping is allowed. As a result, it's not possible to write file-level procedures; shared logic must be in a separate subroutine or repeated via cloning.
  4. Loop controls are somewhat limited, requiring continued use of the GOTO statement to manage flow in some cases.

Where can one find a tutorial for Visual Basic?

Tutorials for Visual Basic can be found on MSDN Microsoft, Amos Development, and Home and Learn UK. The Engineering Department at Auburn University also offers a very detailed tutorial for Visual Basic.

How much a base class members can access of derived class?

Ideally, none. Base classes should have no knowledge whatsoever of their derived classes and therefore should have no access to any members declared in the derived classes. However, derived class methods are accessible via virtual functions declared in the base class. The correct methods (overrides) are called via the virtual table, but the base class itself requires no specific knowledge of the derived class in order to call these methods. This makes sense since a base class cannot know in advance all the classes that may or may not derive from it in the future.

If a method must be guaranteed to be implemented by a derived class, a pure-virtual method can be declared in the base class instead. This renders the base class abstract, meaning you cannot instantiate an object from the base class, only from a derivative that fully implements (or inherits) all the pure-virtual methods.

Conversely, a derived class can access all the public and protected members of its base class.

Why is it important to manage your files?

It is important to manage your files because they become cluttered and slow your system. It is also important to manage your files because important information is stored in those filed and you might need to retrieve that information.

Who invented insertion sort?

There are no records of when insertion sort was invented because people have been sorting things using the insertion sort and selection sort algorithms since before records began; they are ancient algorithms. You cannot be credited for creating an algorithm that already exists.

Shell sort, which is a refinement of insertion sort, was developed much later, in 1959 by Donald Shell. His algorithm can be credited because it takes advantage of a computer's processing abilities, whereas insertion sort and selection sort rely purely on a human's processing abilities.

Is the for loop a pretest type of loop?

Pretest loops, such as for-loop, while-loop, execute/evaluate the condition statement first, if the condition is met, then the statements of the loop are executed. If you were referring to the body of the loop being carried out at least once, no, the body will not be touched if the condition fails (pre-test, test BEFORE the [next] execution of the body). But the condition of the loop must have been evaluated at least once.

In contrast to the post-test loops, such as do-while, repeat-until, the condition is evaluated AFTER the [next] execution of the body. It is possible that the condition is never evaluate, and not the entire loop body being executed.

What part of a file name indictes the file type and program that created it?

Usually nothing. The file extension (the .jpeg, .exe, .png, .mov, etc.) tells what kind of file it is. Certain programs deal with certain extensions, like word with .doc, .rtf, and .txt. Paint and photoshop deal with .jpeg, .png, .gif, and .bmp. Powerpoint deals with .ppt, and so on. Hope this helps!

What is readability as a criteria of evaluating programming languages?

Yes. Some computer languages, such as VB, VB.NET, COBOL are designed for business, while Fortran is for engineers and scientists.

Which one is better between Compiler and interpreter?

A compiler is a program that takes a programming language like that of java and then translates it into computer language for the software user. The interpreter just ( just like that of a human interpreter) takes the foreign language which would be that of the programming language and turns it into the machine code. Both of these programs take a high-level programming language and translates them into the machine code, but the interpreter is slower to translate than the compiler because of the fact it processes and interprets each statement many times.