Day 1 - Programming Fundamental
flutterdevpawan
Posted on February 12, 2023
Programming Fundamentals
Thought process to solve a problem
- Understand the problem
- Check inputs in problem
- Final approach
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”
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
- 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
- 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
Problem statement on above two topics
Ex:
- Add 2 number by taking input
Flowchart
Step 1: start
Step 2: declear a, b, sum
Step 3: sum = a + b
Step 4: print sum
Step5: end
- Find circumference of a circle Flowchart
Step 1: start
Step 2: declear r, cir
Step 3: cir = 2 * 3.14 * r
Step 4: print cir
Step 5: end
- Check number is even or odd Flowchart
Step 1: start
Step 2: declear n
Step 3: if n % 2 = 0 then print even
Else print odd
Step 4: end
- Student and grade flowchart Flowchart
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
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
Posted on February 12, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.