twitter
    The place where CEO's meet !

Friday, July 24, 2009

How to master programming?

 Learning Computer Programming is a common need for people today. You may need C, C++ or VB Programming for your academic or you may be studying any independent Computer course for your future. Even after attending classes, if you are not able to master the programming, this material really helps you. The readers of this material are assumed as beginners in Programming. 

  1. Every program contains four basic parts: 
  • Declarations, definitions 
  • Input, initialization
  • Logic/Process
  • Output, Result

Too small programs can be written only with main() without needing to define any external functions. 

Medium and large Programs can be written into multiple Functions 

If you write the Programs using Functions 

  • Isolate input/output from logic or process
  • Logic must be written few dedicated functions
  • Input/Output can be done in higher-order functions like main 


To design the functions, remember the below principles: 

  • Every Function should perform an independent process or task that can be reused in main program. 
  • The inputs of that process are taken as arguments 
  • The Outputs of that process can be the return value of the function or arguments. 
  • Try to isolate Function only for Logic apart of I/O 

Solving a Problem through programming requires these steps: 

  • Solve the inputs 
  • Solve the Logic 
  • Solve the output

These three aspects are explained below 
Inputs of a program can be taken from one of the below things, sometimes it can be few of below or all: 


  • The problem statement 
  • Case study, Assumed inputs 
  • User inputs 
  • Calculated inputs 
  • Constant values 

Before making the logic of the program, you must recall the set of language constructs and libraries that may be useful in the program. 

Output may be displayed immediately or at the end or written to any secondary media such as file. 

 


No comments:

Post a Comment

There was an error in this gadget

Finance Tip of the Day