|
|
The following includes two simple examples of how
one would respond to discussion board questions in a computer
programming class online. The first example is an explicit
question related to the programming assignment. This student is
seeking clarification about the specifications.
Example 1
Student:
Professor,
The requirement for Total Tax states: the summation of all the amounts applied
to all the future values. This seems pretty clear, but just to be sure I have
restated what I think I know. Each future value is calculated under the
ButtonAddAmount_Click, then accumulated so they can be used to calculate
the Total Tax in the ButtonCalculate_click.
Is this correct?
Thanks,
Some Student
Professor Response:
Some Student,
Yes, it should be calculated where the program uses the loop to traverse the
list boxes. Since the principals above $1000 should be taxed at 1.5 times the
original rate, you have to use an if statement (in the loop) to determine which
tax rate should be applied.
Cheers,
Professor
In this simple example, the professor provides the
student a direct answer because of the nature of the question.
The student was not seeking a programming solution, but rather a
clarification of the assignment specifications. In this next
example, the student asks specifically for a programming solution to
the assignment. In response, the student is provided an example
referencing the parallel program provided.
Example 2
Student:
Professor,
One of the requirements for the assignment reads: "Determine which future
value calculation to apply using a Select-Case statement". The "Case" part is
fairly easy, but the test portion of the Selection does not seem as simple. My
solution was to declare a variable before the first procedure and then set that
variable in a Check_Changed event for each radio-button. Then I use a
Select-Case based on the value of the variable. Anybody know a simpler way?
For some reason this method seems like the 'long way around'.
Thanks,
Some Student
Professor Response:
Some Student,
Refer to the example program and you will see the following syntax:
Select Case True
Case RadioButton1.Checked
MessageBox.Show("1 is checked")
Case RadioButton2.Checked
MessageBox.Show("2 is checked")
Case RadioButton3.Checked
MessageBox.Show("3 is checked")
End Select
This is how you use the Select Case statement with radio buttons.
Cheers,
Albert
In this example, the student was asking for a
specific solution. Rather than provide the exact syntax, the
instructor refers to the example program's syntax to communicate the
requirements.
|