Public Class Form1
Dim Pass As String
Dim User As String
Dim Account As userlist
Structure userlist
Dim registeruser As String
Dim registerpass As String
End Structure
Private Sub Register_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Register.Click
Account.registeruser = signuser.Text
Account.registerpass = signpass.Text
signuser.Clear()
signpass.Clear()
End Sub
Private Sub Submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Submit.Click
User = username.Text
Pass = pword.Text
If Pass = Account.registerpass And User = Account.registeruser Then
Label7.Text = "Welcome"
Else
Label7.Text = "Incorrect Password"
End If
End Sub
End Class
Sunday, 12 June 2011
Wednesday, 1 June 2011
Javascript
Here is some javascript which creates this:
<html>
<body>
<script>
function show_equation()
{
var action=prompt("What would you like to do? Add, Subtract, Multiply or Divide?","Add");
var n1=document.vari.no1.value;
var n2=document.vari.no2.value;
switch(action)
{
case (action == "add" || "Add"):
alert(Number(n1)+Number(n2))
break;
case (action == "subtract" || "Subtract"):
alert(Number(n1)-Number(n2))
break;
case (action == "multiply" || "Multiply"):
alert(Number(n1)*Number(n2))
break;
case (action == "divide" || "Divide"):
alert(Number(n1)/Number(n2))
break;
}
}
</script>
<form name="vari">
<input name="no1" type="text">
<input name="no2" type="text">
<input name="calculate" type="button" onclick="show_equation()" value="Calculate" />
</form>
</body>
</html>
</body>
</html>
<html>
<body>
<script>
function show_equation()
{
var action=prompt("What would you like to do? Add, Subtract, Multiply or Divide?","Add");
var n1=document.vari.no1.value;
var n2=document.vari.no2.value;
switch(action)
{
case (action == "add" || "Add"):
alert(Number(n1)+Number(n2))
break;
case (action == "subtract" || "Subtract"):
alert(Number(n1)-Number(n2))
break;
case (action == "multiply" || "Multiply"):
alert(Number(n1)*Number(n2))
break;
case (action == "divide" || "Divide"):
alert(Number(n1)/Number(n2))
break;
}
}
</script>
<form name="vari">
<input name="no1" type="text">
<input name="no2" type="text">
<input name="calculate" type="button" onclick="show_equation()" value="Calculate" />
</form>
</body>
</html>
</body>
</html>
Sunday, 20 March 2011
Exam Question May/June 2010
May/June 2010
Students take exams in all their subjects at the end of every year. A procedure is to be written which inputs the marks of a student from the STUDENT file and calculates the mean mark for that student,
Produce an algorithm which will carry out the above taks. The Procedure is to be called MEAN.
Procedure Mean
NumberofMarks = 0
Total = 0
Do While there are marks
Get Mark
NumberofMarks = NumberofMarks + 1
Total = Total + Mark
End While
Mean = Total/NumberofMarks
End
The school awards a prize each year to the students who achieve the highest mean mark in their form.
Produce an algorithm for a procedure called PRIZE which will determine which student will win the prize for a particular form. The name of the form and the name of the student should then be saved to a file called PRIZES.
Procedure Prize
OPEN FILE STUDENTS
SEARCH FOR FORM
SET HIGH = 0
WHILE NOT END OF STUDENTS, DO
CALL PROCEDURE MEAN
IF AVERAGE > HIGH THEN HIGH = AVERAGE; STUDENT = CURRENT NAME;
FLAG = FALSE
ELSE IF AVERAGE = HIGH THEN FLAG = TRUE
ENDIF
ENDIF
ENDWHILE
IF FLAG = TRUE THEN REPORT ‘Problem Equal high scorers’
ELSE OPEN FILE ‘PRIZES’
COPY FORM AND STUDENT TO PRIZES
END
Students take exams in all their subjects at the end of every year. A procedure is to be written which inputs the marks of a student from the STUDENT file and calculates the mean mark for that student,
Produce an algorithm which will carry out the above taks. The Procedure is to be called MEAN.
Procedure Mean
NumberofMarks = 0
Total = 0
Do While there are marks
Get Mark
NumberofMarks = NumberofMarks + 1
Total = Total + Mark
End While
Mean = Total/NumberofMarks
End
The school awards a prize each year to the students who achieve the highest mean mark in their form.
Produce an algorithm for a procedure called PRIZE which will determine which student will win the prize for a particular form. The name of the form and the name of the student should then be saved to a file called PRIZES.
Procedure Prize
OPEN FILE STUDENTS
SEARCH FOR FORM
SET HIGH = 0
WHILE NOT END OF STUDENTS, DO
CALL PROCEDURE MEAN
IF AVERAGE > HIGH THEN HIGH = AVERAGE; STUDENT = CURRENT NAME;
FLAG = FALSE
ELSE IF AVERAGE = HIGH THEN FLAG = TRUE
ENDIF
ENDIF
ENDWHILE
IF FLAG = TRUE THEN REPORT ‘Problem Equal high scorers’
ELSE OPEN FILE ‘PRIZES’
COPY FORM AND STUDENT TO PRIZES
END
Wednesday, 16 March 2011
Sunday, 13 March 2011
People & Info
An example of how it can be used and who uses it
Wiki
Wiki's allow the creation and editing of web articles. Contributors to wiki's are able to edit the information on each page. They can be used as a source for information and can be used as a database for information.
e.g. wikipedia
Blog
A blog is often maintained by one frequent poster. It allows the user to share information on the internet allowing viewers to post comments on each blog entry.
e.g. blogspot
Microblogging
A Microblog differs to a normal blog in that its content is smaller then that of a normal blog. It can be used to give small quick updates to followers.
e.g. twitter
RSS
RSS (Real Simple Syndication) is a standardised form of web feeds used to publish frequent updates of work.
Wiki
Wiki's allow the creation and editing of web articles. Contributors to wiki's are able to edit the information on each page. They can be used as a source for information and can be used as a database for information.
e.g. wikipedia
Blog
A blog is often maintained by one frequent poster. It allows the user to share information on the internet allowing viewers to post comments on each blog entry.
e.g. blogspot
Microblogging
A Microblog differs to a normal blog in that its content is smaller then that of a normal blog. It can be used to give small quick updates to followers.
e.g. twitter
RSS
RSS (Real Simple Syndication) is a standardised form of web feeds used to publish frequent updates of work.
Tuesday, 8 March 2011
Data 1.3
Character Set
Character set is the agreement of which binary number represents which character of the language.
ASCII (American Standard Code for Information Interchange) is a 7bit (128 chatacters) system that has a parity character check. Extended ASCII & Unicode are an 8bit (256 characters) system to allow for more characters.
Data Types
Integer - 32bit - whole number
Boolean - 1bit - yes/no
date/time - integer/decimal
currency - decimal(limited)
character - 16bit
String - text
Character set is the agreement of which binary number represents which character of the language.
ASCII (American Standard Code for Information Interchange) is a 7bit (128 chatacters) system that has a parity character check. Extended ASCII & Unicode are an 8bit (256 characters) system to allow for more characters.
Data Types
Integer - 32bit - whole number
Boolean - 1bit - yes/no
date/time - integer/decimal
currency - decimal(limited)
character - 16bit
String - text
Thursday, 3 March 2011
System Software 1.2
Operating Systems
Operating systems help provide a way for application software to communicate with the computer hardware and use its resources.
They consist of programs and data help run the computer and manage hardware. They provide common services to allow easy execution of application software.
Types of Operating Systems
Batch - A Batch OS is operating system which analyzes your input into the system and then groups them into batch's according to different characteristics.
Real Time Operating System (RTOS) - Real-time operating systems are used to control machinery, scientific instruments and industrial systems in real time (live).
Single user, Single task - Designed to allow one user effectively manage one task at a time.
Single user, Multi tasking - This allows a single user to run multiple applications at a time.
Multi-user - Allows multiple users to take advantage of the computers resources at the same time.
Processing
Batch processing is execution of a series of programs ("jobs") on a computer without manual intervention. e.g. Cheque processing
Real time processing is data processing that appears to take place, or actually takes place, instantaneously upon data entry or receipt of a command.
Operating systems help provide a way for application software to communicate with the computer hardware and use its resources.
They consist of programs and data help run the computer and manage hardware. They provide common services to allow easy execution of application software.
Types of Operating Systems
Batch - A Batch OS is operating system which analyzes your input into the system and then groups them into batch's according to different characteristics.
Real Time Operating System (RTOS) - Real-time operating systems are used to control machinery, scientific instruments and industrial systems in real time (live).
Single user, Single task - Designed to allow one user effectively manage one task at a time.
Single user, Multi tasking - This allows a single user to run multiple applications at a time.
Multi-user - Allows multiple users to take advantage of the computers resources at the same time.
Processing
Batch processing is execution of a series of programs ("jobs") on a computer without manual intervention. e.g. Cheque processing
Real time processing is data processing that appears to take place, or actually takes place, instantaneously upon data entry or receipt of a command.
Wednesday, 2 March 2011
Hardware & Software 1.1
Hardware
Input >>>> RAM <<<>>>Processor>>>>Output
^
^
v
v
Storage
Software
Softare = sets of instructions which tell the system how to do things. These sets of instructions are collected together in workanle groups known as programs.
e.g Operating system, user interface software, translator software, common application.
Operating system provides translating software for itself. Translator software translates high level language in to machine code.
Applications
-Common; used all around the world for single purposes e.g. iPhoto, editing photos
-Generic; used for multiple reasons e.g. word, excel
-Custom; unique scenario, for one task e.g. unique software for unique car. Very costly but you only pay for what you need/want
-Off the shelf; opposite to custom, you pay the developers for all of the software instead of specific required software, however, price is shared between all buyers, help from developers and other users
Utility software allows users to change system
Input >>>> RAM <<<>>>Processor>>>>Output
^
^
v
v
Storage
Software
Softare = sets of instructions which tell the system how to do things. These sets of instructions are collected together in workanle groups known as programs.
e.g Operating system, user interface software, translator software, common application.
Operating system provides translating software for itself. Translator software translates high level language in to machine code.
Applications
-Common; used all around the world for single purposes e.g. iPhoto, editing photos
-Generic; used for multiple reasons e.g. word, excel
-Custom; unique scenario, for one task e.g. unique software for unique car. Very costly but you only pay for what you need/want
-Off the shelf; opposite to custom, you pay the developers for all of the software instead of specific required software, however, price is shared between all buyers, help from developers and other users
Utility software allows users to change system
Sunday, 20 February 2011
Arrays
Dim Grade (13) as String
Dim Integer as Integer
For Index = 0 to 13 For loop has to have a variable
Grade(Index) = "A"
to be added to...
Dim Integer as Integer
For Index = 0 to 13 For loop has to have a variable
Grade(Index) = "A"
to be added to...
Thursday, 17 February 2011
The 3 types of Loops
There are three types of loops:
For...Next Fixed number for identical processing
Do While Monitors the status quo and reacts to changes (sensors)
Loop...Until Target (loop until target is changed)
For...Next
Used to run a piece of code a set number of times. As its name suggest, it is used when a function needs to be carried out for each of several items. It doesn't monitor conditions like the other types of loops
Do While
Runs a piece of code if a condition is true. If the loop starts running, here must be a section inside the loop to either alter the condition or break out of the loop, otherwise it will run indefinitely. It monitors the change in conditions, and reacts to changes accordingly.
Loop...Until loop
Similar to the Do While loop except that it will always run the code inside before checking whether the condition is true; that is, the code inside will always run at least once even if the condition is false. It monitors the change in conditions, and reacts to changes accordingly.
For...Next Fixed number for identical processing
Do While Monitors the status quo and reacts to changes (sensors)
Loop...Until Target (loop until target is changed)
For...Next
Used to run a piece of code a set number of times. As its name suggest, it is used when a function needs to be carried out for each of several items. It doesn't monitor conditions like the other types of loops
Do While
Runs a piece of code if a condition is true. If the loop starts running, here must be a section inside the loop to either alter the condition or break out of the loop, otherwise it will run indefinitely. It monitors the change in conditions, and reacts to changes accordingly.
Loop...Until loop
Similar to the Do While loop except that it will always run the code inside before checking whether the condition is true; that is, the code inside will always run at least once even if the condition is false. It monitors the change in conditions, and reacts to changes accordingly.
Subscribe to:
Posts (Atom)
