lab task 1 questions

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Programming Fundamentals Lab 01

Task 1:
Find out which programming languages are available to us. What is the history of these
Programming Languages and What are the differences among them? Here is how you can do them:

1. Individuals will search over the internet.


2. Any student will be asked to report the findings to the class.

Flow Charts
A flowchart is a pictorial description of an algorithm. The flowchart outlines the structure and logic of
the algorithm and the sequence of operations to be followed in solving the problem. A flowchart is
composed of a set of standard symbols, each of which is unique in shape and represents a particular
type of operation. The symbols are connected by straight lines called flowlines. These usually contain
arrows to indicate the order in which the operations are performed. A flowchart provides a means of
organizing our thinking about a problem solution. Because flowcharts provide pictorial
representations of the steps that are to be followed, they assist in both the development and
communication of the logic of the problem solution. They are also helpful in detecting and correcting
errors in logic and developing more efficient structures.

A flowchart is useful for complicated programs which contain numerous branches since it can depict
the interrelationships between the various branches and loops. Flowcharts also allow us to quickly
test several alternative solutions to a problem since it is much easier to draw the flowchart than to
write the program. Once a flowchart has been developed, the task of writing the program is greatly
simplified.

Finally, a flowchart is an excellent vehicle for documenting a program. It provides a convenient means
of communication between both programmers and non-programmers. This is important during the
development of a program, especially when several people are working on the same project. Since a
flowchart is not dependent on a particular programming language, it can be understood by another
programmer and by people who have limited knowledge of programming. This can be of great benefit
during later maintenance and use of the program.

In summary, a flowchart is an analytical tool and is useful for documentation and as a communication
device.

Flow Chart Symbols


The symbols used in flowcharts have been standardized by the American National Standards Institute.
Arrows are used on the connecting flowlines if the direction of flow is not clear. A flowchart should
have one start and one or more stop points and should be arranged so that the direction of processing
is from top to bottom and from left to right. Although flowlines can cross, the crossing flowlines are
independent of each other. Whenever possible, crossing of flowlines should be avoided, since it makes
the flowchart difficult to read. Following figure shows the various flowchart symbols and the operation
that they represent.
Terminal Symbol
The terminal symbol, which is oval shaped, represents start and end points of an algorithm. The words
START and STOP or END are usually placed as narratives within the start and end symbols, respectively.
Typically, there is only one starting point, but there may be more than one end points, one to indicate
the end of normal processing and others to indicate an exit resulting from one or more unrecoverable
error conditions.
Input/Output Symbol
Both input and output operations are represented by a parallelogram tilted to the right. The nature of
the operation to be performed is indicated by including the terms READ and INPUT to denote input
operations and the terms PRINT and WRITE to denote output operations.

Processing Symbol
The rectangular processing symbol is used to indicate operations involving arithmetic and data
manipulation. This symbol is also used to represent a collection of statements that perform
computations.

Decision Symbol
The diamond-shaped decision symbol is used to indicate a point in the algorithm at which a branch to
one or more alternative paths is possible. The condition upon which each of the exit paths will be
executed is identified within the diamond shaped symbol. Also, flowlines leaving the corners of the
diamond are labeled with the decision results associated with each path.

On-page Connector
A small circle is used to indicate a connection between two points on the same page in a flowchart.
For complex programs containing numerous branches and loops, the number and direction of
flowlines can result in confusion. In such situations connectors are used to replace flowlines.
Whenever possible, connectors should be used instead of flowlines. Connectors are used in pairs, one
indicating an exit from and the other an entry to a point in a flowchart. The connector pairs are
identically labeled.

Off-page Connector
Off-page connectors are used to connect flowcharts that are too large to fit on one page. They
represent an entry, or an exit from, a point in a flowchart on a different page. As with on-page
connectors, they appear in identically labeled pairs.

Task 2
Draw a flowchart to take two inputs from the user, identify if they are equal and print the relevant
result (“Equal” if number are same and “Not Equal” if the numbers are different)

Task 3
Draw a flowchart for a C++ program that takes input for the length and width of a rectangle and then
calculates and outputs its area.

Hint: Area of rectangle is L*W

You might also like