LESSON 4 Flashcards
are used for storing texts.
Strings
contains a collection of characters surrounded by double quotes.
string variable
To use strings, you must include an additional header file in the source code,
include <string></string>
To get the length of a string, use the _________ function.
length ()
==
!=
>
>=
<
<=
equal to
not equal to
greater than
greater than or equal to
less than
less than or equal to
!
&&
||
Logical NOT
Logical AND
Logical OR
Logical Exclusive OR (XOR)
means that it should produce correct and faster results, taking into account all the memory constraints.
Good Program
4 Characteristics of Good Programming
1) Clarity and Simplicity of Expression
2) Use of proper names for identifiers
3) Comments
4) Indentation
Expressions are use to implement a particular task. It is a combination of Operators, Operands, and Constants. Any expression used in the program should be understood by the user.
1) Clarity and Simplicity of Expression
Identifiers are user defined names. They are use to name things. A name is associated with a function or data object (constants and variables) and used to refer to that function or data object. Identifiers are made up of letters (A-Z, a-z), digits (0-9), and the underscore character ( _ ). They, however, must begin with a letter or underscore and not with a digit.
2) Use of proper names for identifiers
They are usually added with the purpose of making the source code easy to understand. Hence, add ___________to your code in simple English language that describes the function of the code and the reason for your decision to do it in a particular way as well.
3) Comments
Leading white space (spaces and tabs) at the beginning of each statement, which is used to determine the group of statements, is known as _________.
- Indentation
A computer program should have some important characteristics, which are as follows :
1) Flexibility
2) User Friendly
3) Portability
4) Reliability
5) Self-Documenting Code
A program should be _______ enough to handle most of the changes without having to rewrite the entire program.
Flexibility; flexible
A program that can be easily understood by a beginner is called
2) User-Friendly