Question: (In C++) Write a program that takes in two command line arguments, generates an array of random numbers, and finds the minimum and max values
Your program should take in the number of integers to generate as well as a maximum value for the random number generator. Then, after populating an array with that many random numbers, your solution should output the value and index position of the minimum and maximum values in the randomly generated array. Sub-task 0: using the handout from the lab monitor, sketch out your program solution in pseudo-code first. Sub-task 1: after writing your solution in pseudo-code, write a C++ program that implements your solution: Criteria This exercise is worth 10 pts: 5 pts for the solution and 5 pts for the program. Turn in your written algorithm to your lab monitor before leaving the lab, and make sure to mail your program to the lab monitor as well. . You can assume a maximum array size of 1 million. Use random seed value of 135 Your program should run as follows (to generate an array of . 200000 integers between 1 and 1 million): $ g++ lab9.cpp $./a.out 200000 1000000 Min is 5 at position 49657 Max is 999983 at position 88072 Hint: use a named constant for the aforemention ed maximum size assumption, and then use a sepa rate variable to store the actual number of ite ms passed in via the command line
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
