0% found this document useful (0 votes)
4 views19 pages

Week 2 - Algorithms & Programming

Uploaded by

ranamz89
Copyright
© © All Rights Reserved
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
0% found this document useful (0 votes)
4 views19 pages

Week 2 - Algorithms & Programming

Uploaded by

ranamz89
Copyright
© © All Rights Reserved
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/ 19

PROBLEM SOLVING,

ALGORITHMS &
PROGRAMMING
LANGUAGES
Learning Objectives

 Understand Programming Language


 Learn about problem solving skills
 Explore the algorithmic approach for problem solving
 Learn about algorithm development
 Block Based & Text Based Programs
Programming Language

 A programming language turns human ideas into something


a computer can understand
 It gives us the tools and rules to solve problems in a way
computers can read
 Solving problems with code involves starting simple, testing,
improving, and refining
 Automation uses code to do tasks automatically, saving
time and effort
PROBLEM SOLVING, ALGORITHM,
PROGRAM
PROBLEM SOLVING, ALGORITHM,
PROGRAM
WHAT IS AN ALGORITHM?

 The idea behind the computer program


 Solves a problem in a general way
 Before a computer can perform a task, it must have an
algorithm that tells it what to do.
 Informally, an algorithm is a set of steps that define how a
task is performed.
 Is specified by
 Input needed
 Steps/Process to be followed
 Desired Output
WRITE AN ALGORITHM TO FIND OUT TOTAL
AMOUNT OF
TWO NUMBERS A & B

  Start
  Read number A
  Read number B
  Sum X = A+B 
  Print X
  End
WRITE AN ALGORITHM TO FIND OUT CALCULATING THE
TOTAL NUMBER OF FRUITS (APPLES AND BANANAS) AND
THEN PRINTING THE RESULT

  Start
  ?????????????????????/
  End
WRITE AN ALGORITHM TO FIND OUT CALCULATING THE
TOTAL NUMBER OF FRUITS (APPLES AND BANANAS) AND
THEN PRINTING THE RESULT

  Start
  Read number of apples
  Read number of bananas
  Calculate total fruits = apples + bananas
  Print total fruits
  End
WRITE AN ALGORITHM THAT PRINTS THE AREA OF
THE RECTANGLE(A) GIVEN WIDTH(W) AND
LENGTH(L).

  Start
 ???
  End
TEXT & BLOCK BASED PROGRAMMING
TEXT & BLOCK BASED PROGRAMMING

 Text-Based Programming: You write instructions for


the computer using words and symbols, similar to
typing a sentence. It's more detailed and requires
you to know the exact commands.

 Block-Based Programming: You create programs by


snapping together colorful blocks, like building with
LEGO. Each block represents a specific action,
making it easier to understand and learn, especially
for beginners.
 What is an algorithm?
 A) A type of computer
 B) A step-by-step process to solve a problem
 C) A programming language
 D) A type of software
 Which of the following is an example of an
algorithm?
 A) Making a cup of tea
 B) Writing a book
 C) Both A and B
 D) Neither A nor B
 Which of the following is a text-based
programming language?
 A) Scratch
 B) Blockly
 C) Python
 D) Tynker
What does the command print("Hello,
World!")
do in a text-based language like
Python?
•A) Saves a file
•B) Displays "Hello, World!" on the screen
•C) Opens a new window
•D) Closes the program
 Which of the following is a block-based programm
platform?
 A) JavaScript
 B) HTML
 C) Scratch
 D) C+
 In block-based programming, how do you create
program?
 A) By writing lines of code
 B) By snapping together blocks
 C) By drawing diagrams
 D) By typing commands in a console
 In block-based programming, how do you create
program?
 A) By writing lines of code
 B) By snapping together blocks
 C) By drawing diagrams
 D) By typing commands in a console

You might also like