Flux rss
Bookmark Bookmark & Share
Struttura di un programma Estrutura de um programa Programmstruktur Structure d'un programme Estructura de programa

How does a computer program work?

A program's behaviour depends on the type of language used to write the program.

Nonetheless, almost all programming languages are based upon the same principle:
The program consists of a set of commands that the computer must execute. The computer executes the commands as it reads the file (from top to bottom) until it reaches a command (often referred to as a branch command) which tells the computer to go to a specific location in the program. In a way it resembles a treasure hunt where the computer must follow the clues and execute commands until it reaches the end of the program and is stopped.

The concept of variables

Variables are used in most languages, where a name is associated with content. For example, we can call a variable "dummy" and assign it the value 8.

Data types

Some languages allow you to associate any data type to a variable (either a whole number or a character), such a language is called a non-typed language.
As can be seen in the chapter data representation, the type of data sets the number of bytes that the data is coded in, i.e. the amount of memory that this data takes up as well as the format in which it is represented.
For this reason evolved languages (C, Java) are typed languages, meaning that a variable is not only associated with a name but also a data type, which should be specified when declaring the variable, i.e. when the variable name is written for the first time you must specify in the compiler the type of data this variable will contain (the method of declaring the variable depends on the language used).

Syntax

Programming languages require strict syntax, you cannot simply write things as you wish.

Thus, some languages are case sensitive, meaning that a name written in lower case is not considered to be the equivalent of the same name written in upper case. So the variable "Dummy" is different to the variable "dummy".

Variable names usually require a maximum length (depending on the language) and a certain character set, where the following characters are generally used:

abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1234567890_ 

So a space (" ") is therefore considered a different type of character, called a special character. It is therefore not very common for a language to allow the use of special characters in variable names!

Reserved words

In most languages there are a handful of words that may not be used as variable names, these are called reserved words. These are specified in the chapter corresponding to the specific language.

Constants

A constant is data type whose value cannot be modified. These are generally defined at the beginning of the program. The value of the constant may be of any type permitted by the programming language.

Comments

It is useful when writing a program to be able to add lines of text that the compiler does not treat as code. These lines of text are usually preceded (or enclosed) by special commands which tell the compiler to ignore them.

Comments are used to clarify how the program is written by explaining parts of the code. Comments are useful if another person is trying to understand how the program works by reading the source file, or even, if the person who wrote the program is reading the source file again some years after having originally written the code.

Last update on Thursday October 16, 2008 02:43:20 PM.This document entitled « Program structure » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.

Data Structure - Stack Hello guys, I am a biggener in D.S, i need someone to give me the code of the following question please. I will be so thankfull and helpfull with him\her. Regards, Data Structure Write a program that converts an arithmetic infix expression into... en.kioskea.net/forum/affich-78375-data-structure-stack
Programming languages Programming language A "programming language" is a language designed to describe a set of consecutive actions to be executed by a computer. A programming language is therefore a practical way for us (humans) to give instructions to a... en.kioskea.net/contents/langages/langages.php3
Introduction to object-oriented programming A new programming concept Extract from "Understanding Active X and OLE" by David Chappel "In the last 35 years, designers of computer hardware have gone from designing machines the size of a hangar to thin notebooks based on minuscule... en.kioskea.net/contents/poo/poointro.php3
Nintendo DS Homebrews and ProgrammingNintendo DS Homebrews and Programming *SLOT-1 and SLOT-2 devices *System Files *Homebrew Games and Tools *Nintendo DS programming Nintendo DS homebrew is a software that has been developed by a group of home users and uses... en.kioskea.net/faq/sujet-237-nintendo-ds-homebrews-and-programming
Change the default installation folder C: \ Program FilesChange the default installation folder C: \ Program Files The installation of most software programs are set by default in the C: \ Program Files. Below is a means of how to change into another partition. Under Windows Vista, select... en.kioskea.net/faq/sujet-1328-change-the-default-installation-folder-c-program-files
Display Add/Remove ProgramsDisplay Add/Remove Programs Solution When trying to uninstall a program in the add/remove programs, below error message appears on your screen: An unexpected error occurred Object does not support this property or method... en.kioskea.net/faq/sujet-1672-display-add-remove-programs
Unable to uninstall Personal Antivirus PrograHello, It seems that many have been successful at removing the program "Personal Antivirus", I however have not succeeded in such. I've gone to my computers and tried to remove "PAV" however the program will not uninstall, even when I've selected it,... en.kioskea.net/forum/affich-98548-unable-to-uninstall-personal-antivirus-progra
Download ProgDVBThe broadcasting of program in numerical is more and more fashionable since the appearance of connection high - debit side. ProgDVB is a program intended to look at chains TV and to listen to stations radio on your computer.It supports DVB-S... en.kioskea.net/telecharger/telecharger-722-progdvb
Download Delete Add and Remove Programs List Entries SoftwareThis program allows you to remove simply the name of unwanted software from the window of Add/Remove Program. Moreover, the application detects and suggests what program should be removed because they do not exist any longer (empty folder or the rest... en.kioskea.net/telecharger/telecharger-4115-delete-add-and-remove-programs-list-entries-software
Download Pocket Programming LanguagePocket Programming Language helps you to write software for Smartphone, Pocket PC and PC in minutes. It is a programming language that is object oriented. Pocket Programming Language comes with a creative environment on a PC, Smartphone and Pocket PC... en.kioskea.net/telecharger/telecharger-3306-pocket-programming-language
Structure of an email (Headers and bodies)Structure of an email An email has three basic parts: The header, a set of lines containing information about the message's transportation, such as the sender's address, the recipient's address, or timestamps showing when the message was sent by... en.kioskea.net/contents/courrier-electronique/format-en-tetes.php3
UNIX - FilesIntroduction to UNIX files In UNIX systems any element is represented in the form of a file. All files are architectured around a single tree structure where the base, called the root, is written "/". File types UNIX systems define different... en.kioskea.net/contents/unix/unix-fichiers.php3
Operating systemDescription of the operating system For a computer to be able to operate a computer programme (sometimes known as application or software), the machine must be able to perform a certain number of preparatory operations to ensure exchange between... en.kioskea.net/contents/systemes/sysintro.php3