Variable Rules and Flowchart
Variable Rules and Flowchart
A variable name can consist of Capital letters A-Z, lowercase letters a-z, digits 0-9, and the
underscore character.
The first character must be a letter or underscore.
Blank spaces cannot be used in variable names.
Special characters like #, $ are not allowed.
C++ keywords cannot be used as variable names.
Variable names are case-sensitive.
A variable name can be consisting of 31 characters only if we declare a variable more than one
characters compiler will ignore after 31 characters.
Variable type can be bool, char, int, float, double, void or wchar_t.
Algorithm Design
Flowchart
Flowchart is a graphical representation of an algorithm
Flowcharting is a tool developed in the computer industry, for showing the steps involved in a
process.
A flowchart is a diagram made up of boxes, diamonds and other shapes, connected by arrows -
each shape represents a step in the process, and the arrows show the order in which they occur
Flowcharting combines symbols and flowlines, to show figuratively the operation of an
algorithm
In computing, there are dozens of different symbols used in flowcharting (there are even
national and international flowcharting symbol standards)
Flowcharting
Symbols There are 6 basic symbols commonly used in flowcharting of assembly language
programs: Terminal, Process, input/output, Decision, Connector and Predefined Process.
This is not a complete list of all the possible flowcharting symbols, it is the ones used most
often in the structure of Assembly language programming
1. Design an algorithm and the corresponding flowchart for adding the test scores as given
below: 26, 49, 98, 87, 62, 75
a) Algorithm
1. Start
2. Sum = 0
3. Get the first testscore
4. Add first testscore to sum
5. Get the second testscore
6. Add to sum
7. Get the third testscore
8. Add to sum
9. Get the Forth testscore
10. Add to sum
11. Get the fifth testscore
12. Add to sum
13. Get the sixth testscore
14. Add to sum
15. Output the sum
16. Stop
Pseudocode
Pseudocode is one of the tools that can be used to write a preliminary plan that can be
developed into a computer program
Pseudocode is a generic way of describing an algorithm without use of any specific
programming language syntax.
It is, as the name suggests, pseudo code —it cannot be executed on a real computer, but
it models and resembles real programming code, and is written at roughly the same
level of detail