|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming | |
Greatest and second greatest integer
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) | ||||||||||||||
|
4.0 GHz
![]()
Join Date: Dec 2008
Location: Dripping Springs/Denton
Posts: 890
Rep: 46
![]() Unique Rep: 44
Trader Rating: 1
|
For my mid-term in computer science, I lost points on a certain part of the code. The problem was to find the largest and second largest integer from a text file we made. mine was "23 23 23 23 99 5"
I lost points because he said I did not account for numbers that were the same. I told him that I did that on purpose because I was going off the highest and second highest values in the file. Was I wrong and should be counted off? or do you think the teacher should swallow his pride and admit that was not as clear as he could of been?
__________________
I'm a junior in college, Comp Sci major/math minor, if you wanna talk, send me a pm ![]() The *OFFICIAL* HAF 932 Case Owners Club My HAF 932 Paint Job![]() Water Cooling (own red, need black) Quote:
|
||||||||||||||
|
|
|
|
|
#2 (permalink) | |||||||||||||
|
Custom Techstation FTW
![]() |
I'd go and explain your point of view. If he didn't specify, then I think you should get credit. But if he had specified on the test or even during class then he may be right. People need to not be scared to talk to a teacher.
|
|||||||||||||
|
|
|
|
#3 (permalink) | ||||||||||||||
|
4.0 GHz
![]()
Join Date: Dec 2008
Location: Dripping Springs/Denton
Posts: 890
Rep: 46
![]() Unique Rep: 44
Trader Rating: 1
|
I tried explaining it to him. 3 or 4 of my friends had the same problem and we brought it up in class because we thought others may have had the same problem. He basically said that we were wrong cause he said so and that we should've known. It turned into an argument where he pretty laughed at me (actually chuckled a few times)
edit: The end result was me saying that I would at least prefer it if he could just specify and make it more clear in the future because I don't wanna lose point again because he wasn't clear in his instructions
__________________
I'm a junior in college, Comp Sci major/math minor, if you wanna talk, send me a pm ![]() The *OFFICIAL* HAF 932 Case Owners Club My HAF 932 Paint Job![]() Water Cooling (own red, need black) Quote:
|
||||||||||||||
|
|
|
|
|
#4 (permalink) | |||||||||
|
New to Overclock.net
|
I don't get it, was "23 23 23 23 99 5" the entire contents of your text file or what you returned from the text file that had a bunch more numbers?
__________________
|
|||||||||
|
|
|
|
|
#5 (permalink) | |||||||||||||
|
WaterCooler
![]() |
He was unclear, but you were incorrect.
|
|||||||||||||
|
|
|
|
|
#6 (permalink) | ||||||||||||||
|
4.0 GHz
![]()
Join Date: Dec 2008
Location: Dripping Springs/Denton
Posts: 890
Rep: 46
![]() Unique Rep: 44
Trader Rating: 1
|
it was the entire text file. he just wanted the method and to return the 2 largest numbers so that's what I made as a test file
__________________
I'm a junior in college, Comp Sci major/math minor, if you wanna talk, send me a pm ![]() The *OFFICIAL* HAF 932 Case Owners Club My HAF 932 Paint Job![]() Water Cooling (own red, need black) Quote:
|
||||||||||||||
|
|
|
|
|
#7 (permalink) | ||||||||||||||
|
4.0 GHz
![]()
Join Date: Dec 2008
Location: Dripping Springs/Denton
Posts: 890
Rep: 46
![]() Unique Rep: 44
Trader Rating: 1
|
do you think i should've been counted off though?
__________________
I'm a junior in college, Comp Sci major/math minor, if you wanna talk, send me a pm ![]() The *OFFICIAL* HAF 932 Case Owners Club My HAF 932 Paint Job![]() Water Cooling (own red, need black) Quote:
|
||||||||||||||
|
|
|
|
|
#8 (permalink) | |||||||||||||
|
WaterCooler
![]() |
Just so that I'm clear, on that test file you gave, your program would have returned 23 and 5?
See, I agree that he was unclear, but if you imagine that they were, say, lat/long coordinates, and you were asked to determine which were furthest north, you wouldn't have done that. Say you had 53, 53, 19, 5. Returning 53 and 19 would be wrong. Now, again, he was unclear - but your program didn't do what he wanted. I imagine what he wanted was just a sorting algorithm that would discard non-integers. You went fancy (I imagine), but in doing so you made an assumption, and that never pays off. I think at the end of the day, it's your job to ensure you understand the question. When you catch yourself making assumptions about what your teacher wants, it should be a warning that you may be going off course.
|
|||||||||||||
|
|
|
|
|
#9 (permalink) | ||||||||||||||
|
4.0 GHz
![]()
Join Date: Dec 2008
Location: Dripping Springs/Denton
Posts: 890
Rep: 46
![]() Unique Rep: 44
Trader Rating: 1
|
mine returned 99 and 23. He didn't want a sorting algorithm. The problem was to find the two largest numbers in an array created from a text file that was imported.
I believe the words were "Create a method that imports a text file of numbers into an array and returns the greatest and second greatest numbers"
__________________
I'm a junior in college, Comp Sci major/math minor, if you wanna talk, send me a pm ![]() The *OFFICIAL* HAF 932 Case Owners Club My HAF 932 Paint Job![]() Water Cooling (own red, need black) Quote:
|
||||||||||||||
|
|
|
|
|
#10 (permalink) | |||||||||||||
|
WaterCooler
![]() |
Oh, duh, I was thinking prime instead of integers.
So, what was it in your code that wasn't accounting for numbers of the same size? If it were 99, 23, 99, 23, 23, 5, what would you have returned? 99 and 23? If so, that's incorrect, and he's worded it correctly. If you would have returned 99 and 99, then I don't see the problem. The difference is in the wording. He said "Create a method that imports a text file of numbers into an array and returns the greatest and second greatest numbers", and you seem to have interpreted that as "Create a method that imports a text file of numbers into an array and returns the greatest and second greatest values". They aren't the same thing.
Last edited by MrDeodorant : 3 Weeks Ago at 02:27 PM |
|||||||||||||
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|