Tuesday, September 20, 2011

Assignment- Scissors, paper, rock game

This is my game for scissors, paper, rock


This is the screen shot before game started
 When you click an option, it can say "it was a draw"

It can say "You Win!"



It can say " computer wins
Public Class Form1Dim userselected As IntegerDim gameresult As Integer
ComboBox1.SelectedIndex = 0
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.LoadEnd Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickDim Random As New Random











Dim computerchoice = Random.Next(3)If computerchoice = userselected Then gameresult = 0Select Case computerchoiceCase 0If userselected = 1 Then gameresult = 2If userselected = 2 Then gameresult = 1Case 1If userselected = 0 Then gameresult = 1If userselected = 2 Then gameresult = 2Case 2If userselected = 0 Then gameresult = 2If userselected = 1 Then gameresult = 1End Select

Label1.Text = Select Case gameresultCase 0"It Was A Draw"
Label1.Text = Case 1"Computer Wins"
Label1.Text = Case 2"You Win!"End SelectEnd Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChangedEnd SubEnd Class

This is the code it is set on computer choice which means that the computer chooses the result which can either be "It Was A Draw", "Computer Wins", "You Win!"


This a flowchart of what happens



Sunday, August 28, 2011

Tic Tac Toe javascript


This is my tic tac toe game, it is 2 players and if you click the box next to 'against the computer' you versus the computer. I use sharepoint to help create it and include messages such as the one shown saying who won and whether you want to play again

Monday, July 25, 2011

Selection and repetition

Selection- 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.
Examples:
Moving through a set of traffic lights:
1. While driving along a road and come across a set of traffic lights.
2. If the green light is on, then continue driving as before.
3. If the yellow light is on, then begin to slow down and prepare to stop.
4. If the red light is on, then stop your vehicle immediately.

Deciding whether to take an umbrella to school.

1.Look outside of the house to determine the weather at that particular moment.
If:
- It is a sunny fine day, do not take an umbrella.
- It is a cloudy or rainy day take an umbrella with you.

Giving a student an A, B or C on their test.

Calculate the student's percentage of the score the student got on his test result.
If:
- the student got between 0 - 33.3% give them a C.
- the student got between 33.4 - 66.6% give them a B.
- the student got between 66.7 - 100% give them a A.

Repetition- Doing something again and again until you're satisfied, a set of repeated actions.


Examples:
 Filling a bucket with water.
1) Place bucket under tap.
2) Turn tap on.
3) Wait 0.5 minute:
If:
- 4/5 of bucket is filled close tap
- If 4/5 of bucket is not filled progress to step 4
4) Repeat step 3)until 4/5 of bucket is filled up.

Blowing up a balloon:
1. Take a balloon and blow air inside of it using your mouth.
2. Repeat blowing the balloon (blowing and stopping to gain air).
3. Stop blowing the balloon, press the open hole of the balloon to stop the air from escaping it and check if the balloon is the correct size you wanted.
4. Repeat until satisfied (until the balloon has been blown up to the correct size).
5. Tie a knot (or 2) at the opening of the balloon.







Thursday, July 21, 2011

Algorithms

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"?)

Firstly they must be labelled in the correct order and second you must include every step in the process. An algorithm is correct when the steps of the process is in the right order eg. in step 6 of how to make a cup of cofee you can't start stiring unless you got the coffee mixture in their with the coffee in step 2
2. Define Algorithms for the following processes.
Posting a letter.

1. Get the materials needed such as pen, paper, envelope, stamp, other things included in letter
2. Write the letter with a pen and include other items you want included in the letter eg. photographs, money, etc.
3. Place the letter in an envelope.
4. Seal the envelope.
5. Write the details of the person your sending the letter to on the front of envelope
6. Place stamp in front of envelope
7. Go to post office.
8.Place envelope in the post box.

Making toast. Calling a friend on the phone

1. buy bread from store

2. buy toaster from store
3. buy topping from store
4.place bread in toaster
5. choose the setting for the toasting degree
6. press the toaster button down.
7. wait for the bread to toast.
8. take bread out of toaster after done toasting
9. place toast on plate
10. Put a topping on your toast
11. place toast in hand
12. open mouth
13. place toast in open mouth
14. close mouth.

15. chew
16 .repeat steps 12-15 until all consumed.
17. clean up.

Calling a friend on the phone

1. Get the phone

2. Find your friend's number in which your goning to call
3. Dial his/her number on the phone using the number buttons
4. Press the call button
5. Wait till he/she picks up the phone
6. Hold phone to ear to talk on the phone
7. Once done talking, press the end call button
8. Put the phone back



Tuesday, July 19, 2011

Flowchart symbols and logic

What is a flowchart?

The flowchart is a means of visually presenting the flow of data through an information processing systems, the operations performed within the system and the sequence in which they are performed.

Describe the basic flowchart symbols for;


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 come out from a process symbol
Only one flow line should enter a decision symbol, but two or three flow lines could leave as each flow line could be a possible answer

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.

Friday, July 1, 2011

assignment

i have uploaded my website on studentnet under student work in IST

Thursday, June 30, 2011

Website Assignment

I am finished my website, it was quite difficult but once I got the hang of Microsoft Office Sharepoint Designer it became easier. The name of my website is Trendy 101on music,movies,styles,gossip and IT careers. Here is the storyboard of my site

This page is where you login- Login for Mr Cavil
                                              username: MrCavil
                                              password: Password2


If you enter the incorrect password this is what comes up
When you enter the correct login this comes up
Then this page sends you to the home page which links you to the latest music,movies,styles,gossip and careers

You can then go to the Music Page- you can learn about new songs ang links to the youtube music video of the song
Movie Page- find out the latest movies in the cinemas and find out the director,who stars in it,what the plot is and a trailer of the film

Styles page- See new clothes and find out how they cost and from what store

Gossip page- Find out what is happening with your favourite celebrites

and IT Careers- A list of IT careers