CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2010
    Posts
    1

    Stressing about my Final, Help? :)

    Hello all, I'm a long time reader/surfer of these forums, I've just recently registered in hopes that I can get a little help. And by a little I mean, a fair amount. It would be greatly appreciated.

    The help I require is just a basic looking over of final and a brief description of the steps you would take. I've gone over it a couple times with pencil/paper but I never really seem to get to the same place, especially with questions 1 and 2.

    My prof is a bit of a dink and has admitted to not teaching us as much of the required course material as possible within the allotted time, and thus has given us a mock exam.

    Anyway, I guess it's a combination of me not being the best programmer in the world (doing it for a science degree breadth program) and his lack of efficiency.

    All in all, if anyone bothers to help me out, I will FedEx you my firstborn child.
    Attached Files Attached Files

  2. #2
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: Stressing about my Final, Help? :)

    And by a little I mean, a fair amount.

    All in all, if anyone bothers to help me out, I will FedEx you my firstborn child.
    Well I was going to offer you my help but with a threat like that I'm rapidly having seconds thoughts. However, if you were to promise you were going to FedEx a fine wine (or even a large bar of chocolate) I may just have a change of heart.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

  3. #3
    Join Date
    Feb 2003
    Location
    Sunny Glasgow!
    Posts
    258

    Re: Stressing about my Final, Help? :)

    Take it one line at a time - after each line, write down what the variable is.
    If you are still struggling, you could always type it all into the computer and run the program yourself.

  4. #4
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: Stressing about my Final, Help? :)

    It's easy to miss a step out when working through a code such as that shown in the example especially when you are new to reading code so you need to be really methodical.

    Work through the code step and step writing down everything that prints out. When you have finished start again from the beginning and for each line you find that prints out check you have it written down correctly. If you find a discrepancy find out why before you proceed further. Repeat this process until you find no errors.

    Finally, when you are sure you have it right (and only once you are sure) run the code and compare the output with your written output. There's no point running the code before you are sure you have done it correctly or you will learn nothing. If, having run the code, you find you made a mistake find where you went wrong and more importantly why you went wrong.

    As for the other questions post your answers and reasons for your answers and we will verify them for you.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured