100% found this document useful (1 vote)
1K views13 pages

Programming Fundamentals - Designing Solution

The document discusses algorithms and how to design and write computer programs to solve problems. It provides examples of algorithms to calculate the average of two numbers, find the area of a circle, add two numbers, and find the maximum of two numbers. It also discusses using pseudo code and flow charts to design algorithms and the steps to compile and execute a computer program in C. Finally, it suggests topics for further research and algorithms to solve problems involving mixing water in jugs and finding a heavier ball using a balance scale.

Uploaded by

Rehan Chaudhry
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
1K views13 pages

Programming Fundamentals - Designing Solution

The document discusses algorithms and how to design and write computer programs to solve problems. It provides examples of algorithms to calculate the average of two numbers, find the area of a circle, add two numbers, and find the maximum of two numbers. It also discusses using pseudo code and flow charts to design algorithms and the steps to compile and execute a computer program in C. Finally, it suggests topics for further research and algorithms to solve problems involving mixing water in jugs and finding a heavier ball using a balance scale.

Uploaded by

Rehan Chaudhry
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 13

By computers

Algorithm
An algorithm is the sequence of steps taken to solve a problem
Steps and their sequence of execution is important

Before starting to write a computer program, design the solution/algorithm


Using pseudo code Using flow chart

Algorithm to calculate average of two numbers given by user Take input in a Take input in b average = (a+b)/2 Output average

1. 2. 3. 4.

start

Algorithm to calculate average of two numbers given by user

Input a

Input b

Avg = (a+b)/2

Print Avg

Stop

wiley.com

Area of a circle Add two numbers given by user as input Tell maximum of two numbers given by user

Compile
Go to command prompt
The black window
Dos shell

gcc test1.c o test1

Execute
test1

Research and Find out Solution about below real life issues
Carbon Footprints Calculator BMI Gender Neutrality

Write pseudo code and Draw flow chart for below problems
You have two jugs 1 has a 5 liters capacity and the other has 3 liters . They both have irregular shapes that means you cannot tell by simply looking how full the jugs are unless you fully fill them up with water. How would you obtain 4 liters of water using the two jugs? (Two ways) You have 8 pool balls. The problem is, one of them is heavier than the rest. You have two attempts to find the heavier ball using a weight balance. Now show me how to do it!

You might also like