0% found this document useful (0 votes)
5 views

University Assignment2

what is flow chart? why use it.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

University Assignment2

what is flow chart? why use it.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Assignment:2

Programming Fundamentals

1.what is flow chart?why we use it.

 History of Flowcharts.
Frank Gilberth introduced flowcharts in 1921, and they were called “Process Flow

Charts” at the beginning. Allan H. Mogensen is credited with training business people on

how to use flowcharts.

 What is a Flowchart
A flowchart is a visual representation of a process or algorithm. It uses different
shapes and symbols to represent various steps or actions in a sequence.
Flowcharts are commonly used in software development, business processes,

and various other fields to illustrate the flow of activities.

 Why we use it.


 Visualization of Logic:
o Flowcharts provide a visual representation of the logical flow of a program. This
can be especially helpful for understanding complex algorithms and processes,
both for programmers writing the code and for others who may need to review or
maintain the code.
 Algorithm Design:
o Flowcharts are commonly used during the design phase of software development to
plan and illustrate the structure of an algorithm. They help programmers in
organizing their thoughts and refining the logic before translating it into actual
code.
 Communication:
o Flowcharts serve as a communication tool. They allow programmers to
communicate their ideas and algorithms to team members, stakeholders, or
anyone involved in the software development process. Flowcharts can be easier to
understand than written code, especially for individuals who are not necessarily
programmers.
 Debugging:
o When encountering issues in a program, flowcharts can aid in the debugging
process. By following the flow of the program visually, programmers can identify
potential areas of concern or logical errors.
 Documentation:
o Flowcharts can be part of the documentation for a software project. They provide a
high-level overview of the program's structure and logic, making it easier for
others (or even the original programmer after some time has passed) to
understand and maintain the code.
 Education and Training:
o Flowcharts are used as educational tools to teach programming concepts and logic.
They help students understand the flow of control in algorithms and how
decisions are made within a program.
 Planning and Analysis:
o Before writing code, it's often beneficial to plan and analyze the structure of a
program. Flowcharts help in breaking down a problem into smaller, manageable
steps, allowing for a more systematic approach to coding.

2.Define all shapes use in flow chart.

Flow line
Indicates the flow of logic by connecting symbols.

Terminal(Stop/Start)
Represents the start and the end of a flowchart.

Input/Output
Used for input and output operation.

Processing
Used for arithmetic operations and data-manipulations.

Decision
Used for decision making between two or more alternatives.

On-page Connector
Used to join different flowline

Off-page Connector
Used to connect the flowchart portion on a different page.

Predefined Process/Function
Represents a group of statements performing one processing task.
Examples of flowcharts in programming 1. Add
two numbers entered by the user.

2. Find the largest among three different numbers entered by the user.
3.Draw a flow chart of if statement.

Flowchart for if statement


Example of if statement
C++ program to check percentage of a student and display pass if it is greater than 40.
#include <iostream>

#include <conio.h> using

namespace std; int main()

{ float percent; cout<<"Enter your

percentage: "; cin>>percent; cout<<"You

scored "<<percent<<"%"<<endl; if

(percent>=40)

cout<<"Congratulation: You have passed";

getch();

return 0;

4.Write a program to find a number is even or odd using if statement

You might also like