Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use visual studio to create this c++ program. Y ou are a biomedical engineer working for Smith and Jones pharmaceuticals. You have been tasked with

Use visual studio to create this c++ program.

You are a biomedical engineer working for Smith and Jones pharmaceuticals. You have been tasked with providing a series of random numbers to use in a vaccine potency study. As this is one of your first assignments in a new job. you want to make sure that the data you will be providing is truly random. Your boss said you can't use excel so you must write your own code. You decide to use the random number generator that exist is C++, but you want to test it first to make the numbers generated are truly random. As, such you do the following:

-Write C++ code that generates 500 random numbers between 1 and 50. You device a scheme to count the number of instances each number falls into a bin of five . For example, you set up bins of:

1-5

6-10

11-15

16-20....

For each random number generated, you "sort" it into a bin and then compare the total amount of random numbers that have fallen into each bin. You presume that if the random number generator is truly random, the total amount of numbers in each bin should be fairly equivalent.

To make your life easy, you also write a function to graph out the results. The graph looks like the following:

Bin

1-5: **************

6-10:****************

11-15:************

16-20:***************

Ect

Each star represents a certain quantity that is scaled correctly to fit across the computer screen.

Once you have the basic algorithm working, you make the following changes to the program:

1)Allow the user to choose how many random numbers should be generated .

2)Determine if the sum of each bin is within a certain designated range. The range is to be supplied by the user. Display the results of the anaysis.

3) You must error check:

-for positive integers. Do not generate over 5,000 random numbers.

-For positive integers. The range should not be greater 5% of the number of random numbers.

NOTE:

1) The valid range for number of random numbers generated is 1 - 5000;

2) When making the graph of horizontal *'s, make sure it does not line feed/carriage return if the number of items in a bin exceed the window width. You will need to scale down the results and communicate the scale factor.

3) THe last instruction in the write up is confusing due to my poor editing ability. My intent is to have you calculate the amount of variation of the bins to see if the random number generator distributes numbers equally across the range.

As such, if I ask to test for 10%, you should determine if the high and low bin vary by more than 10%. If it does, I conclude that the generator is not working. If it does not, I accept the results.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

3. Existing organizations and programs constrain behavior.

Answered: 1 week ago