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

General Programming Concepts

The document discusses general programming concepts and flow charting. It covers the basic components of computer organization, including input, storage, processing, output, control, and the CPU. It then discusses flow charting, noting that flow charts can help visualize, organize, and communicate programming logic. Examples of flow charts are provided, including one to calculate the sum of the first 50 natural numbers and another to find the largest of three numbers. Guidelines for effective flow charting are also listed.

Uploaded by

Alice Gheorghiu
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views

General Programming Concepts

The document discusses general programming concepts and flow charting. It covers the basic components of computer organization, including input, storage, processing, output, control, and the CPU. It then discusses flow charting, noting that flow charts can help visualize, organize, and communicate programming logic. Examples of flow charts are provided, including one to calculate the sum of the first 50 natural numbers and another to find the largest of three numbers. Guidelines for effective flow charting are also listed.

Uploaded by

Alice Gheorghiu
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

General Programming Concepts and Flow Charting

I will discuss here, basic programming concepts that are at the basis of any modern programming
language. Once we have these concepts well printed in mind, the transition to the modern computing
will be much easier.

A. Computer organization

1. Input: The input unit is the part that takes the raw data from us and prepares it for
processing.
2. Storage: In order for the CPU to process the data, it has to be placed in an area where
the CPU can take it and perform operations, as well as writing the results. Since the CPU
is very fast in executing these operations, the instructions have to be fed at the same
speed. We discussed in the Inside the Computer…link here – a few things about the
main memory.
3. Processing: The task of performing arithmetic and logical operations. For this action the
CPU takes data and instructions from the main memory and processes, and creates
meaningful information which is sent back to the Storage Unit (Main Memory).
4. Output: where the results produced by the computer after processing are kept before
being given in human readable form.
5. Control: takes care of step by step processing of all operations performed inside the
computer.
6. CPU: made of ALU (arithmetic logical unit –what the name implies –performs the 4
operations, logic and comparison, and returns results to storage unit for further
processing or simply to get stored) and CU (control unit determines the sequence in
which instructions should be executed, switch board for cases when more than one user
interacts with the computer simultaneously, issue signals to other units of the computer
for execution – the manager of all operations mentioned above).
Flowcharting

Since we are reviewing general concepts of programming, I was thinking to jump straight
into flow-charting and leave programming constructs (loops, if-then-else, goto, iterations
and cases) when I will present the programming languages that are common to the modern
technology. Not sure if this is for everyone, but I remember flowcharting since I was student
in College, and kind of put it aside ever since in designing the logic of my programs, and
that’s bad. At least for me it was. Even for OO paradigm, and UML languages, it is
important to be comfortable to represent the logic of any piece of complex code in a
diagram.

Flow Chart Elements

Start or end of the program

Computational steps or processing function of a program

Input or output operation

Decision making and branching

Connector or joining of two parts of program

Magnetic Tape

Magnetic Disk

Off-page connector

Flow line

Annotation

Display
Guidelines for flowcharting:

a. All necessary requirements should be listed in logical order.


b. The flowchart should be clear, neat and easy to follow with no ambiguity.
c. The direction of the flow of a procedure or system is either from left to right or top to
bottom.
d. Only one flow line should come out from a process symbol.

or

e. Only one flow line should enter a decision symbol, but two or three flow lines, one for
each possible answer, should leave the decision symbol.

f. Only one flow line is used in conjunction with terminal symbol.

g. Write within standard symbols briefly. As necessary, you can use the annotation symbol
to describe data or computational steps more clearly.

h. If the flowchart becomes complex, it is better to use connector symbols to reduce the
number of flow lines. Avoid the intersection of flow lines if you want to make it more
effective and better way of communication.
i. Ensure that the flowchart has a logical start and finish.
j. It is useful to test the validity of the flowchart by passing through it with a simple test
data.

The usage of flow-charting is beneficial as it helps visualize, organize, and communicate


business logic as it applies in the programming model. I also help to write efficient code,
to do proper debugging and easier maintenance of the code.

It is limited to cases where the logic is simple. When there’s more complexity other
types of models may be required. (We’ll take a look at Unified Modeling Language). The
essentials of what is done are sometimes lost in the details of how it is done. Never the
less it is a good starting point for any new program or enhancements to other programs.

2 Examples:

Fig. 25.2 Sum of first 50 natural numbers


Fig 25.3 Flowchart for finding out the largest of three numbers

You might also like