Computer

Subdecks (2)

Cards (59)

  • Computer program
    A set of instructions a computer uses to solve a problem
  • Computer program
    Directs the computer to perform the actions needed to arrive at a solution
  • WHAT IS MEANT BY ‘PROBLEM’?
    A problem is something that needs to be solved or a task that needs to be accomplished.
  • HOW SHOULD YOU DESIGN PROGRAMS?
    There are two main phases in program design:
    The Problem-Solving Phase: Done without the use of a computer
    The Implementation Phase: The designs developed during the problem-solving phase are executed on the computer.
  • WHAT IS AN ALGORITHM?
    An algorithm is a formal sequence of instructions that defines a solution to a
    problem. The ‘a’ is emphasized because a problem could have multiple solutions.
  • THE FIVE MAIN PROBLEM-SOLVING STEPS
    Whenever attempting to solve a problem, there are certain steps that should be followed. They are:
    Define the problem
    Propose and evaluate solutions
    Determine the most efficient solution
    Represent the most efficient solution in the form of an algorithm
    Test the algorithm
  • PROBLEM STATEMENT (a clear definition of the problem that needs to be solved)
  • INPUT – the data you are provided with or have to obtain from the user. Some words that help you to identify the input are: read, input, enter, given, accept
  • OUTPUT – the results that should be produced
  • PROCESSING – the tasks that must be performed, i.e. what must be done
    with the input to get the output
  • STORAGE – the data that must be stored
  • A VARIABLE is a name that is given to represent a piece of data that is unknown can be changed/varied while a program is running.
  • A VARIABLE can be changed/varied while a program is running.
  • Declaring a variable lets the computer know ahead of time what type of data it is allowed to hold. That way, the computer can make sure a user does not enter invalid data
  • RULES you must follow when naming variables:
    The name must not contain a space.
    A variable name must only contain LETTERS, DIGITS and UNDERSCORES (_).
    A variable name MUST begin with a letter.
    You cannot use a RESERVED WORD as a variable name (PRINT, PROGRAM, INPUT, BEGIN, END, START, STOP, etc.).
  • Variables are NOT Case Sensitive
  • A CONSTANT is an IDENTIFIER (has an associated value)
    A CONSTANT consists of two things:a name,and a value.The name should clearly illustrate what the constant is all about, and the value is the actual value of the constant
    CONSTANTS are very useful when we want to set a value once, and then repeat it in many locations inside our program.
  • CONSTANTS cannot be altered by a program during execution
    Example of CONSTANTS
    Pi =3.14
    The number of inches in a foot = 12
    The number of days in a week = 7
    The number of months in a year = 12
    CONSTANTS cannot be altered by a program during execution
  • INTEGER
    Positive and negative numbers which do NOT have a decimal point, e.g. -100, 0, 43
  • REAL
    Positive and negative numbers that may have a decimal point, e.g. -7.2, 0.1987, 99.0
  • CHARACTER
    A single character (letter, digit or symbol) e.g. A, Z, 9, 0, $, &, ?
  • STRING
    A group of up to 255 characters
  • BOOLEAN
    Either true or false (and nothing else)