lab task 1 questions
lab task 1 questions
lab task 1 questions
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:
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.
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.