Chapter 1 Intro To Computers And Python 1.1-1.5 Flashcards
Every year or 2, the capacities of computers have doubled inexpensively. This trend is called
Moore’s law
What units or sections can computers be divided into despite their physical appearance
6 answers
Input unit
Output unit
Memory unit
Arithmetic and Logic unit (ALU)
Centra processing unit (CPU)
Secondary storage unit
This “receiving” section obtains info from _______ devices and places it at the disposal of the other units for processing.
Input unit
This “shipping” section takes info the computer has processed and places it on various _______ devices to make it available for use outside the computer
Output unit
Information is commonly _____ to secondary storage devices such as SSDs, hard drives, etc
Output
Rapid-access, low capacity “warehouse” section retains info that has been entered through the input unit, making it immediately available for processing when needed.
Memory or random access memory (RAM)
Is the info on the ram retained after computer is shut off?
No, it’s volatile and is lost when computer is shut off. Usually has 12, 16 or 8GB. 1GB is one million bytes. A byte is eight bits. A bit is either a 0 or a 1
This “manufacturing” section performs calculations such as addition, subtraction, multiplication, and division. Plus the decision mechanism to compare 2 items from memory units to see if they’re equal.
ALU
Arithmetic and logic unit
It is part of the CPU
The “administrative” section coordinates and supervises the operation of the other sections.
Central processing unit
CPU
Having more than one processor
Multicore processors, can perform many operations simultaneously
Long-term, high capacity “warehouse” section.
Hard drive or secondary storage unit
Houses programs or data not actively being used by other units until they are needed in the future. Info is persistent and takes longer to access.
1 terabyte is one trillion bytes
Define
Data hierarchy
Data items processed by computers from a data hierarchy that becomes larger and more complex in structure. Processed from simplest to richer ones.
Short for binary digit
A bit
Can have the value of 0 or 1. The smallest data item in a computer.
A bit
Digits, letters and symbols are known as
Characters
Decimal digits are from what to what
0-9
Contains characters used to write programs and represents data items
Character sets
Character set used by Python that are composed of one, two, three or four bytes (8,16,24 or 32 bits, respectively) - known as** UTF-8 encoding**
Unicode
Subset of Unicode that represents letters, digits and some special characters
ASCII (American Standard Code for Information Interchange)
Composed of characters or bytes, not bits
Fields
Composed of several fields
Record
Example of a record and payroll, include fields
Employee identification number (a whole number)
Name (string of characters)
Address (string of characters)
Hourly pay rate (number with a decimal)
Thus a record is a group of related fields
A group of related records. Contains arbitrary formats.
File
A group of related records viewed simply as a _________ in some operating systems
Sequence of bytes
A collection of data organized for easy access and manipulation
Database
Most popular model of database in which data is stored in simple tables.
Relational database
Includes records and fields
A table. Example: table of students might include first name, last name, mayor, year.
The data for each student is a record. The individual pieces of info in each record are fields.
3 general types of programming languages
* Machine languages
* Assembly languages
* High-level languages
Name the language
Defined by its hardware design. Generally consists of strings and numbers that instruct a computer to perform elementary operations at a time
Machine language
They are machine dependent
Language cumbersome to humans
Machine language
It has a lot of numbers. Ex: payroll program that adds overtime pay to base pay and stores the results in gross pay
+1300042774
+1400593419
+1200274027
What is an assembly language?
The English-like abbreviations programmers started to use instead of using strings of numbers that computers could directly understand but was too slow and tedious for most programmers to use
What are translator programs called that were developed to convert assembly-language programs to machine language at computer speeds?
Assemblers
Example:
Assembly-language payroll program also adds overtime pay to base pay and stores the result in gross pay
Load basepay
Add overpay
Store grosspay
Although such code is clearer to humans, it’s incomprehensible to computers until translated to machine language
What is a high-level language?
A language developed in which single statements could be written to accomplish substantial tasks
A typical high-level-language program contains many statements, known as the program’s _______ ________
Source code
What are translator programs called that convert high-level-language source code into machine language?
Compilers
__________ programs, developed to execute high-level language programs directly, avoid the delay of compilation, although they run slower than compiled programs
Interpreter programs
Translator programs called _______ convert assembly-language programs to machine language at computer speeds
Assemblers
____________ programs, developed to execute high-level-language programs directly, avoid the delay of compilation, although they run slower than compiled programs
Interpreter
T/F High-level languages allow you to write instructions that look almost like everyday English and contain commonly used mathematical notations
True
Performing a task in a program requires a ______ (it houses the program statements that perform its tasks, it essentially hides these statements from its users)
Method
In Python, a program called a ____ houses the set of ____ that perform the ______ tasks
Class, methods, class’s
Example: a class represents a bank account, it might contain one method to deposit money to an account, another to withdraw money from an account and a third to inquire what the account’s balance is
The process of building an object before a program can perform the tasks that the class’s methods define is called
Instantiation, an object is referred to as an instance of its class
You can reuse a class many times to build many ____
Objects
Why does the reuse of existing classes and components also help build more reliable and effective systems?
This is because existing classes and components often have undergone extensive testing, debugging and performance tuning. Reusable classes are crucial to the software revolution that has spurred by object technology
What is it called when you send a message to an object for it to perform a task?
Method call, it tells a method of the object to perform its task
For example: a program might call a bank-account object’s deposit method to increase the account’s balance
An object has ______ that it carries along as it’s used in a program. These _______ are specified as part of the object’s class. (same word for both blanks)
Attributes
Example: bank-account object knows the balance in the account it represents, but not the balance of other accounts in the bank.
Attributes are specified by the class’s _________ _________
Instance variables
The class’s, its object attributes and methods are intimately related so classes wrap together their attributes and methods.
A new class of objects can be created conveniently by _______ — the new class (called ______) starts with the characteristics of existing class (called the ______), possibly customizing them and adding unique characteristics of its own
Inheritance, subclass, superclass
How to create the best solution to large complex projects? Step by step
- Perform a detailed analysis process for dermining the projects requirements (what the system is supposed to do)
- Then develop a design that satisfies them (specifying how the system should do it)
- Review the design before writing any code (have your design reviewed by other software professionals)
What is it called when the process of analyzing and designing your system from an object-oriented point of view?
Object-oriented analysis-and-design (OOAD) process
~~~
``` Languages like Python are like this and allow you to implement an object-oriented design as a working system
The size, shape, color and weight of an object are _______ of the object’s class
Attributes
T/F objects, or more precisely, the classes objects come from, are essentially reusable software components
True