Tuesday, July 24, 2012

Pseudo Codes

Here are some notes I made while Sir was explaining to us what Pseudo Codes were.

Type of Enlgish- common words
Infromed structure- so it does not follow a set of rules
This tries to describe the algorithim in text that resembles code although may not be

Psuedo Code Commands
Here are some fo the Psuedo Codes we did with Mr Lenon.

If...then
else
These are examples of selection commands, since you are required to select something.

Some Keywords that should be used

Repeat .. until } this is an example of a repetition command
an example of when this command is used includes : add one until a total of 50

Protest Repetition
Post Test Repetition
Intialize means set to a certain value
Input means get a value
Print means output to hard copy

Writing a pseudo code for filling a bath with water:

Task : Writing a code for "filling a bath with 80 L"


Sunday, July 22, 2012

Making An App

Today I learnt how to make an app and to be honest it was quite simple and easy to make! All i had to do was download Java, open up a site, a block editor and an emulator and there I was ready to roll !











Basically these are all the steps I followed to produce the app. Unfortunately I accidently closed the window before I took a shot, therefore I dont have the final product. Though I remember Mr. Lenon checked the app and approved it for me anyway :D 

Monday, July 16, 2012

Flowcharts


  1. What is a flowchart?
A flowchart is a means of visually presenting the flow of data through an information processing system.
2. Describe the basic flowchart symbols for;
  •  Start or end of the program a rectangle with curves on the corner
  • Computational steps or processing function of a programa rectangle with curves on its edges
  • Input or output operation a rectangular box
  • Decision making and branching a rectangular box
  • Flow line a diamond 

  1. With the decision making symbol (diamond) and the process symbol (rectangle), what are the rules for how many lines may enter and leave the symbol.
  2. In a rectangle one line must enter and one must leave. Whereas in a diamond one enters and two come out.
  3. Study the sample flowcharts then create a flowchart for a coin toss where heads means Mary pays for the pizza and Tales means Bill pays.


The sum is a variable and so is N in the example

Sunday, July 15, 2012

Algorithms


Algorithms



What is an Algorithm?

An unambiguous set of steps, which when performed correctly by a processor, will result in a process being carried out in a finite time.

For example if you were to explain to someone how to make a cup of coffee you would be defining an algorithm;


1. boil the water,

2. place coffee in the cup,

3. place sugar in the cup,

4. add the boiling water,

5. add milk,

6. stir.
1. Examine the algorithm above. What twoproperties of the algorithm enable it to correctly describe the solution to the problem of making a cup of coffee? What is it that makes an algorithm correct?(Hint: what would happen if you swapped step "6" and step "2"?)

What makes this algorithim above so effective is that it has simple commands that can be followed by a computer. Addtionally the steps are chronological, making the task easy to be carried out.

2. Define Algorithms for the following processes.
Posting a letter.

Get a piece of paper

Using a pen write what you want on the paper

Fold the paper in half

Open envelope

Place paper inside envelope

Put the flap down

Seal the envelope

Put address on the outside of envelope

Put postage stamp

Drop of in post office

Making toast.

Withdraw two slices of bread from loaf

Place bread pieces inside the toaster

Pull the lever down

Set the temperature, according to 1 2 3 4 5

Wait for the bread to come out

Spread desired topping on bread
Calling a friend on the phone

Pick up the phone

Place the designated number

Wait for dial

Start talking once you hear a voice on the other end