Search This Blog

Monday, May 27, 2013

Programming Logic and Techniques


Lesson #1

Tutorial Details

Program : Information Technology Fundamentals
Difficulty : Beginner
Estimated Completion Time : 7 min.


About this tutorial

Are you thinking to start learning any programming language lick C, C++, C#, php or any other you like but finding very difficult to understand and not able to write single piece of code? then what to do? The solution of this is you have to learn the technique to write a code in any programming language.We call it as a Programming Logic and Techniques.

This tutorial provides you the ability to write a program using your MIND, your logic and teach you the technique that help you to solve your Programming problems.

This tutorial can be helpful to anyone who planning to enter in the world of Information technology.



PLT Lesson #1

Objectives :

  • input process and output [I-P-O]
  • technique to solve problem
  • flowchart


Introduction

If you reading this introduction part then I assume that you might be used Google’s search engine, or facebook, or simple you have seen the making of TEA or COFFEE? At each of this place you inter some value   (In Google search engine text field you inter query about facebook, In facebook’s sign in text field you inter you username and password, and while making TEA or COFFEE you have to enter some tea/coffee powder, milk[optional], water,sugar etc. ) and by end of processing you will get the desire output (Search result by Google, User frofile page by facebook and the finally you testy Tea.)

Input-Process-Output Cycle



In real life all activity follow IPO cycle like communication (listening==Input, thinking==Processing, and according to that Speaking== Outputting ) and which ever you think all real life scenario fit in this cycle.Same scenario also apply for computer and its several components such as keyboard, mouse, monitor, printer and your CPU chip.Each component either use for input,process or output phase.

Some Example :

google search Input Process Output



If are you looking for something to search then you go to Google website and Input some text, image, or video to search for.According to your inputted string Google will process your string and look it into their database, and after processing Google shows result to the end user(Means U).

Technique to solve problem

To solve any problem what will you do? We generally simplify it by converting from complex to simple form.In a programmer’s point of view to start writing a program or any algorithm in a sequence of steps required to solve a problem. So we convert any problem to flowchart.

Flowchart Symbols

Flowchart is a graphical representation of the steps to be followed for solving a problem.Each symbol represents a specific activity.In general problems involves decision,processing, input and output to solve problems.




Descriptions
Symbols
Terminator – indicates beginning or the end of the flowchart. Picture1
Processing Picture2
 Output Picture3
 Input Picture4
 Decision – IT is use to evaluate condition. Picture5
 Predefined process – act as the building blocks of a program. Picture6
 Flow Lines – Connect the steps of the flowchart and indicate the sequence in which the steps are to be performed.This should be from top to bottom or left to right. Picture7
 On Page Connector – is used to connect one step in flowchart to another step on the same page. Picture9
 Off Page Connector – is used to connect one step in flowchart to another step on a different page.  Picture10


Symbol Used in a Flowchart.
We use these symbols to draw flowcharts.



Lesson #2

Tutorial Details

Program : Information Technology Fundamentals
Difficulty : Beginner
Estimated Completion Time : 5 min.


How to draw Simple Flowchart

In this tutorial you will learn to how to use and draw flowchart symbols in a programming language problems and get the proper way to solve it.In Lesson #1 you have seen all flowchart symbols.


Example #1


What are the steps involved in preparing tea?
Confuse? why I’m asking this question to you? Is it related related to programming?
my answer is yes… this is all related to programming. Let’s first note down all steps for that in I-P-O way.

  1. We input all required ingredients ( Water and tea powder, sugar**, milk** ) one by one in container. (Input)
  2. Now we boil the all ingredients together and wait for processing. (Process)
  3. After completion of tea processing you will get the output ie. a cup of tea. (Output)

**  indicates some people want sugarless tea, or black tea.


flowchart for preparing a tea


Example #2


What are the steps involved in Google Search?
You may thinking that after making tea why I’m directly switching to such a complex programming.
No I am not going to tell such a complex program. Here we’ll just just discuss about it’s simple working flow.

  1. Type some query string ( for eg. “Harry potter”) in Google’s query text field. (Input)
  2. Google pass that string to their server and process your inputted query and according to that collect search result.(Process)
  3. After getting desire result Google pass that result to the end user. (Output)

flowchart for Google Search.


Example #3


What are the steps involves in adding two numbers?
Now we can move some real programming language problems.

  1. Inter both number one by one. (Input)
  2. Add both number.(Process)
  3. Display addition of two number. (Output)


Flowchart for adding two number



Example #4

Try some flowchart for yourself!!!


  • Draw a flowchart for showing sequence of multiplication of 2 number?
  • Draw a flowchart for showing sequence of inputted number multiply by 5 numbers?


No comments:

Post a Comment