![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Unverified User
Join Date: Jun 2005
Location: NJ
Posts: 23
Rep Power: 0
![]() |
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
__________________
DeepTide The way is shut. It was made by those who are dead and the Dead keep it. The way is shut. |
|
|
|
|
|
#2 | |
|
Hobbyist Programmer
Join Date: Oct 2005
Posts: 211
Rep Power: 3
![]() |
Quote:
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 |
|
|
|
|
|
|
#3 |
|
Unverified User
Join Date: Jun 2005
Location: NJ
Posts: 23
Rep Power: 0
![]() |
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. |
|
|
|
|
|
#4 | |
|
Hobbyist Programmer
Join Date: Oct 2005
Posts: 211
Rep Power: 3
![]() |
Quote:
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 |
|
|
|
|
|
|
#5 |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,033
Rep Power: 5
![]() |
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 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 |
|
|
|
|
|
#6 |
|
Expert Programmer
|
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... ![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|