Download presentation
Presentation is loading. Please wait.
Published byMolly Page Modified over 9 years ago
1
Controlling Computers with Programs When you create a computer program you are creating a set of instructions that tell the computer exactly and completely what to do. Computers operate using a language that is usually unique to each brand and model, called machine code.
2
Machine Coding The Binary System – All 0s and 1s Hexadecimal - A Base16 number system Assembly Language – A human–readable form of machine code for every microprocessor. Assemblers – convert the assembly language programs into machine code.
3
Object-oriented Programming C and C++ are procedural languages. They are designed to allow programmers to solve problems by defining the procedures to use. With OOPS, programmers have a means to describe the relationships between collections of code and variables known as objects.
4
Torque Script Torque Script is typeless and does not require forward declarations of variables. Also Torque Script requires scope prefixes (like % signs for local and $ for global variables. Variables typically require a “type” to specify how much memory will be used. Torque script does not require this.
5
Some Definitions Expressions – Statements that can be evaluated Variables – chunks of memory where values are stored. Arrays – A data structure that allows a collective name to be given to a group of elements of the same type. Strings – like an array of single characters
6
Loops Loops are used for repetitive tasks With While loops the condition is evaluated before the loop body statements are executed. For Loops While Loops
7
Functions Functions save work. Once you’ve written code to solve a problem, you can roll the code into a function and reuse it whenever you encounter that problem again. You can also use the code with different starting parameters.
8
Conditional Expressions A conditional or logical expression is an expression that can only evaluate to one of two values: true or false. There are also explicit logical operators for combining the logical values of true and false.
9
Branching The term branching refers to the idea that code can follow different execution paths. The simplest way to select the next thing to do in a program based on conditions is to use the if statement. The if-else statement can be used for multiple branches. These statements can also be nested one inside the other.
10
Debugging and Problem Solving Missing Semicolon at the end of a statement Missing slash in a double-slash operator Missing % or $ (scope prefix) from variable names Using uninitalized variables Mixing global and local scope prefixes Unbalanced parentheses or braces
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.