Computer Science Canada Teacher being weird? |
Author: | Panphobia [ Thu Dec 13, 2012 8:52 pm ] | ||
Post subject: | Teacher being weird? | ||
So we did our sorting/searching assignment, my algorithms work perfectly fine, we had to do selection sort, bubble sort, quick sort, and insertion sort, ascending arrray, and descending, for some reason I did not get perfect even though I met all requirements and my code is right inline to his pseudocode, can you guys tell me what is wrong with my code please, I am really annoyed, it was also supposed to be in a GUI, so that is why I can only give methods
|
Author: | Zren [ Thu Dec 13, 2012 10:32 pm ] |
Post subject: | RE:Teacher being weird? |
Why did you use arrays declared outside of a function instead of passing the array as a parameter? Essentially making the function only work for one array. Typos: //quik sort ascending Why do you initialize the variables when you declare them, if you re-intialize them right away? Further learning: Note how the difference between ASC and DESC is usually only the one comparison. Java has an interface for this specific area: Comparator. |
Author: | Panphobia [ Thu Dec 13, 2012 10:42 pm ] |
Post subject: | RE:Teacher being weird? |
Ok zren do you want me to screen shot the requirments? he wanted seperate methods fr ascending and descending and always docs marks for not initializing like that, WEIRD TEACHER |
Author: | crossley7 [ Fri Dec 14, 2012 1:51 am ] |
Post subject: | RE:Teacher being weird? |
Coming on here is not where you are going to find your answer. None of us know how your teacher marks and therefore we can't tell you why he docked marks. your best chance is to just go to him and ask him yourself. Also watch your spelling. There are a bunch of errors (docks not docs). Now in terms of conventions, your code seems long and the suggestions zren made are good to help with a bunch of the code specific problems. When designing something, you want to make your code as flexible as possible while maintaining efficiency since even if you think you will never need it again, you never know. (I recently went through a 1500+ line, 10 file program to modify a fixed array to be defined relative to a constant so it can be changed to my liking with ease) |
Author: | Panphobia [ Fri Dec 14, 2012 8:13 am ] |
Post subject: | RE:Teacher being weird? |
I really do not care about spelling on the internet, maybe a grammar nazi like you might, but it is the last thing on my mind when I am writing on the internet. |
Author: | Insectoid [ Fri Dec 14, 2012 8:25 am ] |
Post subject: | RE:Teacher being weird? |
Well, here's the thing. When your spelling and grammar are crap, you look really dumb. If you can't put in any effort to make your post readable, why should we put in any effort to help you? Reading poorly structured and punctuated posts takes a lot of energy that I'm not always willing to give. |
Author: | AntoxicatedDevil78 [ Fri Dec 14, 2012 9:58 am ] |
Post subject: | RE:Teacher being weird? |
You will need to work on what you have shown poorly. |
Author: | Panphobia [ Fri Dec 14, 2012 10:48 am ] |
Post subject: | RE:Teacher being weird? |
I dont wanna be disrespectful but if you really cared about grammar you would not be a part of this site, Dan has very poor grammar, and none of you say anything. |
Author: | Insectoid [ Fri Dec 14, 2012 11:32 am ] |
Post subject: | RE:Teacher being weird? |
Dan has dyslexia. |
Author: | Zren [ Fri Dec 14, 2012 1:04 pm ] | ||
Post subject: | RE:Teacher being weird? | ||
Do you spell check your resume? What about your English assignments? Your code represents you even more than that resume does (most likely). You don't write code for you to understand, you write code for others to read (like your teacher). As for the matter of needing a method that will be called for use in a GUI:
Nothing is stopping you from having another function from calling another with baked in arguments. One final thing I noticed, why are the algorithms of your bubble sort different? Ascending has an extra variable 'button' while descending does not. |
Author: | Panphobia [ Fri Dec 14, 2012 1:13 pm ] |
Post subject: | RE:Teacher being weird? |
I think I made an improvement on the bubble sort so it is more efficient and forgot to change the other, but that isnt what he said was wrong, he said the selection sort was wrong :S |