Computer ‣ an electronic, programmable device that can store, retrieve, and manipulate data
Major components of a computer: Hardware and software
Hardware ‣ tangible part of the computer
‣ composed of electronic and mechanical parts
Software ‣ intangible part of the computer
‣ consists data and computer programs
Hardware - Main Memory, Secondary Memory, Central Processing Unit, Input Devices, Output Devices
Memory ‣ where data and instructions needed by the CPU to perform are stored
Main Memory ‣ used to hold programs and data that the processor is actively working on
Secondary Memory ‣ used to hold programs and data for long term use
Memory Cell ‣ an individual storage location in the memory
Address of a memory cell ‣ the relative position of a memory cell in the computer’s main memory
Contents of a memory cell ‣ the information stored in a memory cell, either a program instruction or data
Bit ‣ smallest element a computer can deal with
Byte ‣ the amount of storage required to store a single character
‣ there are 8 bits to a byte
Central Processing Unit (CPU) ‣ coordinate all computer operations
The CPU continuously do: fetch - decode - execute
How does one declare a function in C? - via a function prototype
I/O Devices ‣ allows a computer system to interact with the outside world by moving data in and out of the system
Input Device ‣ peripheral devices used to enter information for computation
Examples of input devices: keyboard, mice, microphone
Output Device ‣ peripheral devices that receives data from the computer used for observing the results of computation
Examples of output devices: monitor, printer, speaker
Software ‣ programs used by a computer to operate
Program ‣ collection of instructions that makes a computer perform a specific task when executed
‣ list of instructions that tell a computer what to do
Applications Software ‣ programs that assist a computer user in accomplishing specific tasks e.g. Microsoft Word, Google Chrome, Steam
Systems Software ‣ programs that are needed to keep all the hardware and applications software running together smoothly
‣ interface between the hardware and the user applications e.g. Operating systems like Windows, Linux, MacOS
Compiler ‣ translates a high-level computer program into machine language
Machine Language ‣ language directly understood by a computer
‣ collection of binary numbers understood by a specific CPU
Programming Language ‣ standardized communication technique for expressing instructions to a computer
Assembly Language ‣ mnemonic codes that correspond to machine language instructions
‣ computer operations are represented by mnemonic codes rather than binary numbers and variables can be given names rather than binary memory addresses
High-level Language ‣ used to write programs that are independent of the CPU on which they will be executed
‣ combine algebraic expressions and English symbols
‣ is not directly understood by a computer
Syntax ‣ rules of a specific programming language
‣ it defines how we can put together symbols, reserved words and identifiers to make a valid program
Semantics ‣ refers to the meaning of a program statement and its purpose and role in a program
A program that is syntactically correct is NOT necessarily semantically correct
Steps in Software Development Method
Problem Definition
Problem Analysis
Algorithm Design and Representation
Coding and Debugging
Problem Definition - computer programming requires us to define the problem first before we even try to create a solution
Problem Analysis ‣ involves breaking up the problem into smaller and simpler sub-problems
Algorithm ‣ list of steps for solving a problem
‣ a clear unambiguous specification of the steps needed to solve a problem
‣ is a well-ordered collection of unambiguous and effectively computable operations that, when executed, produces a result and halts in a finite amount of time
Syntax Error / Compile-time Error ‣ occur if there is syntax error in the code
Runtime Errors ‣ occurs when the program directs the computer to perform an illegal operation e.g division by zero
Logic Error ‣ caused by following an incorrect/faulty algorithm