Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
21 views

Programming Constructs and Techniques

Programming constructs and techniques include common building blocks like iteration, selection, and sequence. Command words are reserved by the computer to perform specific tasks. Variables come in different data types like strings for text, integers for whole numbers, and booleans for true/false values. Identifiers for data must be declared with proper data types and meaningful names for the program to run properly.

Uploaded by

Habiba Hussain
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Programming Constructs and Techniques

Programming constructs and techniques include common building blocks like iteration, selection, and sequence. Command words are reserved by the computer to perform specific tasks. Variables come in different data types like strings for text, integers for whole numbers, and booleans for true/false values. Identifiers for data must be declared with proper data types and meaningful names for the program to run properly.

Uploaded by

Habiba Hussain
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Programming constructs and techniques

A programming language construct is a part of a program that can be made


from one or more lexical tokens in accordance with the rules of the
programming language. These programming constructs are buildings blocks
which is used to create programs.
There 3 common building blocks that are mostly used these are:
Iteration – this is a repeated execution of a section of code when a program is
working.
Selection – controls which path the program takes while it is running.
Sequence – this is a set of instruction that is done and processed in a order.

Command words
Commands words are orders used to tell what the computer need to perform.
Such as “save and close” the computer will do exactly what the command is.
Programmers are not allowed to use command words to name things. The
computer already has reserved command words which it understands if you
tell a computer to do something out of the ordinary it is most likely that it will
perform.
Data types
Variables come in a variety of sizes and shapes. Some are used to store text,
some are used to store numbers, and some are used to store data that is far
more complex. This allows the compiler or interpreter of the programmer's
intended usage of the data.
String (text) - used to refer to a sequence of any keyboard characters, including
letters, numbers, and symbols.
Character - Used for single letters.
Integer - Used for whole numbers.
Float (or Real). Used for numbers that contain decimal points, or for fractions.
Boolean - Used where data is restricted to True/False or yes/no options.
Identifier
The base for how data is stored within a programme is made up of variables,
constants, and arrays. They must be declared with proper data types that fit
the data and meaningful identifier names. Programs won't run properly
without the appropriate data types and data structures.
The way to create a constant or a variable is to provide the programming
language with two things these are:
 A name
 A data type
It is simpler for the next developer to grasp the code if the variables, constants,
and  have meaningful names.

You might also like