Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 22nd, 2005, 4:00 PM   #1
c0ldshadow
Unverified User
 
c0ldshadow's Avatar
 
Join Date: Jun 2005
Location: NJ
Posts: 23
Rep Power: 0 c0ldshadow is on a distinguished road
What is wrong with this code?

in a recent college course i feel i was blatantly cheated by a professor who marked 2 problems of mine entirely wrong... the attached zip file shows questions and code for 2 book problems... i have included screen shots of my program proving the code works too.

i would appreciate it if some people could take a look over these very short/basic problems and let me know what you think...

i think the teacher is racist actually and has something in for me. i seriously don't see what is wrong with the code i have written....

i would even be willing to pay some experienced coders in vb.net to write a note supporting my cause, assuming that in fact there is nothing about my code that warrants it be marked as entirely wrong....

thanks for your time,
regards,
-avery
Attached Files
File Type: zip proof.zip (27.0 KB, 49 views)
__________________
DeepTide

The way is shut.
It was made by those who are dead
and the Dead keep it.
The way is shut.
c0ldshadow is offline   Reply With Quote
Old Nov 22nd, 2005, 4:24 PM   #2
MBirchmeier
Hobbyist Programmer
 
Join Date: Oct 2005
Posts: 211
Rep Power: 3 MBirchmeier is on a distinguished road
Quote:
Originally Posted by c0ldshadow
i would even be willing to pay some experienced coders in vb.net to write a note supporting my cause, assuming that in fact there is nothing about my code that warrants it be marked as entirely wrong....

thanks for your time,
regards,
-avery
Your code looks right on the surface but I have a few questions.

1.) Is there maybe a principle in the book that was covered that you didn't use? Perhaps this is why your teacher is marking down.

2.) Is it possible that your teacher is grading directly from a book? Especially with the copies one, your algorithm isn't 'standard' to what I would call a 'text book answer' perhaps your teacher doesn't recognize them as valid?

3.) Have you asked the teacher why he marked them wrong? Maybe he has some valid reasoning, or will give you the points back if you explain why your code is valid.

4.) Is there someone over the teachers head you can talk to if all else goes wrong. A principle (in high school) or a dean or department head (in college).

If you do elevate the problem leave all feelings out of what you say. Only state the facts, your problem was solved correctly, and within the context of the assignment, yet you still lost the points. I've found people that cry discrimination, whether it be true or not, tend to lose credibility when going over someone's head.

Letters from experts probablly won't solve the situation, taking care of it first hand might get the job done. I had a similar problem in middle school... the textbooks were outdated for science and I kept putting the 'right answer' not what the textbook had. Caused me some grief, but persistance paid off and I got points back.

-MBirchmeier
MBirchmeier is offline   Reply With Quote
Old Nov 23rd, 2005, 5:12 AM   #3
c0ldshadow
Unverified User
 
c0ldshadow's Avatar
 
Join Date: Jun 2005
Location: NJ
Posts: 23
Rep Power: 0 c0ldshadow is on a distinguished road
thanks for the response mbirchmeier ..

regarding 1), i am not sure..
regarding 2), i dont know if the teacher is grading directly from a book.

for 3), the teacher is closed off to even talking to me about what is wrong with my assigments.. doesnt think my code "works".

regarding 4), yes i do think they are ppl i can talk to and i will likely be doing that soon since the teacher is so closed-minded and appears to hate me.

ill make sure i just say the facts and leave emotions or whatever out of it.

thanks for the advice,
-c0ldshadow
__________________
DeepTide

The way is shut.
It was made by those who are dead
and the Dead keep it.
The way is shut.
c0ldshadow is offline   Reply With Quote
Old Nov 23rd, 2005, 12:52 PM   #4
MBirchmeier
Hobbyist Programmer
 
Join Date: Oct 2005
Posts: 211
Rep Power: 3 MBirchmeier is on a distinguished road
Quote:
Originally Posted by c0ldshadow
thanks for the response mbirchmeier ..

regarding 1), i am not sure..
regarding 2), i dont know if the teacher is grading directly from a book.

for 3), the teacher is closed off to even talking to me about what is wrong with my assigments.. doesnt think my code "works".

regarding 4), yes i do think they are ppl i can talk to and i will likely be doing that soon since the teacher is so closed-minded and appears to hate me.

ill make sure i just say the facts and leave emotions or whatever out of it.

thanks for the advice,
-c0ldshadow
I'd do everything reasonable before elevating the situation...

I'd try to take the code to the teacher and when he says it doesn't work, ask why, and ask to sit in front of a computer while doing it. And I wouldn't 'accuse' your teacher of being wrong... rather ask questions, what part do you think doesn't work, what would you have done instead, one i've used before is "It appears to compile and run for me, maybe we're doing things differently, do you mind if we sit in front of a computer and try?"

Especially if the reason is something like you left out the concept, or the teacher truly thinks what you did is wrong and just needs to see it works, then elevation will leave a bad (worse) taste of you in his mouth, and that can kill you when it comes down to the final grade.

-MBirchmeier
MBirchmeier is offline   Reply With Quote
Old Dec 5th, 2005, 7:09 AM   #5
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,010
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
Old Dec 5th, 2005, 5:37 PM   #6
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
I think CInt(X) / Ctype(X,Integer) will still throw an exception if the string cannot be interpreted as a number. Stick it in a Try...Catch and reject bad input with an error message . However perhaps this sort of information shouldn't be hardcoded, as your program could fall down if a change is required. A lookup table in a database or xml file would give you the added flexibility that could get those extra marks.

But the sort of thing he's more likely to have got hung up on is the UI; you could have used an Up/Down control instead of textbox that comes with built-in numeric type validation. Perhaps the interface could be a little clearer, highlighted total, an icon etc, it pays to show off (a little).

These sort of "unimportant" things generally concern examiners/markers more; even if you did use an amazingly elegant piece of recursion, the fact you put a combobox where a radiogroup was required is sadly more important just because of their personal views and that you violated some obscure design guidelines invented by ignorant syllabus writers in the first place. I could continue...
Rory is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:12 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC