1. Abdulrahman Abdulmawla 0005684495
2. Computer Program
2.1. Programming languages
2.1.1. Portability
2.1.1.1. With most programming languages, portability is achieved by the creation of a compiler for each type of computer that the language is to run on
2.1.1.2. Portable means that a program may be written on one type of computer and run on a wide variety of computers with little to no modification
2.1.2. Compiler
2.1.2.1. A program that translates source code to an executable form
2.1.2.2. Uncovers any syntax errors that may be in the program
2.1.2.2.1. These are mistakes that the programmer has made that violate the rules of the programming language
2.1.2.3. Most compilers translate source code directly into files that contain machine language instructions
2.1.2.3.1. These are called executable files
2.1.2.4. Some compilers such as Java, only translate a source file into one with byte code instructions
2.1.2.4.1. This is not machine language so they cannot be executed by the CPU directly
2.1.2.4.2. Byte code uses the .class extension
2.1.3. Text editor
2.1.3.1. Used to type out program and save to a file
2.1.3.1.1. The programming statements written by the programmer is called source code
2.1.3.1.2. The file it is saved in is called a source file
2.1.4. Java
2.1.4.1. Compiling a program
2.1.4.1.1. Open command prompt
2.1.4.2. Running a program
2.1.4.2.1. Open command prompt
2.1.4.3. Highly portable
2.1.4.4. Applications
2.1.4.4.1. Stand-alone program
2.1.4.5. Applets
2.1.4.5.1. Designed to be transmitted over internet from web server
2.1.4.5.2. Executed in a web browser
2.1.4.5.3. Extends capabilities of a web page significantly
2.1.4.6. Java Virtual Machine
2.1.4.6.1. A program that reads and executes Java byte code instruction
2.1.5. Uses words instead of numbers
2.1.6. Much easier to understand for humans than machine language
2.1.7. Is translated to machine language for CPUs using software
2.1.8. Key Words
2.1.8.1. Always written in lowercase
2.1.8.2. Cannot be used for anything other than its intended purpose
2.1.8.3. Words that have special meaning in the programming language
2.1.8.4. Also known as reserved words
2.1.9. Operators
2.1.9.1. Symbols or words that perform operations on one or more items of data
2.1.10. Punctuation
2.1.10.1. Each punctuation character serves a specific purpose
2.1.11. Programmer-defined names
2.1.11.1. Words or names defined by the programmer
2.1.11.2. Used to identify storage locations in memory and parts of the program that are created by the programmer
2.1.11.3. Often called identifiers
2.1.12. Syntax
2.1.12.1. Rules that must be followed when writing a program
2.1.12.2. Dictates how key words and operators may be used and where punctuation symbols must appear
2.1.13. Lines
2.1.13.1. A single line in the body of a program
2.1.13.2. Can contain something meaningful or be empty
2.1.13.3. Empty lines are only used to help make the program more readable
2.1.14. Statement
2.1.14.1. A complete instruction that causes computer to perform some action
2.1.14.2. Can be a combination of key words, operators, and programmer-defined names
2.1.15. Variable
2.1.15.1. Symbolic names made up by the programmer that represent locations in the computers RAM
2.1.15.2. Data may change while program is running
2.2. Machine language
2.2.1. Consists of binary numbers, 0s and 1s
2.2.2. Is the only language CPUs can understand
2.2.3. Unique to each individual CPU
2.3. Set of instructions that enable computer to solve problem/perform a task
2.3.1. Set of these instructions is called an algorithm
2.4. Creating a program
2.4.1. Clearly define what the program is to do
2.4.1.1. The data that is to be input
2.4.1.2. The processing that is to take place
2.4.1.2.1. Visualize the program running on the computer
2.4.1.3. The desired output
2.5. Procedural programming
2.5.1. Made of one or more procedures
2.5.1.1. A procedure is a set of programming statements that together form a specific task
2.5.1.1.1. Typically operate on data items that are separate from the procedures
2.5.2. Data items commonly passed from one procedure to another
2.5.3. Focused on the creation of procedures that operate on the programs data
2.5.4. Data is stored in a particular format which consists of variables and more complex structures
2.5.4.1. Quite often this format is altered resulting in extra work for the programmer
2.6. Object-oriented programming
2.6.1. Centered on creating objects
2.6.1.1. An object is a software entity that contains data and procedures
2.6.1.1.1. Data contained in an object is known as its attributes
2.6.1.1.2. The procedures that the object performs is known as its methods
2.6.1.1.3. Objects typically hide their data but allows outside code to access the methods that operate on the data
2.7. Fixes the issue of data separation through encapsulation and data hiding
2.7.1. Encapsulation is the combining of data and code into a single object
2.7.2. Data hiding is an objects ability to hide its data from code that is outside the object
2.7.2.1. Only the objects methods therefore may access and make changes to the objects data
3. Computer Hardware
3.1. CPU
3.1.1. Fetch/decode/execute cycle
3.1.1.1. Execute
3.1.1.1.1. Sends signal to appropriate component which performs operation
3.1.1.2. Decode
3.1.1.2.1. Control unit decodes instruction and generates electronic signal
3.1.1.3. Fetch
3.1.1.3.1. Control unit fetches from main memory next set of instructions
3.1.2. Control Unit
3.1.2.1. Determines where to get next instructions
3.1.2.2. Regulates other major components w/ control signals
3.1.3. Arithmetic and Logic Unit
3.1.3.1. Perform Mathematical Operations
3.2. Main Memory
3.2.1. Random Access Memory
3.2.1.1. Holds sequences of instructions for programs that are running and data it is using
3.2.1.2. Divided into sections that hold equal data
3.2.1.2.1. Each section has eight bits
3.2.1.3. Temporary storage, erased when computer turned off
3.3. Secondary Storage Devices
3.3.1. Holds data for long periods of time even when computer is off
3.3.1.1. Frequently used programs
3.3.1.2. Word processing documents, payroll data, inventory figures
3.3.2. Disk drive
3.3.2.1. Stores data by magnetically encoding it on a spinning circular disk
3.3.3. Solid State Drive
3.3.3.1. No moving parts
3.3.3.2. Operates faster
3.3.4. External drives
3.3.4.1. Move data to another computer
3.3.4.2. Create backup copies of data
3.3.5. Universal Serial Bus drives
3.3.5.1. Plugs into computers Universal Serial Bus port
3.3.5.2. Stores data in flash memory
3.3.5.3. Appears to computer as a disk drive
3.3.6. Optical Devices
3.3.6.1. CD
3.3.6.2. DVD
3.3.6.3. Encoded as a series of pits on surface
3.3.6.3.1. Drives use laser to detect pits and read data
3.3.6.4. Hold large amounts of data
3.4. Input Devices
3.4.1. Collects data from outside world and sends to computer
3.4.2. Keyboard
3.4.3. Mouse
3.4.4. Scanner
3.5. Output Devices
3.5.1. Monitors
3.5.2. Printers
3.5.3. Presents data from computer to outside world