DEV Community

flutterdevpawan
flutterdevpawan

Posted on

Day 1 - Programming Fundamental

Programming Fundamentals
Thought process to solve a problem

  • Understand the problem
  • Check inputs in problem
  • Final approach

Image description

Flowchart
Flowchart is a graphical representation of an algorithm. Programmers often it use as a program planning tool to solve a problem. It makes use of symbols which are connected among them to indicate the flow of information and processing. The process of drawing a flowchart for an algorithm is known as “Flowchart”

Component of flowchart
Image description

Pseudocode
Pseudocode is a detailed yet readable description of what a computer program or algorithm must do expressed in a formally-styled natural language rather than in a programming language. Pseudocode is sometimes used as a detailed step in the process of developing a program.

Ex

  1. Write a pseudocode for difference of two number
Step 1: start
Step 2: declear a, b and diff
Step 3: read a and b
Step 4: diff = a – b
Step 5: end
Enter fullscreen mode Exit fullscreen mode
  1. Write pseudocode to print average of 2 values
Step 1: start
Step 2: declear a, b and avg
Step 3: read a and b
Step 4: avg = a + b / 2
Step 5: end
Enter fullscreen mode Exit fullscreen mode

Problem statement on above two topics

Ex:

  1. Add 2 number by taking input

Flowchart

Image description
Pseudocode

Step 1: start
Step 2: declear a, b, sum
Step 3: sum = a + b
Step 4: print sum
Step5: end
Enter fullscreen mode Exit fullscreen mode
  1. Find circumference of a circle Flowchart

Image description
Pseudocode

Step 1: start
Step 2: declear r, cir
Step 3: cir = 2 * 3.14 * r
Step 4: print cir 
Step 5: end
Enter fullscreen mode Exit fullscreen mode
  1. Check number is even or odd Flowchart

Image description
Pseudocode

Step 1: start
Step 2: declear n
Step 3: if n % 2 = 0 then print even
      Else print odd
Step 4: end
Enter fullscreen mode Exit fullscreen mode
  1. Student and grade flowchart Flowchart

Image description
Pseudocode

Step 1: start
Step 2: read n
Step 3: if n >= 90 then print A
          Else if n >= 80 then print B
      Else if n >= 60 then print C
    Else if n >= 40 then print D
    Else print F
Step 4: end
Enter fullscreen mode Exit fullscreen mode

Homework ( In this homework you only need to draw flowchart and write pseudocode of following questions )

  • Multiply 2 number by taking input
  • Find parimeter of a Triangle
  • Find Simple Intrest
  • Print counting from N to 1
  • Find Factorial of a number
  • check prime or not
  • valid triangle or not
  • printing 1 to n but only even numbers
  • print max of three numbers

Top comments (0)