Basics of a Program
A Program is a set of instructions for a computer to follow. The basic instruction types are input a value, process a value, and output a value.
A basic program could be add 2 to a number.
First you need you to know what number to add 2 to, that's your input. Then you need to read what the number is and add 2, that's processing. Finally you share the result which is your output.
Input: 6
Processing: 6 + 2 = 8
Output = 8
A basic program could be add 2 to a number.
First you need you to know what number to add 2 to, that's your input. Then you need to read what the number is and add 2, that's processing. Finally you share the result which is your output.
Input: 6
Processing: 6 + 2 = 8
Output = 8
Writing Programs
Programming is the process of thinking up instructions to give to a machine.
Coding is the process of translating those ideas into a written language that a computer can interpret and execute.
When a computer runs a task such as a opening a file the instructions come from a series of 1's and 0's. This is known as machine code, which is the base 2 number system (binary) . The processor is what reads the machine code and then preforms the instructions.
A series of machine code instructions is called an executable program (or executable). People can't interpret machine code well, so assemblers, compilers, and high-level languages were created. These allow people to write instructions in text that people can understand, then have it all converted into machine code for the computer.
An Assembler is a program that converts instructions made of simple symbols into machine code. These programs use Assembly language which creates almost a one to one correspondence with the computer. In other words, what the language instructs and what the computer actually does is almost the same. (Low-level language)
High-Level languages are much further than the computer hardware and allow programmers to focus on what they want their program to do (the task) rather then how the computer should preform the task. C++, C, Java, and Python are examples of high-level languages.
For High-level languages to work the code must be translated into machine code. This is the compilers job. A compiler will go through the code of a program and translate it into an executable file. Some examples are C, C++, and Java. Other languages are not compiled and use an interpreter instead. Interpreters are similar to compilers, but interpreters will not save an executable file and instead run the program directly. Python and Pearl are interpreted languages.
Coding is the process of translating those ideas into a written language that a computer can interpret and execute.
When a computer runs a task such as a opening a file the instructions come from a series of 1's and 0's. This is known as machine code, which is the base 2 number system (binary) . The processor is what reads the machine code and then preforms the instructions.
A series of machine code instructions is called an executable program (or executable). People can't interpret machine code well, so assemblers, compilers, and high-level languages were created. These allow people to write instructions in text that people can understand, then have it all converted into machine code for the computer.
An Assembler is a program that converts instructions made of simple symbols into machine code. These programs use Assembly language which creates almost a one to one correspondence with the computer. In other words, what the language instructs and what the computer actually does is almost the same. (Low-level language)
High-Level languages are much further than the computer hardware and allow programmers to focus on what they want their program to do (the task) rather then how the computer should preform the task. C++, C, Java, and Python are examples of high-level languages.
For High-level languages to work the code must be translated into machine code. This is the compilers job. A compiler will go through the code of a program and translate it into an executable file. Some examples are C, C++, and Java. Other languages are not compiled and use an interpreter instead. Interpreters are similar to compilers, but interpreters will not save an executable file and instead run the program directly. Python and Pearl are interpreted languages.