Monday, September 10, 2012

App Inventor: Magic 8 Ball


APP INVENTOR SECOND TASK: MAGIC 8 BALL:

The first step for creating this app was to add in the components to make this game.
This included an image, text and a sound. 
The image is a button that has had an image to replace the text with.
The text was created using a label that displays the first question asked to the user. This is then placed in a vertical arrangement so that the responses of the eight ball are also displayed in the same area as the question. 

The next step was to open the blocks editor and then add in the commands so that the eight ball displayed an answer when it was clicked.
The eight ball has eight possible outcomes for answers that it can give as an answer. When an answer is given a sound is also accompanied by the response. 


The final step was to connect the app into the app inventor emulator (or android phone) to test this app.




App Inventor: Hello Purr


APP INVENTOR FIRST TASK: HELLO PURR

The first task with making this app was adding in all the components to make the app work. This included adding a image (kitty) as well as text (pet the kitty) and sound (meow). The image of the kitty is a button icon, the text it a label and the sound is a sound component.
The next step was to open the block editor which allowed for the cat to make a sound (meow) when the image was clicked on.  


The final step was to open to created app on either a mobile device or on the mobile emulator. This enabled us to play with the app we had just created. 

Selection and Repetition


Selection and Repetition


As we have mentioned in previous lessons Algorithms are composed of three basic structures. Sequence, Selection and Repetition.

We have already looked at sequence (the single steps in the algorithms we did before are sequence) so what are selection and repetition.

Solving a problem often involves making a decision between two or more options. In an algorithm this process of making a decision is called selection.

Describe, in plain english, an algorithm for;
(you may need to research algorithms in google.
Use the word “if” ie If red then ……)

1.    Moving through a set of traffic lights.
2.    Deciding whether to take an umbrella to school.
3.    Giving a student an A, B or C on their test.

Often an algorithm will often require you to repeat a task in order to solve a problem; when this is done in an algorithm the structure is called repetition.

Describe, in plain english, an algorithm for;

1.    Adding the correct amount of cordial to water to make a drink.
2.    Filling a bucket with water.
3.    Blowing up a balloon.

Remember to post all this in your blog along with any useful links you find in the process.

Monday, July 16, 2012

Flowchart symbols and logic

FLOWCHART BASICS

The site below is excellent for understanding flowchart symbols and logic. (This will be an excellent resource for developing the flowchart required in the assessment!). For today read through the tutorial and post about the following.


1. What is a flow chart? 
Is a means of visually displaying the flow of data 

2. Describe the basic flowchart symbols for: 
  • Start or end of the program:

  • Computational steps of processing function of a program:
  • Input or output operation:
  • Decision making and branching: 
  • Flow line:

3. 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.

Only one flow line should enter and exit from a process symbol 


Only one flow line should enter a decision symbol, but two or three flow lines (one for each possible answer) should leave the decision symbol. 

4. 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.



What is an Algorithm


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.

Examine the algorithm above. What two properties 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"?)
·        It is in the correct sequence.
·        Is very specific to the task at hand.

2.      Define Algorithms for the following processes.

Posting a letter:
1. write the letter on piece of paper.
2. put letter into the envelope.
3. seal envelope
4. write the address of the person you are sending the letter to on the front 
5. stick stamp onto the right top hand corner of envelope
6. write your address onto the back of the envelope
7. walk to post office or post box
8. drop letter into the post office /post box 

Making Toast: 
1. get bread
2. go to toaster 
3. put bread into toaster
4. press leaver on toaster to push toast down
5. wait 2-3 minutes until toast pops up again 
6. take bread out of toaster
7. put desired topping onto toast 

Calling a friend on the cordless land line phone: 
1. Pick up the phone 
2. Dial the number into the phone 
3. Press the green call button
4. Wait for call to connect and the person to pick up 
5. If person doesn't answer the phone repeat steps 1-4 if person doesn't answer
6. Talk to the person

Term 3

Today is the first lesson of term 3.

Monday, June 18, 2012

Javascript Tutorial


1.     What is Java script?
A scripting programming language most commonly used to add interactive features to webpages.

2.     What is Object Oriented Programming (OOP)?
Creating a program that can use and support objects (data structures)

3.     What three components make up OOP?
Model: the data
View: visual representation of the data
Controller: the interface between the view and model

4.     Give an example of an object, a method and an event.

5.     Where is Java script placed in a html page?
It can either be placed at the head of the document (between the <head> and </head> tags) or in the body (between <body> and </body> )

6.     What four lines of code indicate the beginning and end of java script?

7.     What do java script forms do? Name two objects that could be included in a form.

8.     What four attributes does a java script button have?

Alter a basic HTML page to contain the code used in chapter 1 of this tutorial as well as display a clock as coded by the java script in the link below.