Question
I would love some help especially with Parts C & D, if possible. I am having some difficulty with both. P ART B Write the
I would love some help especially with Parts C & D, if possible. I am having some difficulty with both.
PART B
Write the following three functions in a module called Simulate:
Public Function GetRandomUniform(ByVal min As Integer, ByVal max as Integer) as Integer
This function returns a random number from a uniform distribution between min and max.
Public Function GetRandomNormal(ByVal mean As Single, ByVal stddev as Single) as Single
This function returns a random number from a normal distribution with a mean of mean and standard deviation of stddev
Public Function GetBinIndex(ByVal mini As Single, ByVal maxi As Single, ByVal numbins as _ Integer, ByVal valuetobin as Single) As Integer
This function returns the Bin Index given an output minimum of mini, output maximum of maxi, numbins number of bins, and a value to bin of valuetobin
PART C
Include the module created in part B to develop a Visual Basic .NET program that will simulate the basic profit calculation, PT = nPv, where n follows a uniform distribution, Pv follows a normal distribution, and the user can input the number of bins and number of iterations. The user must also input the min and max for n and the mean and standard deviation for Pv. Finally, the user can click a button and the results will be graphed on a bar chart using the Microsoft Chart Control and the average total profit (PT) will be displayed in a textbox. Turn in a screen shot of the resulting chart using:
1. Iterations: 10000 Bins: 5 n-min: 1 n-max: 10 Pv-mean: 9000 Pv-stddev: 1200 2. Iterations: 10000 Bins: 10 n-min: 1 n-max: 10 Pv-mean: 9000 Pv-stddev: 1200 3. Iterations: 10000 Bins: 10 n-min: 1 n-max: 10 Pv-mean: 7000 Pv-stddev: 1500
Thats three screen shots.
PART D
Extend the Visual Basic .NET program developed in part C to simulate the basic profit calculation, PT = nPv, where the user can select either a uniform or normal distribution for n using radio buttons and then must input the appropriate parameters (min and max if they select uniform, mean and standard deviation if they select normal) and they can similarly select either a uniform or normal distribution for Pv with appropriate parameters depending on the selection. Of course, the user will input the number of bins and number of iterations. Finally, the user can click a button and the results will be graphed on a bar chart using the Microsoft Chart Control and the average total profit (PT) will be displayed in a textbox. Also include in the program any necessary input validation for all input values. Turn in a listing of the code and a screen shot of the resulting chart using:
1. Iterations: 10000 Bins: 5 n-min: 1 n-max: 10 Pv-mean: 10000 Pv-stddev: 2500 2. Iterations: 10000 Bins: 10 n-mean: 6 n-stddev: 1 Pv-min: 1500 Pv-max: 9000 3. Iterations: 10000 Bins: 10 n- mean: 10 n- stddev: 3 Pv-min: 1500 Pv-max: 10000
Thats three screen shots and a listing.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started