Tuesday, October 6, 2009

Party Toonz - Post 1 - due 18.10.09





I have completed the GUI for the main, add new product and about pages as above
The logo and bright colours are used to grab interest of the user

Sunday, October 4, 2009

Arrays & File Handling

Assessments for Arrays & File Handling
completed and handed in today

Monday, September 14, 2009

Semester 2 - Week 9

Yesterday we started working on "Product Catalog"
Today we continued learning and reviewing for final assessment

Used the media player - which is not in the toolbox default
- right click on toolbox - choose components - scroll to bottom - media player

Monday, August 24, 2009

Databases cont.

WHERE, LIKE - are filters

Relational Operators - use to evaluate if the condition is true
>
<
<>
>=
<=
=

Array:
Dim strSQLStrings() As String = {"SELECT * FROM ApprovedTravelRequests", _
"SELECT [Travel Cost]FROM ApprovedTravelRequests", _
"SELECT [Travel Cost], [Location] FROM ApprovedTravelRequests", _
"SELECT * FROM ApprovedTravelRequests WHERE Location = 'Richmond, VA'", _
"SELECT * FROM ApprovedTravelRequests WHERE Location LIKE 'R%'", _
"SELECT * FROM ApprovedTravelRequests WHERE Location LIKE '%R'", _
"SELECT * FROM ApprovedTravelRequests WHERE [Last Name] LIKE 'S%'"SELECT * FROM ApprovedTravelRequests WHERE [Last Name] LIKE 'RA%'", _
"SELECT * FROM ApprovedTravelRequests WHERE [Last Name] LIKE '%LAS'", _
"SELECT * FROM ApprovedTravelRequests WHERE [Travel Cost] > 1000", _
"SELECT * FROM ApprovedTravelRequests WHERE [Travel Cost] < 1000", _
"SELECT * FROM ApprovedTravelRequests WHERE [First Name] = 'Janet' And [Last Name] = 'Dunford'", _
"SELECT * FROM ApprovedTravelRequests WHERE [First Name] = 'Janet' Or [Last Name] = 'Tirrell'", _
"SELECT * FROM ApprovedTravelRequests WHERE Location = 'Chicago, Illinois' And [Purpose For Travel] = 'Financial Seminar'", _
"SELECT * FROM ApprovedTravelRequests WHERE Location = 'Chicago, Illinois' Or [Purpose For Travel] = 'Financial Seminar'"}
' Anything in ' ' is case sensitive
' 'R%' brings up locations starting with R,
' %R' brings up locations ending in R,
' %A% brings up locations starting & ending with A
' Use [ ] where a space has been inserted in name
' % is a wildcard - fills in for fuzzy characters
' >= is a relational operator to
' logical operators AND OR to combine fields for search
% is a wild card character - fills in for other characters
Use [ ] where a space has been inserted in name
Anything in quotes is case sensitive

Databases - SQL

SQL = Structured Query Language

* in SQL = ALL

Tool used for data base = DataGridView

Functions: Select, Delete, Update, Insert

Concepts:
ConnectionString
ConnectionObject
CommandObject
DataAdapter
DataSetObject

Remember: PrimaryKey & AutoNumber is a unique identity field

ID IS KING

Specify driver for type of string

Monday, August 17, 2009

Databases

Access Database
SQL - Structured Query Language
Language used for insert, update, select, delete

Creates Reports & Queries

Concept for Project
ConnectionString: The supermarket address
ConnectionObject: The car
CommandObject: The shopping list
DataAdapter: Mum doing the shopping
DataSetObject: Pantry

* in SQL = ALL

ID IS KING

Sunday, August 16, 2009

Relational Database Management System - Access

Can create queries & reports from Access Database

Table contains:
Columns are knows as "fields"
Rows contain "records"

Declare the datatype for field

ID is used a lot in databases - if you know the ID, that's all that is needed to know to access a record

ID can be the Primary Key - only one field can be the Primary Key

Blog Task

1. What is a data base?
A database is a collection of data that is organised in tables/list about a specific topic that can be easily accessed, managed and updated. Anything that stores lists/tables of data, ie, inventory list.

2. What are the different types of databases?
Flat file database excel spreadsheet.
Relational database, this is a tabular type database in which data is defined so that it can be reorganized and accessed in a number of different ways, eg. lists.
Distributed database database is one that stored on various computers in a network - multiple user, eg. Chisholm.
Object-oriented programming database - works well with object programming languages

Monday, August 10, 2009

Ch 9 File Handling

System IO

IO.File
- Creating Files
- Deleting Files
- Moving Files
- Copying Files
- Opening Files

StreamReader - IO.StreamReader
StreamWriter - IO.StreamWriter - has functionality for text

Constructor = On Switch

Sunday, August 9, 2009

Ch 9 Using Arrays & File Handling

Explicite defined array

Dim MyVariable As DateType = x
Dim strName As String = "Rach"
Dim MyArray(5) As DataType
Dim strNames(2) As String

' Assign values
strNames(0) = "Rach"
strNames(1) = "Pam"
strNames(2) = "David"

An array contains multiple elements - array index begins at 0

Implicitly sized Array

Declare an array and populate with no definate value assigned
Dim strNames() As String = ("Baker", "Lopez", "Buck", "Chan", "Tirrell")
Dim intReservations() As Integer = {4, 5, 12, 2, 8}

Parallel Arrays
Dim intDinnerBookings(2) As Integer
Dim strNames(2) As String
' Loop to populate
' Data Table - strNames
' Bookings - intDinnerBookings

Dim ItemArray() As String = {"x", "y", "z"}
' 3 elements
Dim intCount As Integer
'Declared an Integer Variable

For intCount = 0 To ItemArray.Length -1
'Length = number of elements so .Length = -1
'Extract each item into the loop - start at 0
lstBox.Item.Add(ItemArray(intCount))

Next

Length returns the number of elements - not the upperbound

Index begins at zero
if the -1 is omitted from the .Length - it will loop 4 times instead of 3

= IndexOutOfRange Exception. A Try-Catch statement can catch this exception, but it is best to stay within the array boundaries of zero and the upper-bound array subscript.

Use loops to populate the array

Sorting Arrays
When applied - (default) the lowest value is placed in the 1st element in the array with an index of zero, next lowest is placed in the second element, etc

Array.Sort(ArrayName)
'Sort is a Function
Dim intAges() as Integer = {16, 64, 41, 8, 19, 81, 23}
Array.Sort(intAges)

Search Arrays
Sequential - searching each element with first name - not particularly efficient in large list
Binary - searches a sorted array for a value using a binary search algorithm = by repeatedly dividing the search interval in half = sort first - splits in half - searches on upper half of array to match the index - if match continues to split - no match - searches on lower half - them splits until found

Revision - Ch 8

Defining A Function - what values need to be passed into the function

Public Function MultiplyAge(intAge As Integer)
intAge = intAge * 3
return intAge
End Function

Procedure

Public Sub MultiplyAge(intAge As Integer)
intAge = intAge * 3
End Sub

Try-Catch Structure

Detects exceptions and takes corrective action
"Try" - to execute this code
"Catch" - errors here

starts with specific exception - ends with generic exception

Commonly used:
FormatException = most common
OverflowException = follows
SystemException = finish with

Everything in the Try-Catch will be done as a block

Monday, August 3, 2009

Chapter 7 - Exception Handling

Exception handling = handling errors
Expect the worst from users

Allows the program to elegantly negotiate the error

To work with numeric:
try
intNumber=txtTextBox.Text
Catch ThisException As Exception
'reporting
'reporting
End try

Exception is a Class Object

AgumentNullException is a variable that has no value is passed to a procedure
Dim strTerm As String
Me.lstDisplay.Items.Add(strTerm)

DivideByZeroException is where a value is divided by zero
intResult= intNum / 0

FormatException - A format is converted to another type that is not possible
strTerm = "Code"
intValue = Convert.ToInt32(strTerm)

NullReferenceException - A procedure is called when the result is not possible
Dim strTerm As String
intValue = strTerm.Length

OverflowException = A value exceeds its assigned data type
Dim intCost as Integer
intCost = 58 ^ 4000000000

System Exception - Generic
Catches all other exceptions

Sunday, August 2, 2009

Chapter 8 - Using Procedures & Exception Handling

Visual Basics provides a generic splash screen template you can add to your project with or without modification. You can change the generic graphic on the splash screen by changing the BackgroundImage property on the Properties window. To use the generic splash screen, follow the steps starting on pg 567.

Methods, Ops, Procedures
Function:

Public Function DoesItEqualTen(intNumberOne As Integer,intNumberTwo As Integer) As Boolean
Dim blnTrueOrFalse As Boolean=False
If intNumberOne + intNumberTwo=10 Then
blnTrueOrFalse=True
Else
blnTrueOrFalse=False
Return blnTrueOrFalse
End Function

Return String

Public Function DoesItEqualTen(intNumberOne As Integer,intNumberTwo As Integer) As String
Dim blnTrueOrFalse As Boolean=False
If intNumberOne + intNumberTwo=10 Then
blnTrueOrFalse=True
Else
blnTrueOrFalse=False
Return "xxx"
End Function

Common Function
Public Sub xxx()
If IsNumeric(txtTextBox.text) Then
.......

End If
End Sub

Public Function IsNumeric(StringToLookAt As String) As Boolean
End Function

Public Function Customer Balance(AccountNumber As String) As Decimal
Dim decCustomerBalance As Decimal
............
............
Return decCustomerBalance
End Function

Calling Procedure

txtBalance.text=CustomerBalance(strAccountNumber)

Parameters

ByRef
When you type in an argument - you will get a ByRef
Pass a reference to the object

ByVal
Object is duplicated and passed to the function
Working with new object - looks the same

2 objects can have same name - different hash codes

Monday, July 27, 2009

Semester 2 Week 2 28/7/09

String Functions

IntCharacters = txtText.Length
.ToLower - changes characters to lower case
.ToUpper - changes characters to upper case

Validation Controls - ensures input is correct - could include: user must enter something in box or entry must be between eg. 1-10

Required Field Validator
If txtFirstName.Text()" " Then
continue
End If

Sunday, July 26, 2009

Chapter 7

Today we are learning about Creating Web Applications in Chapter 7
FTP = File Transfer Protocol
Default: ASPX = Active Server Page

Set up Twitter Account, names to follow:
Jake = jturner33
Adrian = bulioca
Randy = sober300
Wayne = strohy32
Sarah = alucard579
Deb = chippyandme
De = deannem75
Rachael = burntsugar

API = Application Programming Interface

Played with entering code in VB to update Twitter account - and it worked

Monday, July 20, 2009

To create a hotkey:

&File - this will create the F as a the hotkey

Do Until - condition is reached
Do While - condition is true

Do Loops - Top Control or Bottom Control.

Chapter 6 assignment finished, publised and ready to be handed in next week

Sunday, July 19, 2009

Visual Basics 20.7.09

Declaration is a space in Memory

Data Types: String, Integer, Decimal, Boolean, Date, etc.

_ underscore at end of line means to continue on next line

Functions & Procedures
Functions return values

Decision Structures have
Relational Operators: = equals, <> greater than, <> not equal to, >= greater than or equal to, <= less than or equal to
Logical Operators: And, Or

Unicode Keyboard Characters - the 256 characters & symbols used

SDLC = Software Development Life Cycle -
Reg. Analysis - GUI design -Object Design - Code - Testing - Document

Class Diagram
Object Name
Properties - describes/defines state of object
Methods - defines things the object can do
Constructor - New (argument)

Array
Populate with references to the image

Loops
A structure that repeats a set of instructions starting at 0
2 types
For Next loop - if you know the number of items - set number
Do loop - unknown number of items to be repeated - continues until it meets a condition

Monday, May 11, 2009

Alarm Clock

User instructions finalised
Assignment burned to disc and handed in

Sunday, May 10, 2009

Soooooo stressful - alarm clock works - at last
just have to do the instructions to the user now

Monday, May 4, 2009

This is the recipe for Mallee Quiche
you mix everything together & cook
it sets its own base


Mallee Quiche

4 eggs
200 gms grated tasty cheese
200 gms chopped bacon
1 chopped onion or spring onions
½ cup self raising flour
1 ½ cups milk
1 Tbls chopped parsley

· Mix all together with a fork
· Grease a 10 inch quiche dish
· Top with tomato if desired
· Bake at 350 degrees for 40 minutes or until set

Monday, March 30, 2009

Chapter 5

Completed the Practice Test
Got 2 wrong

Sunday, March 29, 2009

UML & VB/Net Open File Dialog

UML Class Diagram & VB.NET OpenFileDialog
A class diagram in the Unified Modeling Language (UML), is a type of static structure dagram that describes the structure of a system by showing the system's classes, their attributes, and the relationships between the classes.OpenFileDialog: This class lets you do the following tasks:Enable users to select one or more files on the local computer or on a networked computer.Filter the file types shown in the dialog box.Specify which filter is used when the dialog box is first displayed.

Monday, March 23, 2009

Classes & Objects - in class

Tuesday 24th March 2009

Things to remember:

Properties: things Button has
Methods: things Button does

New Class = Constructor of the Class (every Method has)

Today we started construction for "Dog and Cat"

Sunday, March 22, 2009

C4 Programming 23/3/09

Blog Task

Classes are types and Objects are instances of the Class.
Classes and Objects are very much related to each other.
Without objects you can't use a class.

In Visual Basic we create a class with the Class statement and end it with End Class.
The Syntax for a Class looks as follows:

Public Class Test
-----Variables
-----Methods
-----Properties
-----EventsEnd Class

The above syntax created a class named Test.
To create a object for this class we use the new keyword and that looks like this:
Dim obj as new Test().

The following code shows how to create a Class and access the class with an Object.

Sub Main()
Dim obj As New Test()
'creating a object obj for Test class
obj.disp()
'calling the disp method using obj
Read()

End Sub

End Module

Public Class Test
'creating a class named Test
Sub disp()
'a method named disp in the class
Write("Welcome to OOP")
End Sub
End Class

Fields, Properties, Methods, and Events are members of the class.
They can be declared as Public, Private, Protected, Friend or Protected Friend.
Fields and Properties represent information that an object contains.
Fields of a class are like variables and they can be read or set directly.
For example, if you have an object named House, you can store the numbers of rooms in it in a field named Rooms. It looks like this:

Public Class House
Public Rooms as Integer
End Class

Properties are retrieved and set like fields but are implemented using Property Get and Property Set procedures which provide more control on how values are set or returned.

Methods represent the object’s built-in procedures.
For example, a Class named Country may have methods named Area and Population.
You define methods by adding procedures, Sub routines or functions to your class.

For example, implementation of the Area and Population methods discussed above might look like this:

Public Class Country
Public Sub Area()
Write("--------")
End Sub
Public Sub population()
Write("---------")
End Sub
End Class

Events allow objects to perform actions whenever a specific occurrence takes place.
For example when we click a button a click event occurs and we can handle that event in an event handler.

Horoscope

We learned how to use a Combo Box today and did the Horoscope

I worked out how to have the "Please Select..." text to initially show on the Combo Box without having to scroll to it.

Almost finished the Parking Fines

Visual Studio 23/3/09

Finished the Wood Cabinet Estimate
and started on the Parking Ticket Fines
still finding it difficult to remember the coding
understanding the designs easier

Monday, March 9, 2009

If Statements

Learning If Statements today - understand the theory - got to get the practical right

Sunday, February 22, 2009

Visual Basic 2008 Companion Website:

www.scsite.com/vb2008

Monday, February 16, 2009

Calculator

Finished the Calculator - actually works