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

Chapter 3

Chapter 3 CA

Uploaded by

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

Chapter 3

Chapter 3 CA

Uploaded by

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

CHAPTER 3

Principles of programming and problem solving


Approaches in Problem Solving
• Top-Down Design:

• Start with the big picture: You first identify the main task
or problem.
• Break it down: Divide the task into smaller sub-tasks or
components.
• Develop details later: You focus on the higher-level
structure first and gradually fill in the details.
• Example: If you're building a website, you first think of the
overall structure (home page, about page, contact page),
then decide what each page should contain.
Bottom-Up Design:

• Start small: You begin by creating small, specific


components.
• Build upwards: These small pieces are then combined
to form more complex systems.
• Focus on details first: You create the details first, and
then use them to form the larger program.
• Example: If you're building a website, you first create
individual elements (buttons, forms) and later combine
them to build the entire site.
Phases in programming
Algorithms
.Step by step instructions to solve a problem.

Characteristics

•Accept Inputs: An algorithm should start by taking inputs or processing given data.
•Use Variables: Variables are used to store and manipulate data, similar to math.
•Precise Instructions: Each step must be clear and possible to carry out.
•Basic Steps: Instructions should be simple enough to be done by hand.
•Finite Time: The algorithm must complete in a reasonable amount of time.
•Produce Output: The algorithm should give the desired result at the end
Flowcharts
• Advantages of flowcharts
• Better communication

• Effective analysis

• Effective synthesis

• Efficient coding
Disadvantages
• time consuming and laborious to draw

• Modification means redrawing

• no standards
Exit Controlled Loop and Entry
Controlled Loop
Coding the program
• The program written in any HLL is known as source
code.

• The process of writing program instructions to solve a


problem is called coding.
Translation
• Translation is the process of converting a program
written in high level language into its equivalent version
in machine language.
Debugging
• Programming errors are known as 'bugs' and the
process of detecting and correcting these errors is
called debugging.
Different Types of Errors
• Syntax errors result when the rules or syntax of the
programming language are not followed.

• logical error, is due to improper planning of the


program's logic
Execution and testing and
Documentation
• We can write comments in the source code as part of
documentation. It is known as internal documentation

• While developing software for various applications,


these manuals are mandatory. This kind of
documentation is known as external documentation.

You might also like