C-language - coding by using CodeBlocks and following everything in the attached only
Homework 5 CIS 1 6 0 FS2 0 1 5
Due: Tuesday November 10th at the beginning of lecture
Points available: 50pts
For this assignment you will turn in:
In class(10pts):
1. A statement of the problem (typed)
2. An explanation of your solution (typed)
3. A flowchart (hand-drawn or computer generated)
4. Pseudocode (typed)
Via BlackBoard(40pts):
1. C program named <username>_monte_carlo.c
Assignment:
Follow the steps that we have outlined in class for algorithm development to generate a program that
estimates the value of π using a Monte Carlo simulation. See the following website for some additional
details: http://polymer.bu.edu/java/java/montepi/MontePi.html
Specifications:
Functions:
1. void getRandomXY(*float x, *float y)
a. gives a random (x,y) pair 2. int insideCircle(float x, float y)
a. returns whether the point is inside the circle (0->false, 1->true)
* This is the minimum functions that you must use. You may use others if you like.
Outputs:
1. Your estimated value of π
Other:
1. This is individual work. You may NOT work in groups.
2. Please staple all work together.
3. You are expected to error check.
4. For code: No compile = No points, no exceptions!
5. Start Early! This will take some research: Monte Carlo Method, using Random variables, etc.