Tài liệu How to Think Like a Computer Scientist pptx
... charAt takes an index and returns the character at that index. indexOf takes a character and finds the index where that character appears. charAt fails if the index is out of range, and causes an ... in a program are called the state. Diagrams like this that show the state of the program are called state diagrams. As the program runs, the state changes, so you should think of a state...
Ngày tải lên: 19/01/2014, 16:20
... powerful features of a programming language is the ability to manipulate variables. A variable is a named lo c ation that stores a value. Just as there are different types of values (integer, character, ... is straightforward: • When you declare a variable, you create a named storage location. 14 CHAPTER 2. VARIABLES AND TYPES • When you make an assignment to a variable, you...
Ngày tải lên: 23/03/2014, 22:21
... debugging and other programming prac- tices. 1.4. Formal and natural languages 5 1.4 Formal and natural languages Natural languages are the languages people speak, such as English, Spanish, and French. They ... language: A programming language like Python that is designed to be easy for humans to read and write. low-level language: A programming language that is designed to be eas...
Ngày tải lên: 06/03/2014, 16:20
How to Think Like a Computer Scientist pot
... in which Python handles variables. In C++ a variable is a name for a place that holds a thing. Variables have to be declared with types at least in part because the size of the place to which they ... each other (by using local variables, for example). generalize: To replace something unnecessarily specific (like a constant value) with something appropriately general (like a...
Ngày tải lên: 14/03/2014, 15:20