Wednesday, June 2, 2021

Think like a programmer

The program means to solve the problems by giving list of instructions to computers!

What are the steps in solving the problem?

  1. Define
  2. Break the problem into smaller parts and analyze.
  3. Plan the steps for solution
  4. Implement the solution.

This list of instructions is called as sequences.

For our all day-to-day situations, we create sequences and then implement it automatically.

The sequences are the way human brain works or forms when it finds any problem with its solution.

For example Tom’s feeling hungry?

Tom’s steps or sequences:

  1. Open the fridge
  2. Get the food out
  3. Close the fridge
  4. Eat the food

Done!

We use similar sequence of steps in programming.

Let us see some more examples or tasks where sequences are needed:

  1. Visiting a General Store
  • Ask the Store owner: Grocery is there?
  • If yes, ask for the listed items are available and their prices.
  • If satisfied, ask store owner to pack them all.
  • Pay the final bill and carry the Grocery to home.

 

  1. Paying School Fees of a Child
  • Visit the School Office and ask child’s fees details to clerk.
  • Go to Cash counter, pay the fees and get the receipt.
  • Show the receipt to the clerk, and ensure the paid entry

 

  1. Saying what’s the Time now?
  • Person asks the time please?
  • Open the mobile, tap the screen
  • See the time and tell him or show the mobile screen to him.

 

  1. Changing TV Channel
  • Take the TV Remote in hand.
  • Check presently which channel is running on TV.
  • Decide how to move to your desired channel.
  • Directly press the desired channel number on TV Remote
  • Or press menu button, navigate to desired channel and press OK.

Finally the simple, yet famous sequence to make a burger what would be the steps?

  1. Take two buns
  2. Place Patty and Veggies over a bun
  3. Place the other bun over the first bun.

Summary

The computers works using programs and programs are sequence in which set of instructions are involved.

So, programs are nothing but sequence of instructions.

The programming is solving a problem with steps of instructions.

PS: I have composed this post-series based on my pdf eBook on playstore:

Basics of Computer, Programming and C

The series is posted continuously one each next day, and reader can found any post by referring blogs’ time line tab.

--till next post, bye-bye and take care.

 

No comments:

Post a Comment