Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

c++ please include comments 4. The following table shows the enrollment of fresh

ID: 3715182 • Letter: C

Question

c++
please include comments

4. The following table shows the enrollment of freshmen students in some of STEM fields for 2018 S/G Biology Mathematics Computer Science Physics Chemistry Total Men 250 2500 850 200 1050 700 550 1250 Women 700 450 Total 950 750 1000 (a) If a student is selected at random, what is the probability of the student being a woman (b) If a student is selected at random, what is the probability of the student being enrolled in (c) If a student is selected at random, what is the probability of the student not being enrolled (d) If a student is selected at random, what is the probability of the student being enrolled in enrolled in physics? biology or chemistry? in computer science? computer science given that the student is a man? 5. Rewrite the program below and define the function Perm3) which creates a file consisting of all three letter strings without repetition on separate lines. You are allowed to make additional functions, but you cannot include additional libraries. #include #include #include using std; int Perm30: int main() Perm30; return 0

Explanation / Answer

Let us consider the program as bellow

# include<iostream.h>

#include<conio.h>

const int SIZE = 5000;// maximum size considered on the basis of total value given in the table
srand(time(NULL));// initial value is set to null.
int randList [SIZE]; // creation of the list
void init(int randList[], const int SIZE) // function to perform suffling for each trail
{
for (int i=0; i<SIZE; i++)
randList[i] = i % 100;
}
void shuffle (int randList[], const int SIZE)
{
for (int i=0; i<SIZE; i++)
swap(randList,i,(rand() % SIZE));
}

void swap(int randList[], int a, int b) /* based on the given trail the possible out come is to be set and arrange in the order. here two integer variable are used to swap the value among themselves.*/
{
int t = randList[a];
randList[a] = randList[b];
randList[b] = t;
}
bool trial(int randList[], const int SIZE)
{
return(randList[trialCount % SIZE] < randList [SIZE]); // getting the trail outcome value
}
void test(bool * resultList, const int resultSize) // organizing the final value for the list
{
const int SIZE = 1000;
srand(time(NULL));
int randList [SIZE];

init(randList,SIZE);

for (int i=0; i<resultSize; i++)
{
if (i%SIZE == 0)
shuffle(randList,SIZE);

resultList[i] = trial(randList,SIZE,i);
}
}
void main () // creation of the main method
{
const int resultSize = 2000;

bool * resultList = new bool[resultSize];

test(resultList,resultSize);

// check sequence of outcomes

}

********************************

here in the given question, their are 4 bits. so we can apply the each bit value and we can get the final answer. it should be noted that, this program is used to generate the random value out of the given max cont size total value.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote