View Single Post
Old Dec 5th, 2005, 8:09 AM   #5
lectricpharaoh
SEXY SHOELESS GOD OF WAR!
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,183
Rep Power: 5 lectricpharaoh will become famous soon enough
Regarding p229n28, you are open to a run-time error:
Dim lookupNumber As Integer
lookupNumber = CInt(txtNumber.Text)
lblLocation.Text = ""
lblLocation.Text = "Location: "
Select Case lookupNumber
  Case 100 To 199
	lblLocation.Text += "Basement"
  Case 200 To 500, Is > 900
	lblLocation.Text += "Main floor"
  Case 501 To 699, 751 To 900
	lblLocation.Text += "Upper floor"
  Case 700 To 750
	lblLocation.Text += "Archives"
  Case Else
	lblLocation.Text += "Invalid Entry"
End Select
If the user sticks a non-number in the textbox, or even a number that cannot be represented as an Integer (usually due to overflow), you have a problem. I'm not sure if you've covered validation and/or exceptions yet. If not, never mind, but if so, this could be why you lost marks here.

Same thing on the second problem, but other than that, it looks great. Maybe he got confused with the way you calculated cost at 5 cents each, then subtracted 2 cents for each copy over 100- he might have been expecting something like
If copies < 100 then
  cost = 0.05 * copies
Else
  cost = 0.03 * (copies - 100) + 5
End If

Anyways, any word on progress? Have you resolved this issue, or is he still being a weenie?
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote