Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 3 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 28 Jul 2017 My Price 5.00

returns a random number

In C++.

 

Create a function/method/procedure that

returns a random number from the following set, {8,51,78,111,121}. Loop 10000 times with this procedure and print the frequency of each of the 5 numbers obtained. Hint: Use an array for the sequence and frequency. The following is a brief hint on items that might be helpful in obtaining the results. This is not direct code but more pseudo code related. Don't try and run the following directly and more code will be needed.

Setup

const int n=5,ntimes=10000; int freq[n]={0}; short int rndseq[]={8,51,78,111,121}; Call to the routine to return a random sequence retrand(rndseq,freq,n,ntimes); Results cout<<rndseq[i]<<" occured "<< freq[i]<<" times"<<endl; Sample Output 8 occured 2055 times 51 occured 1986 times 78 occured 1962 times 111 occured 2079 times 121 occured 1919 times Note: Your results are not expected to be exactly the same! After all these are pseudo-random number sequences with different seeds. */

Answers

(5)
Status NEW Posted 28 Jul 2017 12:07 AM My Price 5.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------sol-----------uti-----------on.-----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- ca-----------tch-----------

Not Rated(0)