Skip to main content

Computer Programming: steps to set up program

Computer programming is explaining a solution to a problem.

On a human level, we look at a problem and identify what we have and what we want. Then we figure out how to get from one to the other.

Programming a computer to solve a problem always requires defining data to represent the things in your problem; this is called modeling. It also requires explaining unambiguously what process to follow in order to solve the problem. This process of explaining is where different paradigms of programming come in:

  • Evaluation and substitution. These are the basic algebra skills that programs are built on, and that programmers mentally fall back on when trying to figure out why a program isn't behaving as expected.
  • Modeling. Information is complex; solving problems with the computer (or with math) always somehow involves defining and using data to represent information from the problem.
  • Managing complexity: Breaking problems and solutions down into chunks that can be understood easily. Abstraction  is the main tool for this.
  • Communication. In at least two ways, this is important: (1) Determining what your clients want, so you are solving the right problems. (2) Organizing and documenting your work so that you (or the next programmer to touch it) will be able to understand it, months or years later.
  • Patience and perseveration. When things aren't working right, there's usually something you haven't noticed. Learning what that something is often requires mentally retracing your steps, and manually re-running code on different inputs, until you see what you've been missing. This may take a while.
  • Discipline. Writing tests and specifying what work must be done are both decidedly unsexy tasks, but they both make your work easier and give you confidence that you've done your work correctly.

  • Steps involved in Computer Programming -

    • Definition of the problem (involves definition of the input/output data associated with the problem, what sort of input shall be provided and what would be the expected output)
    • Planning of the solution (developing flow charts / algorithms to solve the problem)
    • Coding the program (Expressing the solution through instructions, written in a programming language)
    • Testing the program (Translation of the source program into executable form and debugging, which involves locating and correcting errors)
    • Documentation (It is a written detailed description of the programming cycle and specific facts about the program. Typical program documentation materials include the origin and nature of the problem, a brief narrative description of the program, logic tools such as flowcharts, algorithms, data-record descriptions, program listings, and testing results. Comments in the program itself are also considered an essential part of documentation.)


STEPS IN WRITING A PROGRAM

1. Understand the specific reason to write a program So, before we embark on our programming journey, we should understand what is the reason behind writing a program. Is it to calculate the area of a rectangle, or convert fahrenheit to celsius, or place a rocket at a particular orbit, or predict the weather for a particular day. Understand clearly the reason for writing the program. There should not be any ambiguity at all.

2. Know what are the inputs I have already told you that, every program takes some input, processes the input and produces some output. Understand what the inputs are for the program you are writing. For example, if a program is written to calculate the area of a rectangle, length and breadth would be the input. If it is a program inside a robotic vacuum cleaner, it could be the input given from the sensors about the presence of some dirt in the vicinity. So, depending on how complex the program is, the inputs also could differ.

3. Identify the process The process is used to convert the input to output in a program. Some times, the process could be very simple, as simple as just using a formula to calculate the answer. For example, we write a program to calculate the area of a rectangle. Multiplying length and breadth would give me the area of the rectangle, and that’s all is the process. But, if I want to write a computer program, which has to play Jeopardy, against a human opponent, then the process would not be that simple. So, depending on the need of the question, the process to convert input data to output information would differ. When you decide to write a program, be clear on what is the very very clear about that. Crystal clear!!!.

4. Know what is the output Last but not the least, is, you should know what is the output of your program. The output data which is generated or calculated or predicted needs to be presented to the user in a very user friendly manner, which is clear and makes sense. So, it is never about getting the correct output, it is always about presenting it well to the user.

5. Example So, let us take a simple example and try to identify the input, process and output for the same. For example, if the question is to write a program to find the area of a rectangle.

Input – Length and breadth

Process – Area = length X breadth

Output – Print Area

May be another example is to calculate the simple interest using a program

Input – Principal, rate, period

Process – (Principal X rate X period)/100

Output – Print Principal


So, I think all of you have would have got some idea of programming and how to identify input, process and output before starting to writing any program.

Comments

Popular posts from this blog

STRESS , ANXIETY MANAGEMENT DURING lockdown

As the events surrounding the coronavirus (COVID-19) outbreak unfold, it’s understandable that you might begin to feel increasing stress. Information is rapidly changing and can be confusing, overwhelming and even scary. You may experience fear and spikes in anxiety. But even if you’re managing your anxiety levels well, there’s still so much more to deal with. Whether it’s dealing with at-risk family members or patients, a roller coaster economy, trying to juggle work, keeping kids occupied or homeschooling while schools are closed, or simply adjusting to a new, unfamiliar situation, stress can easily pile up and negatively impact you — both physically and mentally. 5 steps for managing your stress: 1)Exercise regularly:  While gyms are closed and social distancing guidelines are in place, it’s still possible to get in aerobic exercise, like walking, running, hiking or playing with your kids/pets, all can help release endorphins (natural substances that ...

What is Cyber Security? Definition, career , jobs, advantages of Cyber Security.

Cyber security ......!   We depend on technology heavily, which also translates to a rise in online hackers. The bigger the corporation is, the higher the risk of cyber attacks. This is when cybersecurity comes into the picture. What is cybersecurity:                  Cybersecurity is the condition of being guarded against criminal and illegal activities that comprise of activities related to computer, information technology, and virtual reality. It also means the measures taken to acquire this condition. One must know the risks, threats, and consequences of cyber attacks. Who are the attackers:                   The attacker could be an external source like a hacker who gets into the system and steals files. The imposter could even be someone from the company itself, like an employee who has an access to confidential information. How are the attacks carried out:         ...

Learn Basic of Artificial intelligence.

  Now is the perfect time to learn AI and start implementing its ethics in your career. If you’re a beginner, it is wise to follow the following steps: Start with basics: Begin with learning about various technologies involved and their objectives through various books and blogs. This can be the first step towards your orientation. Enrol into webinars: Webinars have proved to be beneficial for every beginner. It will give you an insight into the industry you’re willing to enter, application of various technologies and it’s effect in your real life. This helps to see the world through the eyes of AI. Well-guided course: Let’s be honest, it is impossible to learn the ethics and disciplines of AI without guidance from industry experts and coaches. A guided course will help you dive deep into the world of AI. It will help you add a finishing touch to the basics you’ve taken care of and then help you with the right technical skills to work in AI. If you’re willing to join an industry th...