C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 22nd, 2009, 05:28 PM
thebestpokerfac thebestpokerfac is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 4 thebestpokerfac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 58 sec
Reputation Power: 0
Calling out C++ Pros! Mutliple Ques. Help Needed.

TYTYTYTYTYTY

Reply With Quote
  #2  
Old October 23rd, 2009, 12:22 AM
Murdo Murdo is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 7 Murdo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 44 m
Reputation Power: 0
Are you seriously asking someone on these forums to waste their time filling in YOUR quiz? I mean, if you had actually tried and posted your answers I'd be at least somewhat convinced you'd looked at it.

If I really wanted to waste my time in order to give you the answers you can bet I wouldn't give you the right answers.

Here's a tip: Crack open the book, start at chapter 1. You'll find the answers there.

Reply With Quote
  #3  
Old October 23rd, 2009, 03:05 PM
thebestpokerfac thebestpokerfac is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 4 thebestpokerfac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 58 sec
Reputation Power: 0
Quote:
Originally Posted by Murdo
Are you seriously asking someone on these forums to waste their time filling in YOUR quiz? I mean, if you had actually tried and posted your answers I'd be at least somewhat convinced you'd looked at it.

If I really wanted to waste my time in order to give you the answers you can bet I wouldn't give you the right answers.

Here's a tip: Crack open the book, start at chapter 1. You'll find the answers there.


Lol. this is not a quiz or a hw. This is a review questions for the test coming up. I should of written my situation here earlier, sorry about that.
Trying to study in library but I had no ways to correct myself if I was wrong or not...

so heres my answers, hopefully someone can help me out here.

1. A
2. E
3. D
4. C
5. A
6. (No clue )
7. (No clue )
8. B
9. D
10. D (Unsure)
11. D counts the " " space as well.
12. B
13. F
14. A
15. E (Unsure)
16. D
17. D!
18. A
19. E! it runs till user inputs negative #
20. E
21. E
21. C because the sequential search starts from first to last.
23. B

Reply With Quote
  #4  
Old October 24th, 2009, 12:06 PM
thebestpokerfac thebestpokerfac is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 4 thebestpokerfac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 58 sec
Reputation Power: 0
bump~

Reply With Quote
  #5  
Old October 24th, 2009, 09:18 PM
MaHuJa's Avatar
MaHuJa MaHuJa is offline
Contributing User
Click here for more information.
 
Join Date: Dec 2007
Posts: 990 MaHuJa User rank is Private First Class (20 - 50 Reputation Level)MaHuJa User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 15 h 32 m 39 sec
Reputation Power: 3
Send a message via Skype to MaHuJa Send a message via XFire to MaHuJa
Quote:
Trying to study in library but I had no ways to correct myself if I was wrong or not...
http://en.wikipedia.org/wiki/Dunning-Kruger_effect

1. A -- correct
2. E -- There are only 4 alternatives, but the last one is the one that handles it best.
3. D -- correct
4. C -- correct
5. A -- correct
6. (No clue ) -- E is the correct answer. The runtime error in question is checking A[k] when k==N, which is right outside the array. This results in "undefined behavior". If you're lucky the program just crashes right then and there. (Since this is off-by-one, that's not very likely.) The usual way to write that function is to have an if (...) { return true;} as part of the loop, rather than in the loop condition (and then after).
7. (No clue ) -- E. Assuming "protype" should be prototype. The full truth is far more involved, and is that function prototypes are basically just the "declaration" of a function like a variable; and that the types (parameter list, return type) can be checked to see if they are valid and what conversions needs to be made.
8. B -- correct. If flag was initialized true, it would not fit any of the options. (false if any negative)
9. D -- Wrong. By the time it reaches the second statement, n<=0. The correct answer is A.
10. D (Unsure) -- correct
11. D counts the " " space as well. -- A. Unless there's some significant corruption of what's shown on the way of your posting it here, the ‘’ will have the compiler complain. It needs to be ', and there needs to be a character in between them.
12. B -- correct. Except there should be spaces between the outputs.
13. F -- correct. (Where did E go?)
14. A -- This question does not give enough detail - in many cases, it is a requirement to give (position of) the first value where there are multiple. In that case, D. Or a modified/composite search and A. Else A.
15. E (Unsure) -- correct
16. D -- correct
17. D! -- E. Often, runtime errors are very dependent on inputs. Programming such that D is true is an ideal; which we don't reach all that often.
18. A -- correct.
19. E! it runs till user inputs negative # -- B. It is initialized to 1 instead of 0, thus the sum of these even numbers would be an odd number.
20. E -- correct. Horrible programming practice though
21. E -- C. The idea is that the binary search has to do the full log(n) to reach the first element, while the sequential search will check it in its first operation.
21. C because the sequential search starts from first to last. -- err... why was this repeated?

I noticed there was no 22 there. The correct answer to 22 is B.

23. B -- correct.


On a last note, I see you calling this C++ at the top. I call this C with iostreams which is a different language from C++ altogether. It just needs most of a C++ compiler to compile. IMNSHO anyway.
__________________
Quote:
Programming by Coincidence
Fred types in some more code, tries it, and it still seems to work. [Then] the program suddenly stops working. [...] Fred doesn’t know why the code is failing because he didn’t know why it worked in the first place.

Reply With Quote
  #6  
Old October 24th, 2009, 10:16 PM
thebestpokerfac thebestpokerfac is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 4 thebestpokerfac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 58 sec
Reputation Power: 0
Wow genius.
Thank you very much!
If there were points to give you on this forum.

for ( i = 1; i > 0; i++)
{
give points to MaHuJa
}


Reply With Quote
  #7  
Old October 28th, 2009, 03:06 AM
Murdo Murdo is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 7 Murdo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 44 m
Reputation Power: 0
Talking

Quote:
Originally Posted by thebestpokerfac
Lol. this is not a quiz or a hw. This is a review questions for the test coming up. I should of written my situation here earlier, sorry about that.
Trying to study in library but I had no ways to correct myself if I was wrong or not...

so heres my answers, hopefully someone can help me out here.

1. A
2. E
3. D
4. C
5. A
6. (No clue )
7. (No clue )
8. B
9. D
10. D (Unsure)
11. D counts the " " space as well.
12. B
13. F
14. A
15. E (Unsure)
16. D
17. D!
18. A
19. E! it runs till user inputs negative #
20. E
21. E
21. C because the sequential search starts from first to last.
23. B


I apologize.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Calling out C++ Pros! Mutliple Ques. Help Needed.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 11 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek