Create a function template that computes and displays the absolute value of a passed argument. (By "absolute value" we mean that the template returns the number with no sign, whether the passed argument number is positive or negative.)
Create a program that uses this function template, passing in two arguments of type int, float, and double variable.
Have the template produce as output "The absolute value of number is (put in absolute value of number here)."© BrainMass Inc. brainmass.com October 25, 2018, 9:16 am ad1c9bdddf
The solution gives a complete c++ program for performing absolute value operations.
C++ Code for Testing Random Number Generator
I am using "Numerical Recipes (3rd Edition)" to create a numerical method that computes random numbers. My problem is that I'd like to use tests such as Chi-Square to test the uniformity/performance of the generator, but I don't know how to do this.
You can see my basic number generator in the readable file randomnumbers. I've included portions from "Numerical Recipes" (which you can easily find on Scribd) on random numbers and statistical functions. Based on the structure of the codes, I need help writing a program that uses Chi-Square (or something else appropriate from statistical functions.pdf) to test my random number generator.
I am extremely new to c++, so if my bid is too low please let me know. I'm not sure how long the necessary code will be or how much expertise it will require, so I don't know how much you will charge.
In case you can't read my cpp code, it's very basic:
Int seed = 12345678;
cout<<"Using ran = " << myran.doub() <<endl;
and returns 10 random numbers. This is just an example, it probably isn't my final code, just something simple for you to see what I'm going for. Please note that I am very weak with c++ and really don't know much about what I'm doing.View Full Posting Details