[go: up one dir, main page]

0% found this document useful (0 votes)
47 views11 pages

C++ Programming: Academic Year 2018-2019 Lecturer Zanco A. Taha (MSC.)

The document provides lecture outlines for a C++ programming course covering introduction to flowcharts and algorithms. It defines flowcharts as graphical representations of program steps that help understand logic. Examples show flowcharts for calculating the sum and average of two numbers and finding the largest of two numbers. Algorithms are defined as well-defined procedures that allow computers to solve problems systematically. Examples provide algorithms for finding the average and largest of two numbers. Homework asks students to write an algorithm and flowchart for finding the area of a rectangle and the max of 3 numbers.

Uploaded by

Rahel Sabr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views11 pages

C++ Programming: Academic Year 2018-2019 Lecturer Zanco A. Taha (MSC.)

The document provides lecture outlines for a C++ programming course covering introduction to flowcharts and algorithms. It defines flowcharts as graphical representations of program steps that help understand logic. Examples show flowcharts for calculating the sum and average of two numbers and finding the largest of two numbers. Algorithms are defined as well-defined procedures that allow computers to solve problems systematically. Examples provide algorithms for finding the average and largest of two numbers. Homework asks students to write an algorithm and flowchart for finding the area of a rectangle and the max of 3 numbers.

Uploaded by

Rahel Sabr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Ministry of Higher Education Computer Department

Noble Institute 1st Stage

C++ Programming
Academic Year
2018-2019

Lecturer
Zanco A. Taha (MSc.)
Lecture Outlines
1. Introduction To Flowcharts
2. Introduction To Algorithms

2
Introduction to flowcharts
• A flowchart is a graphical representation of a program steps.
These flowcharts play a vital role in the programming and
are quite helpful in understanding the logic of complicated
and lengthy problems.

• flowchart is a must for the better documentation of a


complex program.

3
Flowchart Symbols

4
Flowchart Examples- Sum Of Two Numbers

Sum

5
Flowchart Examples- Average Of Two Numbers

6
Flowchart Examples- Finding Largest of 2 Numbers

Yes No

7
Introduction to Algorithms
• It is a well-defined procedure that allows a computer to
solve a problem.

• Systematic logical approach used to solve problems in a


computer.
Algorithm Example-1
Algorithm for finding the average of two numbers:
Input: two numbers x and y
Output: the average of x and y
Steps:
input x
input y
sum = x + y
average = sum /2
print average
Algorithm Example-2
Algorithm for finding the Largest of two numbers:
Input: two numbers x and y
Output: the Max of x and y
Steps:
input x
input y
If x > y
print x
Else
print y
Homework

Q1/Write an algorithm for finding the area of a rectangle


Hints:
• define the inputs and the outputs
• define the steps
• draw the flowchart

• Q2/Write a flowchart and an algorithm for finding the max of


3 numbers.

You might also like