Assignment feedback

Please put the assignment name and number on the page along with your name.
Place each assignment in its own stack when you turn them in.
Type your answers.
If you work in teams (encouraged), turn in only one copy with everyone's name on it.

Background survey

I held onto this one, but the others will be returned.

Be sure to type, not hand write your assignments.

Also be sure to turn in each assignment separately, not stapled to others, and put your name
and the assignment number on it..

Join the class e-mail list

Several people inadvertently tried to send messages to the list rather than join the list.

Some of the people's confirmation messages were placed in their "Spam" folders to they
did not see them.

Be sure to turn off your "signature" file when you subscribe.

Be sure you are joining the list for the correct term and year.

Programming terminology

The total number of objects in the user interface has to equal the sum of the numbers
of objects of each class since every object is an instance of some class.  (Including the
form itself).

Some folks are confused on the term "class" -- be sure it is clear after today.

Translating English to Geek

This assignment must be done in groups.

See the sample answers on our class home page.

Events

Every event requires an event handler.

Translating English to Geek

Some people did not work in groups and refine each other's attempts.
Some people are still confusing Class and Object.

Starting a new project

Be sure you configure Windows to display the extension names for known file types.

If the name you give to a project is "testproject," it will be placed in a folder called "testproject."

The .exe file is created when you compile the program.

The VS.NET development system

The Name of an object is different than the value of its Text property.

What does changing the Multiline property of a Textbox do?

Write your first program

Don't forget to change the text property of the form.
Be sure to turn in a screen print out of the program as it is executing, not as it is being written.
Alt-PrtScrn will capture only the active window.

User interface and files

Some folks forgot to turn in a listing of the program (form1.vb).

Some folks forgot to turn in the screen shot of the program while executing.

If an given assignment has several pages to turn in, staple them all together.

Points are a measure of font size, but the size and location of buttons, etc. is measured in pixels.
(Do you know what "pixels" are)?

Form properties

Changing the Forecolor property of a form does not change the Forecolor property of a
Textbox it contains but changing the Font size does.

The Form1.vb file

Some people did not submit the listing.

Focus and tab index

Some people did not initialize focus on the Batente button.

External specification

The assignment states that you should both describe (draw) the user interface and list and describe
the events that can occur.  Your answer should address both in separate sections.  Several people 
skipped one or both of those.

You can "draw" the user interface using VS.NET -- it is as quick as a hand drawing and looks better.

Use English, not Geek or VB in writing the external description.  The programmer will write the
VB based upon your specification.

What do you want to happen if the user enters a score that is illegal or out of range?

First event handlers

Both the object definitions and the event handlers are in the form1.vb file.  The
event handler listings are at the end of the file and the object definitions are
just before them.

A "listing" is a printout of all or part of a program.  (See the "First event handler" note).

Double greeting

Several people confused events with event handlers.  For example:

"The user clicks on the clear button" is an event
"The characters in the Textbox are erased" is what the event handler does when it executes.

The Form1.vb file contains listings of both the object definitions (their names and values)
and the event handlers.


Assignment statements -- one instruction event handlers

Be sure you are clear on the difference between "assign" and "append."

Sequential execution one

Some people forgot to clear the Textbox before displaying their message so it would scroll
differently than mine.

If you had answered the hint questions I asked in the assignment, you would have discovered this error.

Assign top

People did this one in various ways -- all correct.

Assign ForeColor, BackColor and text
Assign top, left and text

Some people reassigned the value "X" to the label in each event handler, but since it
never changes, that was not necessary.  The program still worked fine and you got credit.

Translating Geek to VB

AppendText concatenates the new text with what was already there -- it appends or adds it on the current value.
That is not the same as assigning a string, which totally replaces the initial value.

Mouse event handlers

Several people ignored the MouseUp and MouseDown events.

String expression values

Some of you failed to realize the last example is a string expression not a numeric expression.
It is probably a good idea to try little experiments with an assignment like this.
In general, get in the habit of trying little experiments to see how things work.

Same values, string

A couple did four expressions with different values.  The assignment was to do four different expression, each of which
has the same value.

Using a Textbox for input

A couple of you ignored the last paragraph of the assignment stating that the Textboxes had to clear when entered
the way mine do.  Also, watch the tab order.

Numeric expression values

In evaluating a numeric expression, it multiplies or divides before adding or subtracting.
Some folks forgot to turn Option Strict On.

Payroll program

Some folks left out Option Strict On.

Some tested the program using different input values than I asked for.  I gave them credit this time,
but they should be more careful in the future.

Some people's programs gave the wrong answer, but they did not check it manually, so did not discover that they had a bug. 
Pay attention to data types -- integers are fixed point.

Arithmetic calculator

Some people forgot to change the operator (+ - * /) label.

Some people constantly reassigned the = label.  That did not hurt, but it was not necessary.

Some people re-created the variables every time any of the event handlers was execute.  They got
the correct result, but could have simplified their programs by just declaring the variables
one time (Outside the event handlers).

Again, pay attention to data types.  There are 6 numeric data types -- Integer is only one of them, 
and this program requires floating point inputs.

String expressions and variables

Alternative event handlers

A few people did not rewrite it without variables; they just copied my version.

Click counter

Coin counter

Some people did not answer the planning questions.
Some people did not reset the totals.

Generalized counting program

Some people overlooked the event that the user changes the increment amount.

Variable scope

If you are not sure of the answers, run test programs.

Message box

If you named the project "messagebox" and it therefore failed, you can turn this one in late for full credit.
Some people forgot to display the explanation point (!) icon.  The Intellisence prompts will show you how
to do it.

Change for a dollar algorithm

An algorithm cannot be vague -- it must explicitly spell out exactly what steps to follow when doing a task.
Think of the algorithm for long multiplication that you learned in grade school.

People who succeeded took one of two general approaches:

1.  Exhaustive enumeration of the 100 possibilities.
2.  Arithmetic calculation based on introspection.

String function methods

Be sure to test with strings of odd and even length.  Be sure to test with a string of length 1.

Some people used VB6 style string functions.  Their programs worked, but you need to be familiar with
the <string>.<method> functions we studied in class.  They will be on the exams, used in the next course,
and used in programs you read.  Most important, they reinforce the <object>.<method> format.

Some people used the ieeeremainder and mod functions.  They work, but you will get practice with introspection
if you try to calculate the quotient and remainder using just the methods we covered in class.

Math function methods

Be sure to test input with and without remainders and with the first larger and the first smaller.

Assigning form size

Be sure you create a new instance of the class Size and assign that appropriately.

Assigning an object to a property

Be sure you create a new instance of the class Size and assign that appropriately.

Assigning form size

Be sure you use the Tostring method in assigning the Text property of the form.

Assigning fonts

Be sure to spell the font name "wingdings" correctly.

Be sure to do both the italic and normal versions.

You can construct and assign a new Font object with one statement, for example:
   lblGreet.Font = New Font ("verdana", 10, FontStyle.Italic)
If you do that, the Font you construct will not have a name, so it cannot be referred to later.

Average of random numbers

Be sure your numbers are between 100 and 200 -- not 100 and 199 (see the note on the Random class)

Describing objects in geek

Dim myPoint As Point = New Point(3, 4)

   Construct an object called myPoint.  It is an instance of the class Point.  Assign 3 and 4 as the initial
   values of its X and Y properties.

Dim myFont As Font = New Font("Times New Roman", 25, FontStyle.Italic)

   Construct an object called myFont.  It is an instance of the class Font. Assign "Times New Roman" and 25 as the
   values of its face name and size properties.  Assign True to as the value of its Italic property.  (Other properties
   will have default values).

Dim myColor As Color = Color.FromArgb(12, 14, 100)

   Construct an object called myColor.  Assign 12, 14, and 100 as the values of its R, G, and B properties.

(I had to look in the Help files to get the names of the properties -- try it for Color).

Conditional execution, friendly program

Conditional execution, M/F

Could do with If...Then or If...Then...Else

Conditional execution, ages

Could do with nested Ifs  -- try it

Conditional execution, OT payroll

Be sure to test your program for 50 hours at $12 per hour.

Grammatical insult

Case statement

Loop, greet the user

Don't forget to display an error message for illegal input and
to test your program using 0 and 10.

Loop, compliment user

Don't forget to display an error message for illegal input and
to test your program using 0 and 10.

Debug class

Loop, one at a time

Remember the metaphor of the loop index variable as a pointer.
Each time through the loop, it points to the next character in
the string.

Loop, reverse a string

Remember the metaphor of the loop index variable as a pointer.
Each time through the loop, it points to the next character in
the string, but it starts at the end and works its way back to
the first character.

Loop, count


ListBox


Array, deal cards


Array display program

Review the note on the Random class.  Generate a random number between 0 and 
9 and use that as the value of the subscript. 

Singer poll

Set up an array to count the votes -- one element per singer.  Then add one 
to the element corresponding to the selected name:  count(n) = count(n) + 1.  
Use the SelectedIndex property of the ListBox as the subscript value.

Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.