answersLogoWhite

0


Best Answer

Ah yes, the eternal question on structured design and top-down coding.

First, you need to understand the algorithm you intend to use. Write down English-like statements that describe the steps., etc., to arrive at a solution. If you can't describe what you want to do then chances are you don't understand the algorithm.

Then, translate the English-like statement/paragraph into something called pseudo-code. Pseudo-code is a mixture of the English-like statement you provided and close to the grammar of the computer language you are translating to.

Then, step by step, change the individual steps from your pseudo-code example into the exact grammar of the computer language you are using. Finally, take all of the variables you have declared along the way and define them.

Voila! You now have the corresponding computer program that represents the algorithm you described earlier.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you change algorithm to program code?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Is an algorithm written in code during the program planning stage?

True!


How do you write an Algorithm for a C plus plus Program?

You don't write an algorithm for a C++ program, unless you are documenting the C++ program after-the-fact. The normal procedure is to write the algorithm first, in a language independent fashion, and then translate that stated algorithm into C++ code, or into whatever language you wish.


Why algorithm is use?

An algorithm is the soul of a computer program. A code without an algorithm is like a missile without a radar. Like a body without a soul cheers olga lednichenko


How can i write pseudo code for C plus plus if i haven't even wrote the program yet?

You are going about this backwards. First, define the program. Second, describe its algorithm. Third, if needed, write pseudo code. (Sometime, algorithm and pseudo code is the same process.) Fourth, or third, write real code.


What is solution in c program?

The program itself is the solution. All programs are a solution to a given problem; that's the entire point of writing a program, to solve a problem. The program's algorithm specifies how the problem is solved and it's the programmer's job to convert that algorithm into working code.


Can someone provide the C program for Prim's algorithm?

The C code for Prim's algorithm can be found in the following link. https://sites.google.com/site/itstudentjunction/lab-programming-solutions/data-structures-programs/program-to-find-minimal-spanning-tree-using--prims-algorithm


What is the difference between an algorithm and a computer program?


Does every algorithm have a c program?

Yes. More generally, every algorithm (defined as a sequence of finite steps to solve a problem that can be easily understood by a human) can be converted into machine code such that the algorithm can be understood by a machine. The C programming language is just one such method of converting algorithms into working machine code.


CPP Program for Implementing Knuth-morris-pratt pattern matching algorithm?

what is the pure algorithm instead of cpp program?


Difference between algorithm and psecudo code?

an algorithm is working code that accomplishes a task. like a sorting algorithm would get an array sorted alphebitically, asending, decending.. whatever it was programmed to do.psuedocode is like a basic outline of a method or a program or a chunk of code. it lets you visualize the steps you need to take to accomplish a goal. for example:psuedocode://loop through indicies in myArray[]for (init, condition, step){if myArray[init] is playerPosisionmovePlayer}obviously you couldn't copy and paste that code into any 'ol program, but it really gets you on track


How is a pso program in matlab..how is it created from algorithm..please help?

The PSO or Particle Swarm Optimization Program algorithm in MatLab is created by first creating a binary genetic algorithm.


Is an algorithm easy to program?

Some of them are.