Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming

Reply
 
LinkBack Thread Tools
Old 3 Weeks Ago   #1 (permalink)
4.0 GHz
 
MeeksMan13's Avatar
 
intel nvidia

Join Date: Dec 2008
Location: Dripping Springs/Denton
Posts: 890

Rep: 46 MeeksMan13 is acknowledged by some
Unique Rep: 44
Trader Rating: 1
Default Greatest and second greatest integer

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)
Click below to show/hide Hidden Text Below!

Apogee XT
TFC XChanger 360
Inverse T-Virus
1/2" Black Barbs
10' 7/16" Tygon
EK D5 Pump Top

Swiftech MCP655 Vario
Need: $100


Quote:
Once I went out and got drunk. then came home and thought it would be a good idea to overclock enough join the 100% overclockers club. Lesson learned: you CAN'T get to 6 GHz when you're hammered.-pfritzmorkin

System: The Factory
CPU
E8500 @ 4.25 gHz
Motherboard
EVGA 780i FTW
Memory
Patriot Viper 2 x 2 GB PC 8500
Graphics Card
2x GTX 260
Hard Drive
Samsung 750GB 7200 RPM; 300 GB Seagate
Sound Card
Creative X-Fi Platinum w/ FD Bay
Power Supply
OCZ 700w Fatal1ty Edition
Case
HAF 932 (Painted)
CPU cooling
Hyper Z600R (Apogee XT soon)
GPU cooling
Stock
OS
Windows 7 64 bit
Monitor
Acer 22" X223W
MeeksMan13 is offline   Reply With Quote
Old 3 Weeks Ago   #2 (permalink)
Custom Techstation FTW
 
IEATFISH's Avatar
 
amd ati

Join Date: Jul 2008
Location: Idaho
Posts: 6,119
Blog Entries: 1

Trader Rating: 10
Default

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.

System: <Name Pending>
CPU
Phenom II x4 945 @ 3.6 GHz
Motherboard
GIGABYTE GA-MA790XT-UD4P
Memory
OCZ Reaper HPC 4GB (2 x 2GB) DDR3 1600
Graphics Card
Asus 5850
Hard Drive
WD Caviar Black 640GB, Maxtor 400GB, WD 320GB
Sound Card
SoundBlaster X-Fi XtremeGamer
Power Supply
CORSAIR CMPSU-750TX 750W
Case
LIAN LI PC-7FW (custom tech station on the way)
CPU cooling
Mugen 2 w/ 2 Scythe Slip Steam 120mm
GPU cooling
Stock
OS
Windows 7 Professional x64
Monitor
Acer X223Wbd 22"
Overclock.net - 2009 Chimp Challenge Champions
IEATFISH is offline Overclocked Account IEATFISH's Gallery   Reply With Quote
Old 3 Weeks Ago   #3 (permalink)
4.0 GHz
 
MeeksMan13's Avatar
 
intel nvidia

Join Date: Dec 2008
Location: Dripping Springs/Denton
Posts: 890

Rep: 46 MeeksMan13 is acknowledged by some
Unique Rep: 44
Trader Rating: 1
Default

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)
Click below to show/hide Hidden Text Below!

Apogee XT
TFC XChanger 360
Inverse T-Virus
1/2" Black Barbs
10' 7/16" Tygon
EK D5 Pump Top

Swiftech MCP655 Vario
Need: $100


Quote:
Once I went out and got drunk. then came home and thought it would be a good idea to overclock enough join the 100% overclockers club. Lesson learned: you CAN'T get to 6 GHz when you're hammered.-pfritzmorkin

System: The Factory
CPU
E8500 @ 4.25 gHz
Motherboard
EVGA 780i FTW
Memory
Patriot Viper 2 x 2 GB PC 8500
Graphics Card
2x GTX 260
Hard Drive
Samsung 750GB 7200 RPM; 300 GB Seagate
Sound Card
Creative X-Fi Platinum w/ FD Bay
Power Supply
OCZ 700w Fatal1ty Edition
Case
HAF 932 (Painted)
CPU cooling
Hyper Z600R (Apogee XT soon)
GPU cooling
Stock
OS
Windows 7 64 bit
Monitor
Acer 22" X223W
MeeksMan13 is offline   Reply With Quote
Old 3 Weeks Ago   #4 (permalink)
New to Overclock.net
 
amd nvidia

Join Date: Oct 2009
Posts: 162

Rep: 9 Hindsight Unknown
Unique Rep: 9
Folding Team Rank: 730
Trader Rating: 0
Default

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?
__________________
System: Old man on crutches
CPU
Athlon X2 6000+ Windsor
Motherboard
Asus M2N-SLI Deluxe
Memory
4GB DDR2 800 G.Skill
Graphics Card
EVGA GTX 260
Hard Drive
WD 120GB SATA
Power Supply
PC Power & Cooling 750w
Case
Antec P182
OS
XP 32bit SP3
Hindsight is offline I fold for Overclock.net   Reply With Quote
Old 3 Weeks Ago   #5 (permalink)
WaterCooler
 
intel nvidia

Join Date: Nov 2008
Posts: 771

Rep: 49 MrDeodorant is acknowledged by some
Unique Rep: 40
Trader Rating: 0
Default

He was unclear, but you were incorrect.
__________________
Quote:
Originally Posted by RayvinAzn View Post
Give me physics, not PhysX.

System: Unicorn
CPU
i7 C0 @ 4.0 GHz
Motherboard
Asus P6T Deluxe V1
Memory
6 GB Patriot
Graphics Card
8800GTS 640MB @ 660/960
Hard Drive
WD Caviar Black 1 TB
Sound Card
Onboard
Power Supply
750 Watt OCZ
Case
Modded CM 690
CPU cooling
Apogee GT
GPU cooling
Swiftech full-cover block
OS
Windows 7 / XP Pro
Monitor
Samsung 2443
MrDeodorant is offline   Reply With Quote
Old 3 Weeks Ago   #6 (permalink)
4.0 GHz
 
MeeksMan13's Avatar
 
intel nvidia

Join Date: Dec 2008
Location: Dripping Springs/Denton
Posts: 890

Rep: 46 MeeksMan13 is acknowledged by some
Unique Rep: 44
Trader Rating: 1
Default

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)
Click below to show/hide Hidden Text Below!

Apogee XT
TFC XChanger 360
Inverse T-Virus
1/2" Black Barbs
10' 7/16" Tygon
EK D5 Pump Top

Swiftech MCP655 Vario
Need: $100


Quote:
Once I went out and got drunk. then came home and thought it would be a good idea to overclock enough join the 100% overclockers club. Lesson learned: you CAN'T get to 6 GHz when you're hammered.-pfritzmorkin

System: The Factory
CPU
E8500 @ 4.25 gHz
Motherboard
EVGA 780i FTW
Memory
Patriot Viper 2 x 2 GB PC 8500
Graphics Card
2x GTX 260
Hard Drive
Samsung 750GB 7200 RPM; 300 GB Seagate
Sound Card
Creative X-Fi Platinum w/ FD Bay
Power Supply
OCZ 700w Fatal1ty Edition
Case
HAF 932 (Painted)
CPU cooling
Hyper Z600R (Apogee XT soon)
GPU cooling
Stock
OS
Windows 7 64 bit
Monitor
Acer 22" X223W
MeeksMan13 is offline   Reply With Quote
Old 3 Weeks Ago   #7 (permalink)
4.0 GHz
 
MeeksMan13's Avatar
 
intel nvidia

Join Date: Dec 2008
Location: Dripping Springs/Denton
Posts: 890

Rep: 46 MeeksMan13 is acknowledged by some
Unique Rep: 44
Trader Rating: 1
Default

Quote:
Originally Posted by MrDeodorant View Post
He was unclear, but you were incorrect.
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)
Click below to show/hide Hidden Text Below!

Apogee XT
TFC XChanger 360
Inverse T-Virus
1/2" Black Barbs
10' 7/16" Tygon
EK D5 Pump Top

Swiftech MCP655 Vario
Need: $100


Quote:
Once I went out and got drunk. then came home and thought it would be a good idea to overclock enough join the 100% overclockers club. Lesson learned: you CAN'T get to 6 GHz when you're hammered.-pfritzmorkin

System: The Factory
CPU
E8500 @ 4.25 gHz
Motherboard
EVGA 780i FTW
Memory
Patriot Viper 2 x 2 GB PC 8500
Graphics Card
2x GTX 260
Hard Drive
Samsung 750GB 7200 RPM; 300 GB Seagate
Sound Card
Creative X-Fi Platinum w/ FD Bay
Power Supply
OCZ 700w Fatal1ty Edition
Case
HAF 932 (Painted)
CPU cooling
Hyper Z600R (Apogee XT soon)
GPU cooling
Stock
OS
Windows 7 64 bit
Monitor
Acer 22" X223W
MeeksMan13 is offline   Reply With Quote
Old 3 Weeks Ago   #8 (permalink)
WaterCooler
 
intel nvidia

Join Date: Nov 2008
Posts: 771

Rep: 49 MrDeodorant is acknowledged by some
Unique Rep: 40
Trader Rating: 0
Default

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.
__________________
Quote:
Originally Posted by RayvinAzn View Post
Give me physics, not PhysX.

System: Unicorn
CPU
i7 C0 @ 4.0 GHz
Motherboard
Asus P6T Deluxe V1
Memory
6 GB Patriot
Graphics Card
8800GTS 640MB @ 660/960
Hard Drive
WD Caviar Black 1 TB
Sound Card
Onboard
Power Supply
750 Watt OCZ
Case
Modded CM 690
CPU cooling
Apogee GT
GPU cooling
Swiftech full-cover block
OS
Windows 7 / XP Pro
Monitor
Samsung 2443
MrDeodorant is offline   Reply With Quote
Old 3 Weeks Ago   #9 (permalink)
4.0 GHz
 
MeeksMan13's Avatar
 
intel nvidia

Join Date: Dec 2008
Location: Dripping Springs/Denton
Posts: 890

Rep: 46 MeeksMan13 is acknowledged by some
Unique Rep: 44
Trader Rating: 1
Default

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)
Click below to show/hide Hidden Text Below!

Apogee XT
TFC XChanger 360
Inverse T-Virus
1/2" Black Barbs
10' 7/16" Tygon
EK D5 Pump Top

Swiftech MCP655 Vario
Need: $100


Quote:
Once I went out and got drunk. then came home and thought it would be a good idea to overclock enough join the 100% overclockers club. Lesson learned: you CAN'T get to 6 GHz when you're hammered.-pfritzmorkin

System: The Factory
CPU
E8500 @ 4.25 gHz
Motherboard
EVGA 780i FTW
Memory
Patriot Viper 2 x 2 GB PC 8500
Graphics Card
2x GTX 260
Hard Drive
Samsung 750GB 7200 RPM; 300 GB Seagate
Sound Card
Creative X-Fi Platinum w/ FD Bay
Power Supply
OCZ 700w Fatal1ty Edition
Case
HAF 932 (Painted)
CPU cooling
Hyper Z600R (Apogee XT soon)
GPU cooling
Stock
OS
Windows 7 64 bit
Monitor
Acer 22" X223W
MeeksMan13 is offline   Reply With Quote
Old 3 Weeks Ago   #10 (permalink)
WaterCooler
 
intel nvidia

Join Date: Nov 2008
Posts: 771

Rep: 49 MrDeodorant is acknowledged by some
Unique Rep: 40
Trader Rating: 0
Default

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.
__________________
Quote:
Originally Posted by RayvinAzn View Post
Give me physics, not PhysX.

System: Unicorn
CPU
i7 C0 @ 4.0 GHz
Motherboard
Asus P6T Deluxe V1
Memory
6 GB Patriot
Graphics Card
8800GTS 640MB @ 660/960
Hard Drive
WD Caviar Black 1 TB
Sound Card
Onboard
Power Supply
750 Watt OCZ
Case
Modded CM 690
CPU cooling
Apogee GT
GPU cooling
Swiftech full-cover block
OS
Windows 7 / XP Pro
Monitor
Samsung 2443

Last edited by MrDeodorant : 3 Weeks Ago at 02:27 PM
MrDeodorant is offline   Reply With Quote
Reply


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



All times are GMT -5. The time now is 05:27 AM.


Overclock.net is a Carbon Neutral Site Creative Commons License

Terms of Service / Forum Rules | Privacy Policy | DMCA Info | Advertising | Become an Official Vendor
Copyright © 2009 Shogun Interactive Development. Most rights reserved.
Page generated in 0.12768 seconds with 8 queries