Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Was this unfairly graded? (java exam)

  1. Feb 14, 2010 #1
    On a recent java exam we had a problem that asked to capitalize the first word in each sentence a user entered, and echo back the new string. The example that was given was this:

    good morning. this is a good day. are you ready for the exam?
    -------> Good morning. This is a good day. Are you ready for the exam?

    I was running out of time and in my code it would only capitalize after a period, not after exclamation or question marks. However, in the example given there were only periods between each sentence, and the code I submitted works fine for these examples. The problem did NOT specifically state that we had to consider "!" and "?" as ends of sentences.

    Anyway, I was given a score of 9/20 on this problem, 45%! I talked to my professor on Friday, and he bumped me up to 12/20 or 60%. He said the problem was that it wouldn't capitalize after "!" or "?". I feel like this is highly unfair (I got 99% on the rest of the exam). 60% is not even a passing grade, and the program works great for examples such as what was given on the exam.

    So I just wanted some opinions on his grading policy for taking away initially 55% because the program doesn't work for exceptions. Is this common policy among the comp. science professors?
  2. jcsd
  3. Feb 14, 2010 #2


    User Avatar
    Science Advisor
    Homework Helper

    I got 9/100 on a comp.sci project which worked correctly in every case (for insufficient comments... thogh every procedure had comments and there were comments inside most procedures as well). That was 4/5 on checking cases, 85/85 on the program, and -80/10 on comments.

    I'd say that any grade >= 6.7/20 would be acceptable, since your code worked in one case out of 3.
  4. Feb 14, 2010 #3
    Thank you for your answer. It sounds like you got a much worse deal, docking that much for comments sounds absurd to me.

    We had 25 minutes to finish the problem, and it is an intro comp. sci. class. I didn't even consider the other cases where the sentence doesn't end with periods because the problem didn't mention it at all. I'm just banging my head against the wall because I should just have checked against '?' and '!' in the same statement that checks if the character is a period.

    I still feel that failing me on a program that works fine except for exceptions is too harsh given the time limit, but I see what you are saying.
  5. Feb 14, 2010 #4
    I disagree. The problem presented was, "capitalize the first word in each sentence". By that definition, you must consider all cases of standard sentence structure. Never assume that a provided example will cover all requirements. If your code failed to identify a colon, then I could agree to some wiggle-room.

    How does you code deal with parenthesis? (For example, this sentence.)
  6. Feb 14, 2010 #5
    I doesn't handle parenthesis either, I don't know how I could incorporate that into the program because the parenthesis could be in the middle or at the end of a sentence. I did just follow the given example, I wish now that I had asked him during the exam.

    In a homework setting I would have time to consider all cases and perhaps it would be an understandable grading, but in 25 minutes it took me a long time just to get the basic code set up, and I didn't have time to consider sentence endings other than periods. On exams I thought you got a passing grade for just having your program running, but I got 45% with a running program.

    Thank you though.
  7. Feb 14, 2010 #6
    Clauses inside parenthesis only start with a capital when the parenthesis is its own sentence, so the only time you need to check for a parenthesis is in the type of example pantaz gave (when the parenthesis is its own sentence and not in situations like this where it's combined.) So, basically it's just a nested if.

    But your program didn't work. Checking for all closing punctuation is a couple of more characters of work, not 10 functions worth. It also requires thinking about the problem a drop and generalizing a bit. It seems like you coded a solution to the examples given, not one to the problem the professor set. Dude, it was one problem, so it probably won't matter too much in the long run, and hopefully you'll take away the lesson about good coding practices.
    Last edited: Feb 14, 2010
  8. Feb 14, 2010 #7
    The advice on the parenthesis is good, I see how I can get that to work now. It was just one problem, but I don't think that forgetting to generalize a problem on a short exam should give you a WAY below failing grade. It seems like everyone here thinks it was a fair grade though, so I'll just have to accept that. The lesson learnt from this? Never again take a comp. sci. class from a retired marine from Texas.
  9. Feb 14, 2010 #8


    User Avatar
    Science Advisor
    Gold Member
    2017 Award


    I write Java for a living and I see way too many cases where programmers only consider the specific case mentioned in a bug report. It is really annoying to go back and fix their work because they didn't take the time to consider more than what was written in front of them. It seems that the instructor was attempting to teach this lesson to you in some way.

    However, I do agree with you that getting docked that much for that type of mistake in a short exam where you barely have time to write the code and don't have a lot of time to consider other possibilities. I could MAYBE see getting a bad grade if he had stressed this in class and it was part of a homework problem where you had more time but, I'm not your instructor. :wink:
  10. Feb 14, 2010 #9
    You probably would have lost the same amount of points if you were taking CS 102 from my research mentor, and he's a math PhD from MIT. It's a matter of the teacher's philosophy, not background.

    Huh? It seems like you got points off one problem on an exam that you otherwise did fine on. And that this exam doesn't count all that much in the grand scheme of things.
  11. Feb 14, 2010 #10
    Thank you Borg. No, we had not covered this in class, nor was there any homework on manipulating a string. The closest thing we had done was using string methods to find the index of a certain character, which does relate to this, but we did not use this in correlation with a loop, and after we covered loops we never saw any string methods in homework problems.
  12. Feb 14, 2010 #11


    User Avatar
    Homework Helper

    My only issue is the potential confusion with the term "sentence", which could be mis-interpreted to mean "statement", and not include "question" or "exclamatory statement". This is supposed to a be a programming class, not an exercise in knowledge of English terminology. However, the given example did include "?".

    The other issue is that although your code only covered 1 of the 3 cases, including those conditional would only increaes code size by 5% to 10%, and 80% to 90% of the logic was there in your code. Note that the problem statement didn't address what to do when there were no trailing punctuation marks, so there are actually more than 3 cases.

    The lesson to be learned here would be to ask for clarifcation of the problem statement.

    At a company I worked for, we had one of those "six sigma" classes where one of the exercises was to build the tallest tower from a limited number of tinker toy components as a project for a company. The instructor gave us example "kits", and stated that he would represent the other parts of the company. The point of the exercsise was to show that engineers wouldn't get sufficient feedback to find out that the actual parts would be partially corrupted (holes were plugged in on the "actual" connectors) and that there was a maximum height beyond which the value of the tower would decrease. However I pretty much ruined the exercise by asking if the actual parts would be different than our kits, and if there were any other constraints not mentioned in the original statement, and then asking for a company wide review of our "prototypes" before we decided on a final model.
  13. Feb 14, 2010 #12
    You are right story645, it doesn't count all that much in the grand scheme. It is just about the consistency of his grading with respect to different students.

    Besides, the problem also asked to create a method, pass the string to the method as an argument, return the new fixed string and display the fixed string onto the console. All this I did correctly but it was obviously not taken into consideration during the grading. The question asked me to do 5 things, and I did 4 things correctly but just forgot to generalize the last.
  14. Feb 14, 2010 #13
    So, in my vast experience on this sort of thing, different parts get weighted differently depending on what you'd already learned/been tested on/etc. It could very well be that those 4 things were each worth a point or two and this part (the one that most directly dealt with the question) was worth the most.
  15. Feb 14, 2010 #14
    I will most certainly ask for clarification next time to know exactly how robust the program must be and what exceptions we are expected to cover. I just wish that when generalizing the problem is such a big part of the grade it would be specifically stated on the problem assignment.
  16. Feb 14, 2010 #15


    User Avatar
    Homework Helper

    We also had a years prior TQM Total Quality Management class, called TQIP (Total Quality Improvment Process). Apparently Dogbert convinced our management to pay for both classes:


    Back to the point, sometimes you have to consider some problems as trick questions, both in a classroom as well as the real world.
  17. Feb 15, 2010 #16


    User Avatar
    Science Advisor
    Gold Member

    Oh, the stories I could tell you about TQM, six-sigma, and the myriad other flavor of the month quality 'philosophies' over the past 20 years. Anyways, I think the professor taught you an invaluable real world lesson: Never assume your boss wanted exactly what he/she requested. This will often spare you the indiginity of enduring rants like 'Good God, do I have to explain EVERYTHING to you?'
  18. Feb 15, 2010 #17


    User Avatar
    Science Advisor
    Gold Member
    2017 Award

    Been there, seen that also. I forgot all about TQM. :rofl:
    The funniest ones are always so close to the truth.
    I'll second the boss statement as well. One of our best moments was when we had a customer flat-out state that she didn't want a particular feature after it had been discussed in numerous meetings. We knew that she would forget when the design review rolled around and all of the other managers asked where it was. So, the lead developer wrote the code so that the feature could be turned on with a single variable setting. Sure enough, when everyone asked for it in the design review, she asked how long it would take to implement. We said that we would get her an answer after the lunch break. During lunch, we changed the variable, recompiled the code, and presented it. They were very impressed by our foresight. :tongue:
    Last edited: Feb 15, 2010
  19. Feb 15, 2010 #18


    User Avatar
    Science Advisor
    Gold Member

    Touched a nerve, Borg. I view TQM as the string version of quality management - beautiful, intuitively correct, and incapable of yielding testable predictions. I got ran out of the automotive industry in 1990 for suggesting [once too often] ISO 9000 compliance was a good idea. Back to the point, college is all about thinking outside the box, and so is real world employment. Your training prepares you to confront real world issues with knowledge, pragmatism and achieving effective solutions in a timely manner.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook