Thread: 2-d monte carlo integration help

  1. #46
    Registered User
    Join Date
    Sep 2012
    Posts
    48
    ok!

  2. #47
    Registered User
    Join Date
    Oct 2012
    Posts
    7
    I have the completed and functional code but will not post it until the 12 o'clock due time is over since I'm in the same CS 1713 class.

    To show I'm not just pulling your chain here's part of the corrected code:

    -Snipped code since people are sensitive to help-

    Please note that this is not the fully corrected code and will not be compatible with the rest of the code you have posted beforehand.

    Yes it is fully functional.
    Last edited by seemethere; 10-01-2012 at 09:33 PM. Reason: People are sensitive

  3. #48
    Registered User
    Join Date
    Sep 2012
    Posts
    48
    Not allowed to work with people in the same class on assignments, well at least on this one.

  4. #49
    Registered User
    Join Date
    Oct 2012
    Posts
    7
    Quote Originally Posted by jsuite View Post
    Not allowed to work with people in the same class on assignments, well at least on this one.
    Which is why I only posted half of the functional code instead of the full bulk of it.

    I fixed half so that you can hopefully fix the other half on your own before the deadline.

  5. #50
    Registered User
    Join Date
    Oct 2012
    Posts
    2
    I'm also in that class...does anyone understand how we are supposed to turn it in? I'm using Putty and don't get how to email it to her...

  6. #51
    Registered User
    Join Date
    Sep 2012
    Posts
    48
    To actually copy the file, go to the path (as in go to my computer) and navigate to the file.

  7. #52
    Registered User
    Join Date
    Sep 2012
    Posts
    48
    Unfortunately I can't use this because you're in my class.

  8. #53
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Quote Originally Posted by seemethere View Post
    I have the completed and functional code but will not post it until the 12 o'clock due time is over since I'm in the same CS 1713 class.

    To show I'm not just pulling your chain here's part of the corrected code:
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <math.h>
    #define PI 3.14159
    #define RADIUS 20
    
    
    /* 
     * Comment syntax in C is /* as opposed to // in java
     * please remember that because it was quite annoying to
     * fix your code due to all of the //
     */      
    
    
    /* Creating prototypes without "named" variables makes it very confusing
     * to fix your code */      
    double RandNumInRange (double, double);
    int DartHits(double, double);
    /* Rebranded as void (does not need to return anything) */
    void ThrowDarts(unsigned long *, double *, double *, double *, double *);
    void analysis(double,unsigned long,double,
                   double,double,double,unsigned long);
          
          
    int main (void) {
       int seed;
       unsigned long N; /*number of darts to be thrown */ 
       double estRectArea;
       double lowx, lowy, hix, hiy;   
      
       printf("Enter the integer for the seed: ");
       scanf("%d",&seed);
       srand(seed);     
        
       ThrowDarts(&N,&lowx,&lowy,&hix,&hiy);  
       printf("\n");
       return 0;
    }
    void GetBorders(double *xmin, double *xmax, double *ymin, double *ymax) {
       /*double a, b, c, d;
          
       a = -30;
       b = 30;
       c = -30;
       d = 30; These are uneeded */
          
       *xmin = -30;
       *xmax = 30;
       *ymin = -30;
       *ymax = 30;
    }
    double RandNumInRange (double z, double w) { /*where w is any max value, and z is any min value*/ 
       int rn;
            
       rn = (rand() % (int)w + (int)z);
        
          
       return rn;
    }
    
    
    /* Linked our Prof to the thread - Contact Me if you'd like tutoring */
    Please note that this is not the fully corrected code and will not be compatible with the rest of the code you have posted beforehand.

    Yes it is fully functional.
    That's quite a post! I wonder if you're aware that you have plagiarized his program, here?

    And it's a matter of record by date and time of the post, that it belongs to the person with the handle of "jsuite".

    I'm glad you got the program working, but you should receive an F for your plagiarism of his program. Continued plagiarism is cause for removal or suspension from the class, as well as from the school.

    Schools of higher learning REALLY dislike people who steal the work of others, but you may discover that yourself, before long.
    Last edited by Adak; 10-01-2012 at 09:25 PM.

  9. #54
    Registered User
    Join Date
    Oct 2012
    Posts
    2
    Thanks! I'll see if I can do that

  10. #55
    Registered User
    Join Date
    Sep 2012
    Posts
    48
    tl;dr make a thread for help with class. Another student copies and pastes my code, makes it work for them, and tells me they linked prof to thread?

    and then says to contact them for tutoring -_-

  11. #56
    Registered User
    Join Date
    Oct 2012
    Posts
    7
    Just as a disclaimer:

    I have my own program that I finished last week and turned in on Saturday before reading this post.

    Thinking that I would plagiarize code for my own (especially one written with as many errors as this one) is asinine.

    I am posting the code here merely as an exercise for troubleshooting and debugging on my own part.
    Last edited by seemethere; 10-01-2012 at 09:30 PM.

  12. #57
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    So you're not a plagiarist, you're just using this as an stage to display your character and intellect. Well, the latter appears fine, the former appears deformed.

    And for your info, // has been used for one line comments, since Turbo C/C++ ver. 1.01, which was copyrighted back in the late 1980's.

  13. #58
    Registered User
    Join Date
    Oct 2012
    Posts
    7
    I'm merely trying to help jsuite with what is the style outlined for us in class.

    I don't appreciate the hostility as I was just trying to help someone understand how to code independent of a forum.

    to prove my code is independent of jsuite's
    http://i.imgur.com/q0TXM.png

    I will post jsuite's fully corrected code tomorrow morning purely for academic purposes.

  14. #59
    Registered User
    Join Date
    Sep 2012
    Posts
    48
    Just PM it to me if you don't mind.

  15. #60
    Registered User
    Join Date
    Oct 2012
    Posts
    7
    Quote Originally Posted by jsuite View Post
    Just PM it to me if you don't mind.
    After you accused me of being plagiarist?

    I already posted half of the corrected code with hints on how to fix the remainder of the code.

    If you can't figure it out without us doing all of your homework then you don't deserve to finish it at all.

    This forum is not about just doing code for someone else. It is about the collaborative learning experience.

    Adak you are not helping jsuite by simply doing their code for them.
    Last edited by seemethere; 10-01-2012 at 10:01 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Monte Carlo Simulation Optimization
    By Phys10 in forum C++ Programming
    Replies: 5
    Last Post: 08-02-2010, 04:09 AM
  2. Help with C Monte Carlo
    By shaunmikex in forum C Programming
    Replies: 7
    Last Post: 03-21-2010, 05:11 PM
  3. Monte Carlo reliability program - SegFault :(
    By Kibble Fat in forum C Programming
    Replies: 7
    Last Post: 12-15-2009, 02:41 PM
  4. Problem with Monte Carlo(integration by rejection)
    By dionys in forum C Programming
    Replies: 9
    Last Post: 04-07-2004, 09:53 AM
  5. monte carlo methods
    By qwertiop in forum C++ Programming
    Replies: 3
    Last Post: 09-05-2001, 11:29 PM