The document discusses problem solving techniques for computer programs. It begins by explaining how humans and computers solve problems differently, with computers needing step-by-step instructions. It then covers types of programming languages, the role of compilers, and tools for expressing algorithms like pseudocode and flowcharts. An example of adding two numbers is provided in pseudocode and a flowchart. The implementation phase translates the algorithm into an actual program using a programming language and development tools.
1. Lab 1
CS106 - Fundamentals of Computer Science
Presented by TA. Nada Kamel
2. Agenda
Types of programming languages
Difference between High and Low programming languages
What is a Compiler?
Problem Solving Techniques
Pseudo code
Algorithm
Flow chart
Example
Implementation
Presented by TA. Nada Kamel
3. How People solve problems
A Problem exists when what we have (Data) is not the same as what we
want (Information)
People create a solution (called an Algorithm) which manipulates Data into
Information
People do this quickly and often in a complex way
Presented by TA. Nada Kamel
4. How Computers solve problems
Computers also use Algorithms to solve problems, and change data into
information
Computers can only perform one simple step at a time
Complex “Human” Algorithms must be broken down into simple step-by-
step instructions BEFORE they can be translated into computer code
Presented by TA. Nada Kamel
6. Types of programming languages
There are two types of programming languages based on the code or
syntax they use..
Low Programming Language
High Programming Language
Presented by TA. Nada Kamel
7. Difference between programming
languages
The difference between them is on the way we write their code.
For example, Assembly is a low-level language where the user writes code
which is almost identical to the one computers understand.
Presented by TA. Nada Kamel
8. High Programming Language
A high-level programming language uses a more natural and human-
readable syntax which makes it easier for humans to understand and write.
Today, most programmers use some sort of a high-level language,
because it is much easier to learn and understand and often requires much
less work. For example, C++, C#, Java, e.t.c.
Presented by TA. Nada Kamel
9. What is a Compiler?
Presented by TA. Nada Kamel
10. Editor
Presented by TA. Nada Kamel
Source file Compiler
Linker
Object file
Other
object files
Executable
file
Loader
11. Tools
Editor to be used:
Microsoft Visual Studio Windows
Xcode Mac
Presented by TA. Nada Kamel
12. Programming Phases
A typical programming task can be divided into two phases:
Problem solving phase
Produce an ordered sequence of steps that describe solution of problem
This sequence of steps is called an algorithm
Implementation phase
Implement the program in some programming language
Presented by TA. Nada Kamel
14. Problem Solving
Problem Solving is the ability to understand what you have, what you
want, and creating a set of instructions to change what you have into what
you want
Good Problem Solving Skills are based on knowledge, experience and
logic
Good Programmers NEVER make assumptions
Presented by TA. Nada Kamel
15. Expressing an algorithm
A “Standard” way of describing an algorithm must exist if we expect our
solution to be understood by others easily
There are standards in programming:
PSEUDOCODE
FLOWCHARTS
PROGRAMMING LANGUAGE
Presented by TA. Nada Kamel
16. Pseudo Code
“Pseudo” means “pretend” or “false”
Pseudo Code is pretend or false computer code; generic English-like terms
that are somewhat like computer code
Pseudo Code is not as standardized as flowcharts, and does not facilitate
the breaking down of problems as well as a flowchart does
Presented by TA. Nada Kamel
17. Flowchart
Graphical representations of algorithms
Tool to translate algorithms into software
A Flowchart uses easy-to-understand symbols to represent actions on data
and the flow of data
Flowcharts aid in breaking down a problem into simple steps
Presented by TA. Nada Kamel
25. Implementation
The code is divided into two parts:
Libraries (such as <iostream>, <iomanip>, …)
Body
Declaration (int, float, char, string)
User Input (cin)
Processing
Output (cout)
Presented by TA. Nada Kamel
26. How to write the code of the
problem?
Presented by TA. Nada Kamel