Thursday, December 4, 2008

One Dimensional Arrays

For the last few days we've been learning about One Dimensional Arrays. These 'arrays' provide convenient ways to work with groups of controls, sharing common functionality.

An array is simply made by dimming your variable, but with having a number in brackets after it, like this: (#). The number you input is how many of that type of variable there are, which is what an array is. Essentially, when you make an array, it's not 1 variable, but it's a huge group of variable that depends on the number you put into the brackets. This can be used for a wide variety of reasons, and it is actually the source to making animations in visual basic (something we'll be learning next week in class).

For the past few days we've been getting some work done on our group assignments, as well as getting more in-touch with arrays. We've been learning about how to calculate and format with them, and we've been combining arrays with calls, and application paths. This stuff we've been learning is much, much harder than what we've been learning before. I know I've said this many times, and I don't want you to think I'm being repetitive or extremely stupid, but I can say this with firm group to be true. It's just much harder, and I'm not sure how I'll grasp it, let alone apply it to our assignment.

These past few days haven't been good, we haven't been able to do as much progress on our assignment as we would've like to, and these arrays, calls, and application paths sure aren't helping.

Anyways, this is a sad, sad student signing off.

Posted by Chris Kaminski at 9:50 PM

Monday, December 1, 2008

Test Back + New Complex Stuff

Hey guys!

First thing's first. I got my new test back! Yay! I got a really good mark (the highest in the class), and I now have the highest average :D! I was waiting for this day, I knew it would come, and oh it feels so sweet.

Anyways, onto the new information.

For the last few days we've been learning about calls, which allow you to call code into a different part of the program. This allows your program to be much shorter, and was exampled with a song, with each chorus being called, helping you by not having to write it each and every time. It's a cool feature in VB, that I'm sure I'll use very often in the future.

Today we learned about application paths, which allow you to use information on other documents (mainly notepad, or maybe even only notepad [not sure]) and implement it into the program. This allows people, who aren't advanced with programming, to be able to simply edit the notepad document, while the program does all the work in re-arranging, formatting, and doing calculations with the info. It's pretty cool stuff.

Posted by Chris Kaminski at 9:30 PM

Thursday, November 27, 2008

Major Group Assignment!! Oh no!!

Hello faithful readers!

Me and Jacob are working together on a huge group assignment, worth a huge percentage of our mark. Our objective or purpose for this assignment is to output student report cards on the printer, with a specific format.

The information we're asked to output is as follows:

The person's name, student number, address, grade, city, mark in english, science, math, and computers, with their overall average and status (whether they failed, passed, or got in honours).

We're also required to do calculations, as we're supposed to find the average for each class. This is going to sum up a lot of the stuff we've learned in prior classes, and stuff that we still haven't learned (to the future we gooo!).

For the assignment we're asked to use application paths, in order to get the information much quicker, and so that the person who wants to edit the outputted information doesn't have to fiddle around with the code, rather, they can much easily fiddle around with notepad.

I personally think we have one of the harder questions, since we have stuff that we haven't gotten in-depth with yet, and there's a huge focus around making a much shorter code. However, Jacob and I have the highest marks in the class, so here's hoping and wishful thinking that we do good on this assignment. It's pretty complex, and I don't think we've been able to absorb a lot of the newer concepts these past few days.

Posted by Chris Kaminski at 7:43 PM

Monday, November 24, 2008

The Five Steps in Creating Programs

Welcome back!

Today we discussed the steps in making a program. No, we're not going backwards in the unit, but we're now thoroughly explaining how to make the program, with baby-steps and easy explanations on how we went through the process. Here, let me explain them to you.

First Step: Defining the Problem

This is a detailed description of what you are trying to accomplish, helping you understand the problem much better. Indicating what information will need to be entered, and what information will be outputted is also very important. These descriptions can range from a few short sentences, to hundreds of words.

Second Step: Designing a Solution

Here you show how you will solve the problem. For this, you will be using~

a) User Interface Designs- Rough sketches of how the form(s) will look, with what data you will need as input, and what controls will be required.

b) Form Settings- This is where you describe every object on the form (their properties, new settings, type of object, and purpose).

c) Flow Charts- Charts that use different shapes with different meaning, showing how the program is made.

Third Step: Code the Solution

Here, just as the title of the step outlines, you code the solution.

Fourth Step: Testing and Debugging the Program

After finishing the program, you must then test it, making sure it works, and is also foolproof. The two part you must go through in this step are:

a) Error Handling- Types of errors (syntax/run-time/logic)

b) Debugging Tools- Setting breakpoints, stepping, debug window, and using the watch.

Fifth Step: Document the Program

This is where you finish the program, and put in final touches. The parts in this step include~

a) General Specifications for the Project- Application name, the date it was created, the programmer(s); List of Filenames- Storage location (directory), project file (MAK), global file (GLOBAL.BAS), the many forms (FRM1, 2, etc).

b) Variable Dictionry- Local/module/global variables.

c) Program Comments- Explaining each line of code in the program.

As you can see, we've learned a lot of new info, and here's hoping I can take it all in!

Posted by Chris Kaminski at 4:25 PM

Thursday, November 20, 2008

Test, test, test... again! + Summary

Well, tomorrow's a test! Yay? Boo...

Chiarelli has been telling us that this test would be open-book for the last couple of days. As you could probably understand, I was very happy about that. However, because of a few unnamed students, that privilege, that right, has unfortunately been... :'(... terminated. This really sucks because not only do I have to study much more today, but I also had to finish up a coat of arms for careers, taking up my whole day, and not allowing me to study for the test until now. This sucks, because that means I'll have about 1 hour to study for the test (without visual basic to foolproof the code), and there will be no free time for me to have fun.

Anyways, our review deals with the same stuff we've been doing for the last few days. The homework we've been having after lessons is essentially the exact same program for the 6 different questions on the review~

The first one is based off the do loop until command, requiring the user to enter the radius of a sphere, with the program automatically finding the volume of it.

The second one uses do loop until, and is the exact same problem as the homework question-- converting gallons to litres from 20 to 60 gallons.

The third question is based off finding the sum off numbers with the for next statement. We are asked to find the sum of the following numerical sequence: -22, -17, -12... 473, 478

The fourth question finds all the possible volumes of solids for heights of 4 and 6, lengths of 2, 4, 6, 8, and 10, and widths of 1,2,3 to 14. This program uses the for next concept as well.

The fifth one requires us to use a chart, and allow the user to input numbers which represent the amount of weight gained in kg, outputting the value of the fine (you sign a contract to not gain weight in a year, and have to pay up according to how much weight you have gained).

The sixth one is based off the the assignment me and my partner have been doing for the past few days. The question requires you to input the ages and weights of teenage males, with an average computed of all the inputted numbers, being displayed on a separate form.

As you can see, I need to start studying. So, anyways, see-ya later!

Posted by Chris Kaminski at 9:18 PM

Wednesday, November 19, 2008

Combo Boxes

A combo box is very similar to the option frames we learned about earlier in the unit. They allow you to pick different options by simply clicking your choice. However, unlike the option commands, they do not take a large space, and are all jam-packed in a small scrollable tool (similar to a drop-down menu).

Since there is very little to talk about, I guess I can explain and display the few different types of code that pertain to combo boxes (at least the ones we learned about).

Cboinserthere.additem "whatever"
This code inserts a different option inside of the combo box.

Cboinserthere.listindex = #

This is the original option that the code is on top of when you start the program.

Ugh, as you can see, very little stuff was taught today. The concept is pretty simple, and it will be extremely efficient in future projects, but there just isn't much to talk about it, and that's a bummer (I don't want my blog to be short).

Anyways, until next time!

Posted by Chris Kaminski at 4:39 PM

Thursday, November 13, 2008

For/Next Loops

For/Next Loops are like steps, or stairs, in loops. They allow things to be done much, much quicker, with a lot less lines of code than if you wrote the whole program without loops. How are they stairs, however? Well, these loops move from one loop to another, before redoing the original loop. Confusing? Well, let's get into some more detail!

In these type of loops, you do not use the words "do" or "loop". Instead, you use "for" and "next"

An example of a program using this code is as followed, with me explaining the code~

For insertvariable1= # to # Step #

This line uses a variable, and it allows you to change the number automatically in the loop, with whatever number you want. Essentially, it goes through all these numbers, with a common stepping stone (2, 4, 6... etc).

for insertvariable2= # to # Step #
This line is just like the above, except it's inside the loop. So, when you do the original loop for variable1, you go through this loop as well. Trust me, you'll understand what I'm talking about later.

inservariable2=insertvariable1*insertvariable2
This code will multiple whatever number the first loop is at, with all the different numbers the second loop contains. Essentially, the first number that you are asking to original loop to use will multiply all the numbers that you are 'stepping' through in the second loop.

next insertvariable2
This tells you to redo the loop you are currently in, with the next number in the step.

next insertvariable1
This redoes the whole original loop, doing everything it contains all over again, but with the next number.

*NOTE* This code does not display the information in the form. Common etc.print codes can do the trick, and will be put into each specific loop in order to write the code for that loop, redoing everything.

As you can see, it's some pretty advanced stuff, but I'm sure I'll learn it all later on, and become much more acquainted with it.

Posted by Chris Kaminski at 6:42 PM