Algorithms

Comment

Algorithms

Problem : 10-5=?

 

  • Let left = 10
  • Let right = 5
  • Let operator = - (subtraction)
  • Solve for ?

 

Variables or identifiers

 

  • Begin
    • Declare x as an integer
    • Declare y as an integer
    • Declare z as an integer

 

In ram the "post box" contains x, z and y. All of them are in different containers

 

  • Set x = 10
  • Set y = 5

 

No in the "post boxes" x and y are equal to 10 and 5. X and y now point to the numbers they are supposed to represent.

 

  • Set z = x-y (you substituted the numbers for their variables)
  • Display x-y= z

 

We can now do another problem with the same variables

 

  • P = Z * 2
    • P is a null value
      • It does not stand for anything

 

P is now displayed as a null variable in RAM. When the computer solves the problem p then turns to point to 10.

 

  • End the problem

 

Terminology

 

  • Bin -
    • Identifier in memory which points to a values
  • Null -
    •  A thing with no value

 

 

Contd.

 

  • Variables are stored in RAM as hexadecimal addresses.
  • You have to always define the variables
    • Integers always have a value
      • An integers range is -2 147 483 684 to 2 147 483 647
  • For something to have a value in RAM it has to point to something
  • Addresses have 16 digits
  • In programming we are
    • Mimicking real life objects in a computer environment
      • People
      • Buildings
      • Cars
      • Business Objects
        • Money
        • Working rates
        • Tax

 

Variables in Memory

 

  • A address can only hold one variable
  • When you add a new value to a variable it over-rides the original one.
    • X=10
    • X=20
    • X=x+10
      • X changes value every time here
  • The equals sign represents an assignment operator
  • The signs that we use
    • +
      • Addition
    • -
      • Subtraction
    • *
      • Multiplication
    • /
      • Division
    • %
      • Modulus
        • The remainder of your division
    • !
      • Not
    • =
      • Assignment operator
    • >=
      • Greater than or equal to
    • <=
      • Less than or equal to
    • ==
      • Equality

 

  • When we manipulate x we manipulate the value in ram

 

Data Types

 

  • Three common data types are used
    • Integer
      • Can store only whole numbers
    • Floating point numbers
      • Can store numbers with fractional values
    • Character
      • Can store a character
    • String
      • Character
  • Examples
    • Age
      • Integer
    • Money
      • Floating point
    • Gender
      •  Character
        • Alphanumeric
    • Surname
      • String
      • De Beer
    • Phone number
      • String
        • 011 465 7654
    • Date
      • String
        • 07/04/2015

 

  • If you are not going to use something in an expression, it is alphanumeric
  • Strings are multiple character values
  • When there is a single quotation mark it is a character
  • When there are two quotation marks then it is a collection of characters
  • Characters are for one character
  • A bit is a 0 or 1
    • One of them indicate on and the other off
  • 8 bits make a byte
  • 16 bits = 2 bytes
  • 32 bits = 4 bytes
  • 64 bits = 8 bytes


Comment

Networking

Comment

Networking

  • A network is two or more computing devices connected via some communications medium with the sole purpose of sharing information and resources. 

  

Computing Devices 

  • Smartphone  

  • Tablet  

  • Laptop 

  • Desktop 

  • Server 

  • Gaming consoles 

 

Communications medium 

  • Wired medium 

    • Cables  

      • UTP Cable 

        • Unshielded  twisted pair 

      • Coaxial 

      • Fibre optic  

    • The Copper cables can travel 100m before the line starts becoming bad 

    • Fibre optic is 700m to 1km 

  • Wireless medium 

    • Radio signals  

      • Wifi 

      • Bluetooth  

      • Infrared  

      • Microwaves    


Why we use networks 

  • Expensive  

    • It is not cost effective for people to multiple devices for multiple people 

    • It is better to share a device 

  • To centralize resources  

    • A server serves resources to a network 

      • It does not consume any resources 

 

Types of networking  

  • Peer-to-peer 

    • Just two computers communicating with another 

      • There is no server here 

      • Complete access to everyone's files 

      • Very insecure network 

  • Client-server network 

    • This is a network where all devices are connected to a server 

      • All of the data is stored on a server 

      • Not everyone is an administrator on a server 

        • There is only one or two administrators 

      • The server has increased security 

        • You only have to worry about one device  

      • The server can also store programs 

        • You can buy many licenses of a program and then virtualize,for example, Microsoft Office to everyone. 

  • Cloud based computing 

    • This is where you move all the resources to the internet 

      • Companies (ISPs) offer cloud services 

        • This means that you can create resources on their servers 

     

Here is a diagram of the different networks and how they communicate to the internet and each other.

Comment

Member Login
Welcome, (First Name)!

Forgot? Show
Log In
Enter Member Area
My Profile Not a member? Sign up. Log Out