Documente Academic
Documente Profesional
Documente Cultură
(CS118)
Week – 01
Aug 19-24, 2019
Instructor: Basit Ali
Chapter 1: General Problem - Solving Concepts
Course Outline
❖ Problem modeling, Algorithm analysis, Basic Flowchart and block diagram
❖ Data Types, Basic programming with algorithm, flow chart.
❖ Control structures: if-else, nested-if
❖ Switch case, Loops: For, While, do-while
❖ Nested loop, Functions
❖ Introduction to Array(1- dimensional)
❖ Multiple subscripted arrays and strings
❖ Introduction to Pointers, Pointers to array and double pointers.
❖ Dynamic Memory Allocation, Pointers functions and void pointers
❖ Introduction to Structures, Structure array and pointer to structures
❖ Union and Bitwise operators
❖ File Processing
❖ File Processing(Binary and Text files), Revision(structures, Pointers, Arrays)
Objectives
❖ Getting acquainted with problem understanding, modeling and
solving.
❖ Understanding the concept of Programming Languages.
❖ Two major areas to be covered:
● Computation and problem solving
● Implementation in C language.
❖ Design and implement algorithms to solve real world problems.
Books
1) “Problem Solving, Programming concepts”, 9th edition,
Sprankle and Hubbard
2) “How to Program C” , 7th edition, Deitel & Deitel
Reference Books:
1) “Let us C”, 5th edition, Yashavant P. Kanetkar.
Assessments / Grading (Tentative)
Mid-1 10
Mid-2 10
Quizzes 10
Assignments 10
Project 10
Final Exam 50
Chapter 1
2. Understand the
problem 3. Identify alternatives
Consider the knowledge a. Watch television.
base of the participants . b. Invite friends over.
1. Identify the problem.
Select solutions that c. Play video games.
How do the individuals everyone involved would
wish to spend the know how to do. d. Go to the movies.
evening? e. Play miniature golf.
a game of chess, if the
participants did not know f. Go to the amusement
how to play. park.
g. Go to a friend’s party.
The problem of what to do this evening
4. Select the best way to
solve the problem. 5. Prepare a list of steps 6. Evaluate the solution.
a. Weed out alternatives that
are not acceptable, such as (instructions) that will Are we having fun yet?
those that cost too much result in a fun evening.
If nobody is having fun,
money or do not interest one
then replan.
of the individuals involved.
See if anything can be
b. Specify the pros and cons of
changed, if not then the
each remaining alternative.
process must start again.
c. Weigh the pros and cons to
make the final decision
Types of problems
Problems with algorithmic solutions
❖ Solutions that cannot be reached through a direct set of steps are called
heuristic solutions.
❖ Example: how to buy the best stock or whether to expand the company
Problem solving with computers
Computer Problem solving
❖ Poor training
The problem-solving process is not
❖ Afraid to make decisions
easy.
It takes practice and time to perfect
❖ Incorrect problem definition