Starting with an introduction about coding and how a computer is nothing without a program otherwise it just an an object and can't do or display anything. Next was the four actions that form a program.
accept a number representing the distance;
accept a number representing the travel time;
divide the former value by the latter and store the result in the memory;
display the result (representing the average speed) in a readable format.
These are the core basics of what makes computer work. These are very far from making a program to work but they are sufficient to be a language that a computer can process.
A language is a tool to that allows humans to express our-self and to communicate. Computer have their own language and even the best one wouldn't function without a pre-established set of commands for the computer to follow.
What makes an alphabet.
An Alphabet: Symbols that are used to build a language. e.g. A
A Lexis: Is sets of words that the language gives its users. e.g. Coding or Table
A Syntax: Is a structure to a string of words to form a valid sentence. e.g. "Fun is coding" is incorrect syntax, "Coding is fun" is the correct syntax.
Semantics: Are the rules that are put in place to makes sure a phrase makes sense. e.g. "Kicking footballs are fun" is the correct semantics and "Footballs kicking fun are" is the wrong semantics.
Programming requires putting selected programming language's elements
so that the user can achieve the intended outcome.
The composition for your code must be correct like Alphabetically as a program needs to be written in a recognisable script, Lexically as each program as a dictionary which needs to mastered, Syntactically because languages has rules that has to be followed and Semantically as the program has to make sense.
Compilation- Compiling is the transformation from Source Code (human readable) into machine code (computer executable). A compiler is a program.
Interpretation- Interpreter is a computer program that directly executes instructions written in a programming or scripting language, without requiring them previously to have been compiled into a machine language program.
Compilations pros: translations of the code is faster, only the user need to have the compiler the end user doesn't need it and when stored in compilation the language is hard to understand so keeping tricks and your inventions secret.
Compilation cons: It is a long process so you may not be able to run your code immediately after any changes and you have to have as many compilers as hardware platforms you want the code to run on.
Interpretation pros: as soon as you make a change you can complete it and the code is stored using the programming language and not the machine one and this means that it can run on computer using different machine languages.
Interpretation cons: interpreting will not speed your code up as your code as your code will share your computers power with the interpreter so it can''t run fast and you and the end user have to have the interpreter to run the code.
Using the print function to display 3 messages in the sandbox which is provided by the Cisco networking academy.
Comments