Friday 26 June 2015

03. Introduction to Algorithms


Learning Outcomes



You will learn to:
Describe the decomposition of a problem
Describe what an algorithm is
Describe Psuedocode
Describe flowchart and flowchart shapes

Write a simple algorithm to calculate the area of a circle.

Resource
One of the best resources is the teach-ICT.com site.  Please use the following link:
http://www.teach-ict.com/gcse_computing/ocr/216_programming/algorithms/miniweb
Definition
An algorithm is simply a set of instructions for performing a task. Some algorithms are more efficient than others and we will look at these in more detail later in the course.  The purpose of an algorithm is to find a solution to a problem of to complete a goal in the most efficient and effective way possible.  A program is a set of instructions which have been written in a lNguage the computer understands in order to make the algorithm work.

Decomposition

The reason for introducing this topic now is that in order to program well you are going to need to think like a computer - particularly when you do your controlled assessment.  You need to decompose or break tasks down into small chunks so that they are easy to follow and impossible to get wrong.

Penalty Kick Algorithm


Look at the following algorithm for taking a penalty kick.  Try to work out what is wrong with it.  Remember the objective of a penalty kick is obviously to score a goal.

1. Start
2. Place football on penalty spot
3. Kick ball
4. End

TASK 1

In pairs write an algorithm for taking a penalty kick which will result in a goal being scored.

Lift Algorithm

Look at the following algorithm and work out why this one achieves all it's objectives efficiently and effectively:
1. Start
2. Wait until doors are closed
3. Wait until the floor button is pressed
  If button pressed is > than current floor
     Move lift upwards
  If button pressed is < than current floor
     Move lift downwards
4. When current floor = button pressed
5.  Open doors
6. End

TASK 2

Write an algorithm to calculate the area of a circle.
Flowcharts

Now let's explore the teach-ICT.com pages on Flowcharts

http://www.teach-ict.com/gcse_computing/ocr/216_programming/algorithms/miniweb/pg7.htm

Homework

Select either your algorithm for calculating the area of a circle or the lift operation algorithm in recreate as a flowchart.

Monday 15 June 2015

June 19th






STARTER

In your exercise books complete the following:

  1. Express 23 as a Hex?
  2. Express 23 as an 8 bit binary?
  3. Express 123 as a Hex?
  4. Express 123 as an 8 bit binary?
  5. Express 10100011 as a Hex?
  6. Express 11101011 as a Hex?
  7. Express 10101011 as a Hex?
  8. Express 11101011 as a Hex?
  9. Express 11100111 as a Hex?
  10. Express 11111011 as a denary?

Tip: for questions 5-9 split into two nibbles and show working.


Work through the SQL TUTORIAL –

1.       Practise each example in the simulator
2.       In your exercise books make a note of the key word syntax.

YOU SHOULD AIM TO FINISH THE WHOLE COURSE – HOWEVER IN TODAY'S 

LESSON MAKE SURE THAT YOU GET AS FAR AS CHAPTER ABOUT 'DELETE'.

Home
Intro

Syntax

Select

Distinct
Where

AND & OR

ORDER BY
INSERT
Update

Delete
http://www.w3schools.com/sql/sql_delete.asp

June 18th





HOMEWORK AJT DUE 22nd June

Ensure that you have complete the SQL course up to DELETE

DATA VALIDATION
On BBC Bite Size complete the following:

Watch the video

Complete the test
n.b. Repeat until you get all correct – note your answers.

As a reply to this post provide definitions with examples  of the following:

- Presence check
-  Range Check
Picture check 
-  Type check

ALSO, IF YOU HAVE NOT ALREADY COMPLETED THE CHALLENGES FROM TODAY'S LESSON THESE MUST BE DONE FOR HOMEWORK.

STARTER

  • Express 11001101 as DENARY
  •   Express 233 as BINARY
  •     Express 233 as HEX
  •     Express 167 as HEX

SHOW YOUR WORKING

1.       First let’s finish our notes from Teach-ICT.com

http://www.teach-ict.com/as_as_computing/ocr/H447/F453/3_3_9/sqlintro/miniweb/pg5.htm



CHALLENGE 1


The two tables Product and Supplier form a relational database used by a shoe shop.





(a)    State the primary key of the Supplier table and justify your choice.  (2) 




(b)   List the results of executing the following SQL query on the database above. (4)


SELECT Product.Name, Product.Quantity, Supplier.PostCode
FROM Product, Supplier WHERE Product.Quantity > 40 AND Supplier.Name = ‘Trainers4Us’
AND Product.SupplierCode = Supplier.SupplierCode 

(c)    Write an SQL statement to add the following data to the Product table:  (3)

444AA  Slippers  6.99  32  100  


CHALLENGE 2
(a)    Look at the Products table. Write an SQL statement that orders the products alphabetically by supplier name (3)

(b)   Look at the Products table. Write an SQL statement that orders the by the quantity with the largest first? (3)




Tuesday 9 June 2015

Representation of Character




In your books do the following:

(1) Find an ASCII table

(2) How many bytes does an ASCII table take up?

(3) What does ACII mean?

(4) What is ASCII used for?

(3) What is 'D' as a denary in ASCII?

(4) What is 'g' as a denary in ASCII?

(5) List all the differences between ASCII and UNICODE

(6) How many bytes does Unicode take up?

(7) How many characters can UNICODE display?

(8) Why do we need UNICODE?

HOMEWORK

By a reply to this post write up some research on QUANTUM COMPUTING.  Answer the following:

What is Quantum Computing?
How does it work?
What is it used for?
What are its advantages?
What are its disadvantages?
How can it help change the world?

BIG QUESTIONS - BUT REMEMBER CUTTING AND PASTING IS A WASTE OF TIME!



SQL

SQL

STARTER COMPLETE THE QUIZ

How many did you get?

DEFINITION

Find and write down a definition of SQL.  What is it used for?

BASIC SYNTAX
Write the basic keywords in your notebook:


PRACTICSE

Now let’s practise using the w3schools site – let’s go through the first four chapters:

Monday 8 June 2015

REVISION FOR MOCK EXAM

June 8th Database Activities

Databases Reprise

In this section we are going to reprise our work on databases.


Look at the table below:

The table below contains details of animals at a zoo and the enclosure they live in.

Zoo
ID
Name
Breed
Gender
Date_Of_Birth
Enclosure
Capacity
Headkeeper
C009
Terry
Lion
Male
30/6/1982
Big Cats
12
J Milner
A002
Maria
Chimpanzee
Female
12/3/2012
Ape House
50
S Larkin
A019
Sam
Gibbon
Female
10/6/2002
Ape House
50
S Larkin
C015
Toni
Tiger
Female
18/6/2009
Big Cats
12
J Milner
B033

Red deer
Female
6/7/2007
Deer Park
200
A Hunt
A007
Charlie
Chimpanzee
Male
19/7/2011
Ape House
50
S Larkin

Re-organise the data into two linked tables called Animal and Enclosure.

Animal











































Enclosure














HOMEWORK

The table below is called PlayList and it lists some of the songs on five albums of children’s songs.

PlayList
Album_Title
Artist
Released
Genre
Track_No
Song_Title
Time
In The Night Garden – A Musical Journey
Andrew Davenport
2007
Children’s music
3
Hello Igglepiggle!
0:38
In The Night Garden – A Musical Journey
Andrew Davenport
2007
Children’s music
12
Catch Makka Pakka’s Og-pog!
7:32
In The Night Garden – A Musical Journey
Andrew Davenport
2007
Children’s music
16
The Pinky Ponk
1:09
Heads, Shoulders, Knees & Toes
The C.R.S. Players
2004
Children’s music
1
Hokey Cokey
2:28
Heads, Shoulders, Knees & Toes
The C.R.S. Players
2004
Children’s music
12
Ten Green Bottles
2:33
50 Nursery Rhyme Songs
Countdown Kids
2009
Children’s music
1
Old MacDonald Had a farm
2:03
50 Nursery Rhyme Songs
Countdown Kids
2009
Children’s music
3
This Little Pig
1:13
50 Nursery Rhyme Songs
Countdown Kids
2009
Children’s music
12
Six Little Ducks
1:02
CBeebies the Album
Various Artists
2012
Children’s music
5
My Name is
1:21
CBeebies the Album
Various Artists
2012
Children’s music
12
Everything’s Rosie Theme Tune
0:43
CBeebies the Album
Various Artists
2012
Children’s music
21
Summer Song
1:54
Children’s Party Time
Kid’s Players
1995
Children’s music
12
The Birdie Song
2:23

·           Reorganise the data in the table above into two linked tables called Album and Song.
·           Describe how the relationship between the two tables (Album and Song) is created.
·           Give the number of fields and records in the Album table and in the Song table.